X-Git-Url: https://git.jankratochvil.net/?p=PerlMail.git;a=blobdiff_plain;f=perlmail-accept;h=55bef4a30e6dd252c943dcd0bbef5ccb38ab0d1c;hp=9a8584bf82d2e5ed741897d806f7a0e2fdea5034;hb=0c848de6fd9c35f1ec9640b3adbab036ce0a5a91;hpb=851ec8b7b3dc1252952d9cd95ab6fba89ce50ba4 diff --git a/perlmail-accept b/perlmail-accept index 9a8584b..55bef4a 100755 --- a/perlmail-accept +++ b/perlmail-accept @@ -89,6 +89,7 @@ my $opt_mode; my $opt_smstest; # 1 or $smscount my $opt_idle; my $opt_dry; +my $opt_single; sub process; @@ -101,7 +102,7 @@ sub stdin local $_; while (<>) { die "Invalid 'From ' line: $_" if $message eq "" && !/^From /; - if (/^From / && $message) { + if (!$opt_single && /^From / && $message) { process $message; $message=""; } @@ -491,7 +492,7 @@ sub spamassassin { my($cmd)=@_; - $cmd||="spamassassin --exit-code"; + $cmd||="$HOME/bin/spamassassin --exit-code"; # spamassassin has exit code 1 if IS spam, code 0 if NOT spam local *CHILD; local $SIG{"PIPE"}=sub { warn "spamassassin gave me SIGPIPE: broken pipe"; }; @@ -662,6 +663,7 @@ $Getopt::Long::ignorecase=0; die "GetOptions error" if !Getopt::Long::GetOptions( "inetd" ,sub { $opt_mode=\&inetd; }, "stdin" ,sub { $opt_mode=\&stdin; }, + "single!" ,\$opt_single, "dry" ,\$opt_dry, "smstest:s",sub { $opt_mode=\&stdin; $opt_smstest=($_[1] || 1); }, "idle!" ,\$opt_idle,