diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2012-02-11 21:39:32 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2012-02-11 21:56:03 +0100 |
commit | 3b82e425349355a09f3a53a9fb46ed4b92537af6 (patch) | |
tree | 0d5887c588291f43e09e929bdfd67136817c1381 | |
parent | 33105e6a62a6eb0927baf3bc2794866a8e7a6917 (diff) | |
download | quilt-3b82e425349355a09f3a53a9fb46ed4b92537af6.tar.gz |
edmail: Allow to add "good" recipient addresses while skipping "bad" ones
-rw-r--r-- | quilt/scripts/edmail.in | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/quilt/scripts/edmail.in b/quilt/scripts/edmail.in index 140355b..d0e8ca6 100644 --- a/quilt/scripts/edmail.in +++ b/quilt/scripts/edmail.in @@ -36,6 +36,11 @@ sub _($) { return gettext(shift); } +my $special = '()<>\[\]:;@\\,"'; # special characters +my $special_dot = "$special."; # special characters + dot + +sub check_recipient($); + my (%append_name, %append_value, $remove_empty_headers, %remove_header, %extract_recipients_from, %replace_name, %replace_value, $charset); GetOptions('add-recipient=s%' => @@ -43,6 +48,17 @@ GetOptions('add-recipient=s%' => $append_name{lc $_[1]} = $_[1]; $append_value{lc $_[1]} .= ",\n " . $_[2]; }, + 'add-good-recipient=s%' => + sub { + eval { check_recipient($_[2]) }; + if ($@) { + chomp $@; + print STDERR "$@; skipping\n"; + } else { + $append_name{lc $_[1]} = $_[1]; + $append_value{lc $_[1]} .= ",\n " . $_[2]; + } + }, 'remove-header=s' => sub { $remove_header{lc $_[1]}++ }, 'remove-empty-headers' => \$remove_empty_headers, 'replace-header=s%' => @@ -61,9 +77,6 @@ sub encode_header($) { return "=?$charset?q?$word?="; } -my $special = '()<>\[\]:;@\\,"'; # special characters -my $special_dot = "$special."; # special characters + dot - # Check for a valid display name sub check_display_name($) { my ($display) = @_; |