X-Git-Url: http://git.jankratochvil.net/?p=PerlMail.git;a=blobdiff_plain;f=perlmail-sendmail;h=64cf70366463b033ef265d5672d440b69d655503;hp=b6b1b07b03f6a4be33b75fc04c765e528cd0f137;hb=ba95562b1683631fd058e10bb8205dfecd3e3fe8;hpb=900add68079f0eaf9e7575e7ee16ca266ef3e9eb diff --git a/perlmail-sendmail b/perlmail-sendmail index b6b1b07..64cf703 100755 --- a/perlmail-sendmail +++ b/perlmail-sendmail @@ -73,8 +73,8 @@ my @h_from=( ); -# FIXME: modularized unification with 'lacemail-accept' -# BEGIN lacemail-accept +# FIXME: modularized unification with 'perlmail-accept' +# BEGIN perlmail-accept our %muttrc_pending=(); sub muttrc { @@ -143,7 +143,7 @@ my(@headers)=@_; } return wantarray() ? %r : $r{$r[0]}; } -# END lacemail-accept +# END perlmail-accept sub sendmail_show { return "\"$sendmail_orig\" ".join(",",map("\"$_\"",@ARGV)); } @@ -171,7 +171,7 @@ my $opt_q; my $opt_t; our $opt_f; #my $opt_F; # declared before &FromAddress already -my $opt_lacemail_dry_run; +my $opt_perlmail_dry_run; my @ARGV_save=@ARGV; # for non-bm mode die if !Getopt::Long::GetOptions( "b=s" ,\$opt_b, @@ -180,7 +180,7 @@ die if !Getopt::Long::GetOptions( "t" ,\$opt_t, "f=s" ,\$opt_f, "F=s" ,\$opt_F, - "lacemail-dry-run+",\$opt_lacemail_dry_run, + "perlmail-dry-run+",\$opt_perlmail_dry_run, ); if (0 # RedHat sendmail-8.12.5-7/sendmail/main.c/\QDo a quick prescan of the argument list.\E @@ -264,13 +264,6 @@ my @rcpts=(!@addr ? (undef()) : values(%{{ map({ (!defined $obj ? () : (lc($obj->address())=>$obj)); } @addr) }})); -# We may (=will) change the contents and send it multiple times -# prevent wasteful Message-ID regeneration if it is just for one rcpt -if (@rcpts>1 && defined(my $msgid=$head->get("Message-ID"))) { - $head->delete("Message-ID"); - $head->replace("X-LaceMail-sendmail-Message-ID",$msgid); - } - my $stdin_body=(@rcpts<=1 ? undef() : do { # store input data only if it will be used multiple times local $/=undef(); ; @@ -296,7 +289,7 @@ for my $rcpt (@rcpts) { local $SIG{"PIPE"}=sub { die "Got SIGPIPE from ".sendmail_show(); }; local *SENDMAIL; - if ($opt_lacemail_dry_run) { + if ($opt_perlmail_dry_run) { print sendmail_show()."\n"; *SENDMAIL=\*STDOUT; } @@ -316,7 +309,7 @@ for my $rcpt (@rcpts) { } } - next if $opt_lacemail_dry_run; # don't close our STDOUT as it is aliased to *SENDMAIL + next if $opt_perlmail_dry_run; # don't close our STDOUT as it is aliased to *SENDMAIL close SENDMAIL or warn "close(".sendmail_show()."): $?=".join(",", (!WIFEXITED($?) ? () : ("EXITSTATUS(".WEXITSTATUS($?).")")), (!WIFSIGNALED($?) ? () : ("TERMSIG(" .WTERMSIG($?) .")")),