X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fexipick.src;h=4999d843f2d3877bc870b61f2aae213e50c31c92;hb=e236f915d39e27c89ac6e9ef8dd6bdf38f164a6b;hp=ed3b6615436ed6df7bfccd0780abe9b24190a6e1;hpb=3f0945ffae8acee547d11ae53d38fbdf9a2cc81f;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/exipick.src b/src/src/exipick.src index ed3b66154..4999d843f 100644 --- a/src/src/exipick.src +++ b/src/src/exipick.src @@ -1,7 +1,9 @@ #!PERL_COMMAND -# This variable should be set by the building process to Exim's spool directory. -my $spool = 'SPOOL_DIRECTORY'; +# This variables should be set by the building process +my $spool = 'SPOOL_DIRECTORY'; # may be overridden later +my $exim = 'BIN_DIRECTORY/exim'; + # Need to set this dynamically during build, but it's not used right now anyway. my $charset = 'ISO-8859-1'; @@ -10,6 +12,7 @@ my $charset = 'ISO-8859-1'; # http://www.exim.org/eximwiki/ToolExipickManPage use strict; +BEGIN { pop @INC if $INC[-1] eq '.' }; use Getopt::Long; my($p_name) = $0 =~ m|/?([^/]+)$|; @@ -79,7 +82,7 @@ GetOptions( 'show-tests' => \$G::show_tests # display tests as applied to each message ) || exit(1); -# if both freeze and thaw specified, only thaw as it is less desctructive +# if both freeze and thaw specified, only thaw as it is less destructive $G::freeze = undef if ($G::freeze && $G::thaw); freeze_start() if ($G::freeze); thaw_start() if ($G::thaw); @@ -111,7 +114,9 @@ $G::and = $G::and; # shut up -w $G::msg_ids = {}; # short circuit when crit is only MID $G::caseless = $G::caseful ? 0 : 1; # nocase by default, case if both @G::recipients_crit = (); # holds per-recip criteria -$spool = $G::spool if ($G::spool); +$spool = defined $G::spool ? $G::spool + : do { chomp($_ = `$exim -n -bP spool_directory`); + $_ // $spool }; my $input_dir = $G::input_dir || ($G::finput ? "Finput" : "input"); my $count_only = 1 if ($G::mailq_bpc || $G::qgrep_c); my $unsorted = 1 if ($G::mailq_bpr || $G::mailq_bpra || @@ -757,7 +762,7 @@ sub _decode_2047 { $i += 2; } } - elsif ($ow[$i] =~ /\s/) { # whitspace is illegal + elsif ($ow[$i] =~ /\s/) { # whitespace is illegal $e = 1; last; } @@ -1020,6 +1025,12 @@ sub _parse_header { return($self->_error("incorrect format: $_")) if (length($2) != $3); $self->{_recips}{$1} = { pno => $4, errors_to => $2 }; $addr = $1; + } elsif (/^(\S*)\s(\S*)\s(\d+),(\d+)\s(\S*)\s(\d+),(-?\d+)#3$/) { + #print STDERR "exim4 new type #3 DSN (untested): $_\n"; + return($self->_error("incorrect format: $_")) + if ((length($2) != $3) || (length($5) != $6)); + $self->{_recips}{$1} = { pno => $7, errors_to => $5 }; + $addr = $1; } elsif (/^.*#(\d+)$/) { #print STDERR "exim4 #$1 style (unimplemented): $_\n"; $self->_error("exim4 #$1 style (unimplemented): $_"); @@ -1381,7 +1392,7 @@ Display only the message IDs (exiqgrep) =item --input-dir -Set the name of the directory under the spool directory. By defaut this is "input". If this starts with '/', the value of --spool is ignored. See also --finput. +Set the name of the directory under the spool directory. By default this is "input". If this starts with '/', the value of --spool is ignored. See also --finput. =item -l @@ -1421,7 +1432,8 @@ Same as '$shown_message_size eq ' (exiqgrep) =item --spool -Set the path to the exim spool to use. This value will have the argument to --input or 'input' appended, or be ignored if --input is a full path. +Set the path to the exim spool to use. This value will have the argument to --input or 'input' appended, or be ignored if --input is a full path. If not specified, exipick uses the value from C, and if this fails, the F +from build time (F) is used. =item --show-rules