mailagent-svn Mailing List for mailagent - Perl mail filter / processor (Page 3)
Brought to you by:
rmanfredi
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(21) |
Jun
(30) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rma...@us...> - 2008-06-06 11:18:46
|
Revision: 32 http://mailagent.svn.sourceforge.net/mailagent/?rev=32&view=rev Author: rmanfredi Date: 2008-06-06 04:18:20 -0700 (Fri, 06 Jun 2008) Log Message: ----------- To allow revision updating in scripts without having to run Configure, make sure each .SH extracts the revision from the "revision.h" file. Modified Paths: -------------- trunk/mailagent/agent/edusers.SH trunk/mailagent/agent/magent.sh trunk/mailagent/agent/maildist.SH trunk/mailagent/agent/mailhelp.SH trunk/mailagent/agent/maillist.SH trunk/mailagent/agent/mailpatch.SH trunk/mailagent/agent/package.SH trunk/mailagent/revision.h Modified: trunk/mailagent/agent/edusers.SH =================================================================== --- trunk/mailagent/agent/edusers.SH 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/agent/edusers.SH 2008-06-06 11:18:20 UTC (rev 32) @@ -11,6 +11,7 @@ . $TOP/config.sh ;; esac +revision=`awk '/^#define[ ]*REVISION/ {print $3}' < $TOP/revision.h` case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac @@ -43,7 +44,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; -\$revision = '$REVISION'; +\$revision = '$revision'; \$defeditor = '$defeditor'; \$phostname = '$phostname'; \$long_filenames = '$d_flexfnam' eq 'define'; Modified: trunk/mailagent/agent/magent.sh =================================================================== --- trunk/mailagent/agent/magent.sh 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/agent/magent.sh 2008-06-06 11:18:20 UTC (rev 32) @@ -14,6 +14,7 @@ case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac +revision=`awk '/^#define[ ]*REVISION/ {print $3}' < $TOP/revision.h` echo "Extracting agent/magent (with variable substitutions)" $spitshell >magent <<!GROK!THIS! $startperl @@ -129,7 +130,7 @@ # Current version number and patchlevel \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; -\$revision = '$REVISION'; +\$revision = '$revision'; # Want to lock mailboxes with flock ? \$lock_by_flock = '$lock_by_flock'; Modified: trunk/mailagent/agent/maildist.SH =================================================================== --- trunk/mailagent/agent/maildist.SH 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/agent/maildist.SH 2008-06-06 11:18:20 UTC (rev 32) @@ -11,6 +11,7 @@ . $TOP/config.sh ;; esac +revision=`awk '/^#define[ ]*REVISION/ {print $3}' < $TOP/revision.h` case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac @@ -54,7 +55,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; -\$revision = '$REVISION'; +\$revision = '$revision'; !GROK!THIS! $spitshell >>maildist <<'!NO!SUBS!' Modified: trunk/mailagent/agent/mailhelp.SH =================================================================== --- trunk/mailagent/agent/mailhelp.SH 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/agent/mailhelp.SH 2008-06-06 11:18:20 UTC (rev 32) @@ -11,6 +11,7 @@ . $TOP/config.sh ;; esac +revision=`awk '/^#define[ ]*REVISION/ {print $3}' < $TOP/revision.h` case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac @@ -46,7 +47,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; -\$revision = '$REVISION'; +\$revision = '$revision'; !GROK!THIS! $spitshell >>mailhelp <<'!NO!SUBS!' Modified: trunk/mailagent/agent/maillist.SH =================================================================== --- trunk/mailagent/agent/maillist.SH 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/agent/maillist.SH 2008-06-06 11:18:20 UTC (rev 32) @@ -11,6 +11,7 @@ . $TOP/config.sh ;; esac +revision=`awk '/^#define[ ]*REVISION/ {print $3}' < $TOP/revision.h` case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac @@ -56,7 +57,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; -\$revision = '$REVISION'; +\$revision = '$revision'; \$phostname = '$phostname'; !GROK!THIS! Modified: trunk/mailagent/agent/mailpatch.SH =================================================================== --- trunk/mailagent/agent/mailpatch.SH 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/agent/mailpatch.SH 2008-06-06 11:18:20 UTC (rev 32) @@ -11,6 +11,7 @@ . $TOP/config.sh ;; esac +revision=`awk '/^#define[ ]*REVISION/ {print $3}' < $TOP/revision.h` case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac @@ -58,7 +59,7 @@ \$zcat = '$zcat'; \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; -\$revision = '$REVISION'; +\$revision = '$revision'; !GROK!THIS! $spitshell >>mailpatch <<'!NO!SUBS!' Modified: trunk/mailagent/agent/package.SH =================================================================== --- trunk/mailagent/agent/package.SH 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/agent/package.SH 2008-06-06 11:18:20 UTC (rev 32) @@ -11,6 +11,7 @@ . $TOP/config.sh ;; esac +revision=`awk '/^#define[ ]*REVISION/ {print $3}' < $TOP/revision.h` case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac @@ -76,7 +77,7 @@ \$zcat = '$zcat'; \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; -\$revision = '$REVISION'; +\$revision = '$revision'; \$phostname = '$phostname'; \$long_filenames = '$d_flexfnam' eq 'define'; !GROK!THIS! Modified: trunk/mailagent/revision.h =================================================================== --- trunk/mailagent/revision.h 2008-06-06 11:15:25 UTC (rev 31) +++ trunk/mailagent/revision.h 2008-06-06 11:18:20 UTC (rev 32) @@ -4,4 +4,4 @@ * Generated by ./bin/svn-revision. */ -#define REVISION 28 +#define REVISION 29 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-06-06 11:15:40
|
Revision: 31 http://mailagent.svn.sourceforge.net/mailagent/?rev=31&view=rev Author: rmanfredi Date: 2008-06-06 04:15:25 -0700 (Fri, 06 Jun 2008) Log Message: ----------- Do not emit "entering new state..." if state is not changing. POST: do not pass a header not matching /^[\w-]+:/, as not essential! Modified Paths: -------------- trunk/mailagent/agent/pl/actions.pl trunk/mailagent/agent/pl/filter.pl Modified: trunk/mailagent/agent/pl/actions.pl =================================================================== --- trunk/mailagent/agent/pl/actions.pl 2008-06-04 15:19:13 UTC (rev 30) +++ trunk/mailagent/agent/pl/actions.pl 2008-06-06 11:15:25 UTC (rev 31) @@ -869,6 +869,18 @@ $last_was_header = 1; # Mark we discarded the line next; # Line is skipped } + # Skip any RFC-822 header that is not purely made up of [\w-]+ + # as it is not possible it can be meaningful to the news system. + if (/^([!-9;-~\w-]+):/) { + my $header = $1; + unless ($header =~ /^[\w-]+$/) { + &add_log("NOTICE droping RFC-822 header \"$header\" for news") + if $loglvl > 5; + $last_was_header = 1; # Mark we discarded the line + next; # Line is skipped + } + # All headers will now match /^[\w-]+:/ + } if (/^([\w-]+):/ && exists $single{"\L$1"}) { my $field = lc($1); if ($single{$field}++) { @@ -883,7 +895,11 @@ $last_was_header = 0; # We decided to keep header line # Ensure that we always put a single space after the field name # (before possibly emitting a newline for the continuation) - s/^([\w-]+):(\S)/$1: $2/ || s/^([\w-]+):$/$1: /; + if (s/^([\w-]+):(\S)/$1: $2/ || s/^([\w-]+):$/$1: /) { + my $header = $1; + &add_log("NOTICE added space after \"$header:\", for news") + if $loglvl > 5; + } print NEWS $_, "\n"; } @@ -1810,8 +1826,8 @@ return 0 if $opt'sw_t && $lastcmd != 0; return 0 if $opt'sw_f && $lastcmd == 0; if ($mode ne '') { + &add_log("entering new state $wmode") if $loglvl > 6 && $mode ne $wmode; $wmode = $mode; - &add_log("entering new state $wmode") if $loglvl > 6; } &perform; # This was dynamically bound } Modified: trunk/mailagent/agent/pl/filter.pl =================================================================== --- trunk/mailagent/agent/pl/filter.pl 2008-06-04 15:19:13 UTC (rev 30) +++ trunk/mailagent/agent/pl/filter.pl 2008-06-06 11:15:25 UTC (rev 31) @@ -866,8 +866,8 @@ sub alter_execution { local($option, $mode) = @_; # Option, mode we have to change to if ($mode ne '') { + &add_log("entering new state $wmode") if $loglvl > 6 && $wmode ne $mode; $wmode = $mode; - &add_log("entering new state $wmode") if $loglvl > 6; } if ($option eq 'x') { # Backward compatibility at 3.0 PL24 $option = '-c' if $opt'sw_c; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-06-04 15:20:45
|
Revision: 30 http://mailagent.svn.sourceforge.net/mailagent/?rev=30&view=rev Author: rmanfredi Date: 2008-06-04 08:19:13 -0700 (Wed, 04 Jun 2008) Log Message: ----------- It is an error if we cannot open directories or files for dbr. Modified Paths: -------------- trunk/mailagent/agent/pl/dbr.pl Modified: trunk/mailagent/agent/pl/dbr.pl =================================================================== --- trunk/mailagent/agent/pl/dbr.pl 2008-06-04 12:22:16 UTC (rev 29) +++ trunk/mailagent/agent/pl/dbr.pl 2008-06-04 15:19:13 UTC (rev 30) @@ -210,7 +210,7 @@ local($dir) = @_; # Directory to scan local(@contents); # Contents of the directory unless (opendir(DIR, $dir)) { - &'add_log("WARNING cannot open directory $dir: $!") if $'loglvl > 5; + &'add_log("ERROR cannot open directory $dir: $!") if $'loglvl > 1; return; } @contents = readdir(DIR); # Slurp the whole thing @@ -225,7 +225,7 @@ &clean_file("$dir/$_"); } unless (opendir(DIR, $dir)) { - &'add_log("WARNING cannot re-open directory $dir: $!") if $'loglvl > 5; + &'add_log("ERROR cannot re-open directory $dir: $!") if $'loglvl > 1; return; } @contents = readdir(DIR); # Slurp the whole thing @@ -243,7 +243,7 @@ local($file) = @_; # File to be cleaned &'add_log("processing $file") if $'loglvl > 18; unless (open(FILE, $file)) { - &'add_log("WARNING cannot open file $file: $!") if $'loglvl > 5; + &'add_log("ERROR cannot open file $file: $!") if $'loglvl > 1; return; } unless (open(NEW, ">$file.x")) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-06-04 12:22:26
|
Revision: 29 http://mailagent.svn.sourceforge.net/mailagent/?rev=29&view=rev Author: rmanfredi Date: 2008-06-04 05:22:16 -0700 (Wed, 04 Jun 2008) Log Message: ----------- Forgot to change on X-Filter line to use the new version numbering scheme. Modified Paths: -------------- trunk/mailagent/agent/magent.sh trunk/mailagent/revision.h Modified: trunk/mailagent/agent/magent.sh =================================================================== --- trunk/mailagent/agent/magent.sh 2008-06-03 12:01:08 UTC (rev 28) +++ trunk/mailagent/agent/magent.sh 2008-06-04 12:22:16 UTC (rev 29) @@ -529,7 +529,7 @@ sub patch_constants { local($address) = &email_addr; # Will prefer cf vars to hardwired ones $FILTER = - "X-Filter: mailagent [version $mversion PL$patchlevel] for $address"; + "X-Filter: mailagent [version $mversion-$revision] for $address"; } # Initializes environment. All the variables are initialized in XENV array Modified: trunk/mailagent/revision.h =================================================================== --- trunk/mailagent/revision.h 2008-06-03 12:01:08 UTC (rev 28) +++ trunk/mailagent/revision.h 2008-06-04 12:22:16 UTC (rev 29) @@ -4,4 +4,4 @@ * Generated by ./bin/svn-revision. */ -#define REVISION 26 +#define REVISION 28 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-06-03 12:01:10
|
Revision: 28 http://mailagent.svn.sourceforge.net/mailagent/?rev=28&view=rev Author: rmanfredi Date: 2008-06-03 05:01:08 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Avoid multiple warnings about a missing continuation for a same header during RESYNC. Also show the faulty line that should have been flagged as a continuation. Fixed RESYNC header parsing to use RFC-822 header identification instead of the simpler legacy one. Modified Paths: -------------- trunk/mailagent/agent/pl/actions.pl Modified: trunk/mailagent/agent/pl/actions.pl =================================================================== --- trunk/mailagent/agent/pl/actions.pl 2008-06-03 11:38:43 UTC (rev 27) +++ trunk/mailagent/agent/pl/actions.pl 2008-06-03 12:01:08 UTC (rev 28) @@ -1387,6 +1387,7 @@ local($last_header); # Current normalized header field local($in_header) = 1; # Bug in the range operator local($value); # Value of current field + my $missing_warned = 0; foreach (split(/\n/, $Header{'All'})) { if ($in_header) { # Still in header of message if (/^$/) { # End of header @@ -1396,9 +1397,10 @@ if (/^\s/) { # It is a continuation line s/^\s+/ /; # Swallow multiple spaces $Header{$last_header} .= $_ if $last_header ne ''; - } elsif (/^([\w-]+):\s*(.*)/) { # We found a new header + } elsif (/^([!-9;-~\w-]+):\s*(.*)/) { # We found a new header $value = $2; # Bug in perl 4.0 PL19 $last_header = &header'normalize($1); + $missing_warned = 0; # Multiple headers like 'Received' are separated by a new- # line character. All headers end on a non new-line. if ($Header{$last_header} ne '') { @@ -1412,12 +1414,13 @@ # Did not identify a header field nor a continuation # Maybe there was a wrong header split somewhere? if ($last_header eq '') { - &add_log("ERROR ignoring header garbage: $_") + &add_log("ERROR ignoring leading header garbage: $_") if $loglvl > 1; } else { - &add_log("ERROR missing continuation for $last_header") - if $loglvl > 1; + &add_log("ERROR missing continuation for $last_header: $_") + if !$missing_warned && $loglvl > 1; $Header{$last_header} .= " " . $_; + $missing_warned++; } } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-06-03 11:38:47
|
Revision: 27 http://mailagent.svn.sourceforge.net/mailagent/?rev=27&view=rev Author: rmanfredi Date: 2008-06-03 04:38:43 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Now parses the following Received line: Received: from ?host1? ([xx.yy.zz.tt]) by host3 Modified Paths: -------------- trunk/mailagent/agent/pl/parse.pl trunk/mailagent/revision.h Modified: trunk/mailagent/agent/pl/parse.pl =================================================================== --- trunk/mailagent/agent/pl/parse.pl 2008-06-02 15:27:03 UTC (rev 26) +++ trunk/mailagent/agent/pl/parse.pl 2008-06-03 11:38:43 UTC (rev 27) @@ -297,6 +297,7 @@ # # Received: from host1 (host2 [xx.yy.zz.tt]) by host3 # Received: from host1 ([xx.yy.zz.tt]) by host3 +# Received: from ?host1? ([xx.yy.zz.tt]) by host3 # Received: from host1 by host3 # Received: from (host2 [xx.yy.zz.tt]) by host3 # Received: from (host1) [xx.yy.zz.tt] by host3 @@ -393,6 +394,10 @@ if (s/^(\[\d+\.\d+\.\d+\.\d+\])\s*//) { $host = $1; # IP address [xx.yy.zz.tt] } + # ?xx.yy.zz.tt? ( [XX.YY.ZZ.TT]) + elsif (s/^\?[\d\.]+\?\s*\(\s*(\[\d+\.\d+\.\d+\.\d+\])\s*\)\s*//) { + $host = $1; + } # foo.domain.com (optional) elsif (s/^([\w-.]+)(\(\S+\))?\s*//) { $host = $1; # host name Modified: trunk/mailagent/revision.h =================================================================== --- trunk/mailagent/revision.h 2008-06-02 15:27:03 UTC (rev 26) +++ trunk/mailagent/revision.h 2008-06-03 11:38:43 UTC (rev 27) @@ -4,4 +4,4 @@ * Generated by ./bin/svn-revision. */ -#define REVISION 25 +#define REVISION 26 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-06-02 15:27:41
|
Revision: 26 http://mailagent.svn.sourceforge.net/mailagent/?rev=26&view=rev Author: rmanfredi Date: 2008-06-02 08:27:03 -0700 (Mon, 02 Jun 2008) Log Message: ----------- Was wrongly handling patterns in rules given under the form m|something| where "something" was containing a "/" character... This led to an error message stating the pattern was incorrect... Also fixed pattern compilation error reports to remove the "(eval 124)" part that modern perl 5.x report in $@ (mailagent was still stripping the older perl 4.x form of eval addition). Modified Paths: -------------- trunk/mailagent/agent/magent.sh trunk/mailagent/agent/pl/matching.pl trunk/mailagent/agent/test/TEST trunk/mailagent/agent/test/rules trunk/mailagent/revision.h Modified: trunk/mailagent/agent/magent.sh =================================================================== --- trunk/mailagent/agent/magent.sh 2008-05-30 09:45:13 UTC (rev 25) +++ trunk/mailagent/agent/magent.sh 2008-06-02 15:27:03 UTC (rev 26) @@ -752,7 +752,8 @@ # Report any eval error and returns 1 if error detected. sub eval_error { if ($@ ne '') { - $@ =~ s/ in file \(eval\) at line \d+//; + $@ =~ s/ in file \(eval\) at line \d+//; # Older perls + $@ =~ s/ at \(eval \d+\) line \d+\.//; # Modern perl 5.x chop($@); &add_log("ERROR $@") if $loglvl > 1; } Modified: trunk/mailagent/agent/pl/matching.pl =================================================================== --- trunk/mailagent/agent/pl/matching.pl 2008-05-30 09:45:13 UTC (rev 25) +++ trunk/mailagent/agent/pl/matching.pl 2008-06-02 15:27:03 UTC (rev 26) @@ -80,15 +80,11 @@ } # Take a pattern as written in the rule file and make it suitable for -# pattern matching as understood by perl. If the pattern starts with a -# leading /, nothing is done. Otherwise, a set of / are added. -# match (1st case). +# pattern matching as understood by perl. Unless the pattern starts with a +# leading / or is of the form m||, it is enclosed within slashes. +# We also enclose the whole pattern within (). sub make_pattern { local($_) = shift(@_); - unless (m|^/|) { # Pattern does not start with a / - $_ = &perl_pattern($_); # Simple words specified via shell patterns - $_ = "/^$_\$/"; # Anchor pattern - } # The whole pattern is inserted within () to make at least one # backreference. Otherwise, the following could happen: # $_ = '1 for you'; @@ -98,7 +94,15 @@ # determine whether it is due to a backreference (2nd case) or a sucessful # match. Knowing we have at least one bracketed reference is enough to # disambiguate. - s|^/(.*)/|/($1)/|; # Enclose whole pattern within () + if (/^m(\W)(.*)\1(\w*)$/) { + $_ = "m$1($2)$1$3"; + } elsif (m|^/(.*)/(\w*)$|) { + $_ = "/($1)/$2"; + } else { + # Pattern does not start with a / or is not of the form m|xxx| + $_ = &perl_pattern($_); # Simple words specified via shell patterns + $_ = "/^($_)\$/"; # Anchor pattern + } $_; # Pattern suitable for eval'ed matching } Modified: trunk/mailagent/agent/test/TEST =================================================================== --- trunk/mailagent/agent/test/TEST 2008-05-30 09:45:13 UTC (rev 25) +++ trunk/mailagent/agent/test/TEST 2008-06-02 15:27:03 UTC (rev 26) @@ -105,8 +105,9 @@ if (@ARGV) { foreach my $file (@ARGV) { run_file($file); - exit($failed ? 1 : 0) ; + exit(1) if $failed && $opt_s; } + exit($failed ? 1 : 0) ; } open(OK, ">>OK"); Modified: trunk/mailagent/agent/test/rules =================================================================== --- trunk/mailagent/agent/test/rules 2008-05-30 09:45:13 UTC (rev 25) +++ trunk/mailagent/agent/test/rules 2008-06-02 15:27:03 UTC (rev 26) @@ -180,10 +180,10 @@ <RANGE> To Cc <1, 2>: must { SAVE always.3; REJECT }; <RANGE> To Cc <3, 1>: ram { SAVE never.2; REJECT }; <RANGE> Body <-, 3>: /SIGPLAN/ { SAVE never.3; REJECT }; -<RANGE> Body <-, ->: /SIGPLAN/ { SAVE always.4; REJECT }; -<RANGE> Body <9, 9>: /SIGPLAN/ { SAVE always.5; REJECT }; +<RANGE> Body <-, ->: /SIGpLAN/i { SAVE always.4; REJECT }; +<RANGE> Body <9, 9>: m|SI\w+N| { SAVE always.5; REJECT }; <RANGE> Body <9, 9>: /CD-ROM/ { SAVE never.4; REJECT }; -<RANGE> Body <13, 14>: /something/ { SAVE always.6; REJECT }; +<RANGE> Body <13, 14>: m,something, { SAVE always.6; REJECT }; <RANGE> Body <-3, ->: /Regards/ { SAVE always.7; REJECT }; <RANGE> Cc <-1, ->: made { SAVE always.8; REJECT }; <RANGE> Body <-3, ->: /request/ { SAVE never.5; REJECT }; Modified: trunk/mailagent/revision.h =================================================================== --- trunk/mailagent/revision.h 2008-05-30 09:45:13 UTC (rev 25) +++ trunk/mailagent/revision.h 2008-06-02 15:27:03 UTC (rev 26) @@ -4,4 +4,4 @@ * Generated by ./bin/svn-revision. */ -#define REVISION 24 +#define REVISION 25 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 09:45:17
|
Revision: 25 http://mailagent.svn.sourceforge.net/mailagent/?rev=25&view=rev Author: rmanfredi Date: 2008-05-30 02:45:13 -0700 (Fri, 30 May 2008) Log Message: ----------- This is now mailagent 3.1. Modified Paths: -------------- trunk/mailagent/README trunk/mailagent/revision.h Modified: trunk/mailagent/README =================================================================== --- trunk/mailagent/README 2008-05-30 09:43:23 UTC (rev 24) +++ trunk/mailagent/README 2008-05-30 09:45:13 UTC (rev 25) @@ -1,6 +1,6 @@ - mailagent 3.0 + mailagent 3.1 - Copyright (c) 1990-2001, Raphael Manfredi + Copyright (c) 1990-2008, Raphael Manfredi ------------------------------------------------------------------------ This program is free software; you can redistribute it and/or modify Modified: trunk/mailagent/revision.h =================================================================== --- trunk/mailagent/revision.h 2008-05-30 09:43:23 UTC (rev 24) +++ trunk/mailagent/revision.h 2008-05-30 09:45:13 UTC (rev 25) @@ -4,4 +4,4 @@ * Generated by ./bin/svn-revision. */ -#define REVISION 21 +#define REVISION 24 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 09:43:25
|
Revision: 24 http://mailagent.svn.sourceforge.net/mailagent/?rev=24&view=rev Author: rmanfredi Date: 2008-05-30 02:43:23 -0700 (Fri, 30 May 2008) Log Message: ----------- Use strict RFC-822 definition for header names: the field name can be made of anything but SPACE or colon, from ASCII 33 to ASCII 126. Modified Paths: -------------- trunk/mailagent/agent/pl/parse.pl Modified: trunk/mailagent/agent/pl/parse.pl =================================================================== --- trunk/mailagent/agent/pl/parse.pl 2008-05-30 09:30:12 UTC (rev 23) +++ trunk/mailagent/agent/pl/parse.pl 2008-05-30 09:43:23 UTC (rev 24) @@ -142,7 +142,7 @@ $Header{$last_header} .= $val if $last_header ne ''; &add_log("WARNING bad continuation in header, line $.") if $last_header eq '' && $loglvl > 4; - } elsif (($field, $value) = /^([\w-]+)\s*:\s*(.*)/) { + } elsif (($field, $value) = /^([!-9;-~\w-]+):\s*(.*)/) { # We found a new header field (i.e. it is not a continuation). # Guarantee only one From: header line. If multiple From: are # found, keep the last one. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 09:30:20
|
Revision: 23 http://mailagent.svn.sourceforge.net/mailagent/?rev=23&view=rev Author: rmanfredi Date: 2008-05-30 02:30:12 -0700 (Fri, 30 May 2008) Log Message: ----------- This is now version 3.1. The patchlevel is now ignored, as we track by SVN revision number. Changed all version information reporting to new format "version-revision". Modified Paths: -------------- trunk/mailagent/agent/edusers.SH trunk/mailagent/agent/filter/main.c trunk/mailagent/agent/magent.sh trunk/mailagent/agent/maildist.SH trunk/mailagent/agent/mailhelp.SH trunk/mailagent/agent/maillist.SH trunk/mailagent/agent/mailpatch.SH trunk/mailagent/agent/package.SH trunk/mailagent/agent/pl/sendfile.pl trunk/mailagent/agent/test/option/V.t trunk/mailagent/patchlevel.h Modified: trunk/mailagent/agent/edusers.SH =================================================================== --- trunk/mailagent/agent/edusers.SH 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/edusers.SH 2008-05-30 09:30:12 UTC (rev 23) @@ -43,6 +43,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; +\$revision = '$REVISION'; \$defeditor = '$defeditor'; \$phostname = '$phostname'; \$long_filenames = '$d_flexfnam' eq 'define'; Modified: trunk/mailagent/agent/filter/main.c =================================================================== --- trunk/mailagent/agent/filter/main.c 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/filter/main.c 2008-05-30 09:30:12 UTC (rev 23) @@ -77,6 +77,7 @@ #include "lock.h" #include "confmagic.h" #include "patchlevel.h" +#include "revision.h" #define MAX_STRING 2048 /* Maximum string length */ @@ -144,7 +145,7 @@ env_home(); /* Get HOME from environment */ break; case 'V': /* version number */ - printf("filter %.1f PL%d\n", VERSION, PATCHLEVEL); + printf("filter %.1f-%d\n", VERSION, REVISION); exit(EX_OK); /* NOTRECHED */ default: Modified: trunk/mailagent/agent/magent.sh =================================================================== --- trunk/mailagent/agent/magent.sh 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/magent.sh 2008-05-30 09:30:12 UTC (rev 23) @@ -129,6 +129,7 @@ # Current version number and patchlevel \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; +\$revision = '$REVISION'; # Want to lock mailboxes with flock ? \$lock_by_flock = '$lock_by_flock'; @@ -238,7 +239,7 @@ $log_level = int(shift); } elsif ($_ eq '-V') { # Version number - print STDERR "$prog_name $mversion PL$patchlevel\n"; + print STDERR "$prog_name $mversion-$revision\n"; exit 0; } elsif ($_ eq '-U') { # Do not allow UNIQUE to reject / abort @@ -506,9 +507,9 @@ # The filter message local($address) = &email_addr; $FILTER = - "X-Filter: mailagent [version $mversion PL$patchlevel] for $address"; + "X-Filter: mailagent [version $mversion-$revision] for $address"; $MAILER = - "X-Mailer: mailagent [version $mversion PL$patchlevel]"; + "X-Mailer: mailagent [version $mversion-$revision]"; # For header fields alteration $HD_STRIP = 0; # Strip header fields Modified: trunk/mailagent/agent/maildist.SH =================================================================== --- trunk/mailagent/agent/maildist.SH 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/maildist.SH 2008-05-30 09:30:12 UTC (rev 23) @@ -54,6 +54,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; +\$revision = '$REVISION'; !GROK!THIS! $spitshell >>maildist <<'!NO!SUBS!' @@ -102,7 +103,7 @@ print MAILER "To: $path Subject: No program called $system -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I don't know how to send a program called \"$system\". Sorry. @@ -127,7 +128,7 @@ print MAILER "To: $path Subject: No version $version for $system -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I don't know how to send version $version of $system. Sorry. @@ -157,7 +158,7 @@ print MAILER "To: $path Subject: System $system $version is obsolete -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I can't send you version $version of $system. Sorry. @@ -187,7 +188,7 @@ print MAILER "To: $path Subject: Version $version of $system is an old one -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] You asked for version $version of $system. Modified: trunk/mailagent/agent/mailhelp.SH =================================================================== --- trunk/mailagent/agent/mailhelp.SH 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/mailhelp.SH 2008-05-30 09:30:12 UTC (rev 23) @@ -46,6 +46,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; +\$revision = '$REVISION'; !GROK!THIS! $spitshell >>mailhelp <<'!NO!SUBS!' @@ -77,7 +78,7 @@ print MAILER "To: $dest Subject: How to use my mail agent -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] "; while (<HELP>) { Modified: trunk/mailagent/agent/maillist.SH =================================================================== --- trunk/mailagent/agent/maillist.SH 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/maillist.SH 2008-05-30 09:30:12 UTC (rev 23) @@ -56,6 +56,7 @@ \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; +\$revision = '$REVISION'; \$phostname = '$phostname'; !GROK!THIS! @@ -98,7 +99,7 @@ print XHEAD "To: $dest Subject: List of available distributions -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] Here are the different packages available. If you want the whole distribution, send me the following: Modified: trunk/mailagent/agent/mailpatch.SH =================================================================== --- trunk/mailagent/agent/mailpatch.SH 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/mailpatch.SH 2008-05-30 09:30:12 UTC (rev 23) @@ -58,6 +58,7 @@ \$zcat = '$zcat'; \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; +\$revision = '$REVISION'; !GROK!THIS! $spitshell >>mailpatch <<'!NO!SUBS!' @@ -105,7 +106,7 @@ print MAILER "To: $path Subject: No program called $system -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I don't know how to send patches for a program called $system. Sorry. @@ -130,7 +131,7 @@ print MAILER "To: $path Subject: No patches for $system version $version -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I don't know how to send patches for version $version of $system. Sorry."; if ($Version{$system} ne '') { @@ -168,7 +169,7 @@ print MAILER "To: $path Subject: $system version $version is not maintained -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I can't send you patches for version $version of $system, because this code is not maintained by $cf'name. There are no official patches available either... @@ -246,7 +247,7 @@ print MAILER "To: $path Subject: No patches yet for $system version $version -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] There are no patches (yet) for $system version $version. Sorry. @@ -271,7 +272,7 @@ print MAILER "To: $path Subject: Invalid patch request for $system $version -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] "; if ($Patches{$pname}) { print MAILER " Modified: trunk/mailagent/agent/package.SH =================================================================== --- trunk/mailagent/agent/package.SH 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/package.SH 2008-05-30 09:30:12 UTC (rev 23) @@ -76,6 +76,7 @@ \$zcat = '$zcat'; \$mversion = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; +\$revision = '$REVISION'; \$phostname = '$phostname'; \$long_filenames = '$d_flexfnam' eq 'define'; !GROK!THIS! @@ -133,7 +134,7 @@ print MAILER "To: $path Subject: No program called $system -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I have not heard of a program called $system. Sorry. @@ -154,7 +155,7 @@ print MAILER "To: $path Subject: No package $system version $version -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I don't know anything about version $version of $system. Sorry."; if ($Version{$system} ne '') { @@ -189,7 +190,7 @@ print MAILER "To: $path Subject: Version $version of $system is out-of-date -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] This short note to warn you that $system version $version is not the lattest one available. If you have some interest in $system, I suggest @@ -216,7 +217,7 @@ print MAILER "To: $path Subject: $system version $version is not maintained -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I can't keep you up to date on changes to version $version of $system, because this code is not maintained by $cf'name. @@ -246,7 +247,7 @@ print MAILER "To: $path Subject: I didn't understand your package command -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] Your package command requested `$request', and I don't know what that means. @@ -302,7 +303,7 @@ print MAILER "To: $dest Subject: The latest patchlevel for $system version $version is $maxnum -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] Just a quick note to let you know that the latest patchlevel for $system version $version is $maxnum; if you are still at patchlevel $theirpl, I strongly @@ -429,7 +430,7 @@ print MAILER "To: $path Subject: You were not recorded as a $system $version user -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] I can't honour your desire to be left alone for $system version $version updates because you were not found among the registered users. Modified: trunk/mailagent/agent/pl/sendfile.pl =================================================================== --- trunk/mailagent/agent/pl/sendfile.pl 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/pl/sendfile.pl 2008-05-30 09:30:12 UTC (rev 23) @@ -149,7 +149,7 @@ "To: $dest Subject: $subject$signal Precedence: bulk -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] Here is the answer to your request: @@ -303,7 +303,7 @@ print MAILER "To: $path Subject: $cmd failed -X-Mailer: mailagent [version $mversion PL$patchlevel] +X-Mailer: mailagent [version $mversion-$revision] Sorry, the $prog_name command failed while sending files. Modified: trunk/mailagent/agent/test/option/V.t =================================================================== --- trunk/mailagent/agent/test/option/V.t 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/agent/test/option/V.t 2008-05-30 09:30:12 UTC (rev 23) @@ -18,5 +18,5 @@ do '../pl/init.pl'; $version = `$mailagent -V 2>&1`; $? == 0 || print "1\n"; -$version =~ /PL/ || print "2\n"; +$version =~ /^mailagent \d+\.\d+-\d+/ || print "2\n"; print "0\n"; Modified: trunk/mailagent/patchlevel.h =================================================================== --- trunk/mailagent/patchlevel.h 2008-05-30 09:12:22 UTC (rev 22) +++ trunk/mailagent/patchlevel.h 2008-05-30 09:30:12 UTC (rev 23) @@ -1,4 +1,5 @@ /* mailagent-3.0 - 1 Dec 1993 */ +/* mailagent-3.1 - 2008-05-30 */ -#define VERSION 3.0 -#define PATCHLEVEL 73 +#define VERSION 3.1 +#define PATCHLEVEL 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 09:12:25
|
Revision: 22 http://mailagent.svn.sourceforge.net/mailagent/?rev=22&view=rev Author: rmanfredi Date: 2008-05-30 02:12:22 -0700 (Fri, 30 May 2008) Log Message: ----------- Added automatic computation of the SVN revision in "revision.h", for later perusal by Configure to propagate correct revision numbers in files. Modified Paths: -------------- trunk/mailagent/Configure trunk/mailagent/MANIFEST trunk/mailagent/Makefile.SH Added Paths: ----------- trunk/mailagent/bin/svn-revision trunk/mailagent/revision.h Modified: trunk/mailagent/Configure =================================================================== --- trunk/mailagent/Configure 2008-05-30 09:09:53 UTC (rev 21) +++ trunk/mailagent/Configure 2008-05-30 09:12:22 UTC (rev 22) @@ -16,9 +16,9 @@ # The dist package (which contains metaconfig) is available via SVN: # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist -# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $ +# $Id: Head.U 25 2008-05-28 11:19:25Z rmanfredi $ # -# Generated on Wed May 28 11:41:09 CEST 2008 [metaconfig 3.5 PL0] +# Generated on Fri May 30 11:10:37 CEST 2008 [metaconfig 3.5-25] cat >c1$$ <<EOF ARGGGHHHH!!!!! @@ -413,6 +413,7 @@ package='' spackage='' patchlevel='' +revision='' perlpath='' pidtype='' pkgsrc='' @@ -849,7 +850,7 @@ esac shift ;; - -V) echo "$me generated by metaconfig 3.5 PL0." >&2 + -V) echo "$me generated by metaconfig 3.5-25." >&2 exit 0;; --) break;; -*) echo "$me: unknown option $1" >&2; shift; error=true;; @@ -6517,9 +6518,9 @@ : set the base revision baserev=3.0 -: get the patchlevel +: get the patchlevel / revision echo " " -echo "Getting the current patchlevel..." >&4 +echo "Getting the current patchlevel / revision..." >&4 if $test -r $rsrc/patchlevel.h;then patchlevel=`awk \ '/^#[ ]*define[ ][ ]*PATCHLEVEL/ {print $3}' \ @@ -6527,7 +6528,22 @@ else patchlevel=0 fi -echo "(You have $package $baserev PL$patchlevel.)" +if $test -r $rsrc/revision.h;then + revision=`awk \ + '/^#[ ]*define[ ][ ]*REVISION/ {print $3}' \ + < $rsrc/revision.h` +else + revision=0 +fi +case "$revision" in +0) echo "(You have $package $baserev PL$patchlevel.)" ;; +*) + case "$patchlevel" in + 0) echo "(You have $package $baserev-$revision)";; + *) echo "(You have $package $baserev-$revision PL$patchlevel)";; + esac + ;; +esac : define an is-a-typedef? function typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; @@ -7518,6 +7534,7 @@ reg8='$reg8' reg9='$reg9' registers='$registers' +revision='$revision' rm='$rm' rmail='$rmail' rootid='$rootid' @@ -7579,6 +7596,8 @@ : add special variables $test -f $src/patchlevel.h && \ awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh +$test -f $src/revision.h && \ +awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/revision.h >>config.sh echo "CONFIG=true" >>config.sh : propagate old symbols Modified: trunk/mailagent/MANIFEST =================================================================== --- trunk/mailagent/MANIFEST 2008-05-30 09:09:53 UTC (rev 21) +++ trunk/mailagent/MANIFEST 2008-05-30 09:12:22 UTC (rev 22) @@ -298,6 +298,7 @@ agent/test/rules Rules used by filtering tests bin/ Directory for uninstalled binaries bin/perload The dataloading/autoloading perl translator +bin/svn-revision Updates the top "revision.h" file if needed config_h.SH Produces config.h confmagic.h Magic symbol remapping install.SH Installation script @@ -335,3 +336,4 @@ misc/unkit/rules Rules to be added to handle kit messages misc/unkit/unkit.pl Implementation of the user-defined UNKIT command patchlevel.h Current version number and patch level +revision.h The current SVN revision number for mailagent Modified: trunk/mailagent/Makefile.SH =================================================================== --- trunk/mailagent/Makefile.SH 2008-05-30 09:09:53 UTC (rev 21) +++ trunk/mailagent/Makefile.SH 2008-05-30 09:12:22 UTC (rev 22) @@ -1,5 +1,5 @@ -: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.0 PL48] -: $X-Id: Jmake.tmpl,v 3.0.1.2 1995/01/11 14:50:21 ram Exp ram $ +: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5-25] +: $X-Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ case $CONFIG in '') @@ -37,7 +37,7 @@ # Parameters set by Configure -- edit config.sh if changes are needed CTAGS = ctags -MAKE = make +JCPPFLAGS = $cppflags MV = $mv RM = $rm -f @@ -50,7 +50,7 @@ $spitshell >>Makefile <<'!NO!SUBS!' ######################################################################## # Jmake rules for building libraries, programs, scripts, and data files -# $X-Id: Jmake.rules,v 3.0.1.2 1995/01/11 14:49:55 ram Exp ram $ +# $X-Id: Jmake.rules 18 2006-12-27 10:35:09Z rmanfredi $ ######################################################################## # Start of Jmakefile @@ -58,7 +58,7 @@ # $X-Id: Jmakefile,v 3.0 1993/11/29 13:47:34 ram Exp ram $ # # Copyright (c) 1990-2006, Raphael Manfredi -# +# # You may redistribute only under the terms of the Artistic License, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of @@ -80,28 +80,48 @@ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo "Depending" "in $(DIR)$$i..."; \ - $(MAKE) $(MFLAGS) depend); \ + $(MAKE) $(MFLAGS) depend) || exit 1; \ done +all:: revision.h + +.FORCE: + +revision.h: .FORCE + $(TOP)/bin/svn-revision $(TOP) $@ + ######################################################################## # Common rules for all Makefiles -- do not edit -emptyrule:: +all:: clean: sub_clean local_clean realclean: sub_realclean local_realclean clobber: sub_clobber local_clobber local_clean:: - $(RM) core *~ *.o + if test -f core; then $(RM) core; fi + $(RM) *~ *.o local_realclean:: local_clean $(RM) -r UU local_clobber:: local_realclean $(RM) config.sh config.h + $(RM) -r .config $(RM) Makefile +install:: local_install sub_install +install.man:: maybe_install.man sub_install.man +deinstall:: sub_deinstall local_deinstall +deinstall.man:: sub_deinstall.man maybe_deinstall.man + +install.man-no: +deinstall.man-no: + +maybe_install.man: install.man-no +maybe_deinstall.man: deinstall.man-no + Makefile.SH: Jmakefile -@if test -f $(TOP)/.package; then \ if test -f Makefile.SH; then \ @@ -110,7 +130,7 @@ fi; \ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \ - else touch $@; exit 0; fi + else touch $@; fi Makefile: Makefile.SH /bin/sh Makefile.SH @@ -130,20 +150,22 @@ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo $(VERB) "in $(DIR)$$i..."; \ - $(MAKE) $(MFLAGS) $(FLAGS) $(TARGET)); \ + $(MAKE) $(MFLAGS) $(FLAGS) $(TARGET)) || exit 1; \ done -install:: +sub_install:: @$(MAKE) subdirs TARGET=install VERB="Installing" FLAGS= -deinstall:: +sub_deinstall:: @$(MAKE) subdirs TARGET=deinstall VERB="Deinstalling" FLAGS= + @echo "Back to $(CURRENT) for "deinstall... -install.man:: +sub_install.man:: @$(MAKE) subdirs TARGET=install.man VERB="Installing man pages" FLAGS= -deinstall.man:: +sub_deinstall.man:: @$(MAKE) subdirs TARGET=deinstall.man VERB="Deinstalling man pages" FLAGS= + @echo "Back to $(CURRENT) for "deinstall.man... sub_clean:: @$(MAKE) subdirs TARGET=clean VERB="Cleaning" FLAGS= @@ -162,7 +184,7 @@ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo "Tagging" "in $(DIR)$$i..."; \ - $(MAKE) $(MFLAGS) tag); \ + $(MAKE) $(MFLAGS) tag) || exit 1; \ done Makefiles:: @@ -172,7 +194,7 @@ echo "Making "Makefiles" in $(DIR)$$i..."; \ (cd $$i || exit 1; \ if test ! -f Makefile; then /bin/sh Makefile.SH; fi; \ - $(MAKE) $(MFLAGS) Makefiles) \ + $(MAKE) $(MFLAGS) Makefiles) || exit 1;\ done Makefiles.SH:: Makefile.SH @@ -189,14 +211,23 @@ /*) newtop="$(TOP)" ;; \ esac; \ echo "Making Makefiles.SH in $(DIR)$$i..."; \ - (cd $$i || exit 1; $(MAKE) $(MFLAGS) -f ../Makefile \ - Makefile TOP=$$newtop CURRENT=$(DIR)$$i;\ - $(MAKE) $(MFLAGS) Makefiles.SH) \ + (cd $$i || exit 1; \ + if test -f Jmakefile; then \ + $(MAKE) $(MFLAGS) -f ../Makefile \ + Makefile TOP=$$newtop CURRENT=$(DIR)$$i && \ + $(MAKE) $(MFLAGS) Makefiles.SH; \ + fi; \ + ) || exit 1; \ done all:: @$(MAKE) subdirs TARGET=all VERB="Making all" FLAGS= +local_install:: +local_deinstall:: +local_install.man:: +local_deinstall.man:: + !NO!SUBS! chmod 644 Makefile $eunicefix Makefile Added: trunk/mailagent/bin/svn-revision =================================================================== --- trunk/mailagent/bin/svn-revision (rev 0) +++ trunk/mailagent/bin/svn-revision 2008-05-30 09:12:22 UTC (rev 22) @@ -0,0 +1,61 @@ +#!/bin/sh + +# +# $Id: svn-revision 12303 2006-11-11 08:11:46Z cbiere $ +# +# Copyright (c) 2006, Raphael Manfredi +# +# You may redistribute only under the terms of the Artistic Licence, +# as specified in the README file that comes with the distribution. +# You may reuse parts of this distribution only within the terms of +# that same Artistic Licence; a copy of which may be found at the root +# of the source tree for dist 4.0. +# +# Computes SVN current revision number, if possible, emitting it in +# the form of a #define for C perusal. +# + +LC_ALL=C +export LC_ALL + +TOP="$1" +FILE="$2" + +if [ "x$FILE" = x ]; then + FILE="&1" + oldrev='' +else + oldrev=`grep REVISION "$FILE" 2>/dev/null | head -n1 | cut -d' ' -f3` +fi + +if test -d "$TOP/.svn"; then + revnum=`svn info "$TOP" 2>/dev/null | grep '^Revision' | head -n1 | cut -d' ' -f2` +else + revnum="$oldrev" # keep as is +fi + +if [ "x$revnum" = "x$oldrev" ]; then + exit 0 +fi + +{ +stamp=`date +"%Y-%m-%d %H:%M:%d %z"` +cat <<EOF +/* + * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT + * + * Generated by $0. + */ + +EOF + +if [ "x$revnum" = x ]; then + echo '/* Subversion information not available */' +else + cat <<EOF +#define REVISION $revnum +EOF +fi + +} > "$FILE" + Property changes on: trunk/mailagent/bin/svn-revision ___________________________________________________________________ Name: svn:executable + * Added: trunk/mailagent/revision.h =================================================================== --- trunk/mailagent/revision.h (rev 0) +++ trunk/mailagent/revision.h 2008-05-30 09:12:22 UTC (rev 22) @@ -0,0 +1,7 @@ +/* + * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT + * + * Generated by ./bin/svn-revision. + */ + +#define REVISION 21 Property changes on: trunk/mailagent/revision.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 09:09:54
|
Revision: 21 http://mailagent.svn.sourceforge.net/mailagent/?rev=21&view=rev Author: rmanfredi Date: 2008-05-30 02:09:53 -0700 (Fri, 30 May 2008) Log Message: ----------- Added update of revision.h. Modified Paths: -------------- trunk/mailagent/Jmakefile Modified: trunk/mailagent/Jmakefile =================================================================== --- trunk/mailagent/Jmakefile 2008-05-30 09:04:33 UTC (rev 20) +++ trunk/mailagent/Jmakefile 2008-05-30 09:09:53 UTC (rev 21) @@ -23,3 +23,10 @@ SetSubdirs(agent) AddedByConfigure(install mkdep cppstdin) DependSubdirs() + +all:: revision.h + +.FORCE: + +revision.h: .FORCE + $(TOP)/bin/svn-revision $(TOP) $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 09:04:37
|
Revision: 20 http://mailagent.svn.sourceforge.net/mailagent/?rev=20&view=rev Author: rmanfredi Date: 2008-05-30 02:04:33 -0700 (Fri, 30 May 2008) Log Message: ----------- Removed the WARNING level, as it is not critical enough to warrant a daily notification. Modified Paths: -------------- trunk/mailagent/agent/files/chkagent.sh Modified: trunk/mailagent/agent/files/chkagent.sh =================================================================== --- trunk/mailagent/agent/files/chkagent.sh 2008-05-30 08:58:52 UTC (rev 19) +++ trunk/mailagent/agent/files/chkagent.sh 2008-05-30 09:04:33 UTC (rev 20) @@ -25,7 +25,7 @@ # # Make sure the mailagent is working well -lookat='ERROR|FAILED|WARNING|UNLOCKED|FATAL|DUMPED|SYSERR' +lookat='ERROR|FAILED|UNLOCKED|FATAL|DUMPED|SYSERR' trap "rm -f $report $output $todaylog $msg" 1 2 3 15 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 08:59:01
|
Revision: 19 http://mailagent.svn.sourceforge.net/mailagent/?rev=19&view=rev Author: rmanfredi Date: 2008-05-30 01:58:52 -0700 (Fri, 30 May 2008) Log Message: ----------- Changed path for checkagent.sh in the sample crontab entry. Modified Paths: -------------- trunk/mailagent/agent/files/README Modified: trunk/mailagent/agent/files/README =================================================================== --- trunk/mailagent/agent/files/README 2008-05-30 08:40:47 UTC (rev 18) +++ trunk/mailagent/agent/files/README 2008-05-30 08:58:52 UTC (rev 19) @@ -14,7 +14,7 @@ Here is my crontab entry: # Check the mailagent log file for the current day - 55 23 * * * $HOME/etc/checkagent + 55 23 * * * /usr/share/mailagent/chkagent.sh commands: This file holds the allowed commands for @SH hooks. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 08:40:48
|
Revision: 18 http://mailagent.svn.sourceforge.net/mailagent/?rev=18&view=rev Author: rmanfredi Date: 2008-05-30 01:40:47 -0700 (Fri, 30 May 2008) Log Message: ----------- Added bzip2 compressor. Modified Paths: -------------- trunk/mailagent/agent/files/compressors Modified: trunk/mailagent/agent/files/compressors =================================================================== --- trunk/mailagent/agent/files/compressors 2008-05-30 08:38:08 UTC (rev 17) +++ trunk/mailagent/agent/files/compressors 2008-05-30 08:40:47 UTC (rev 18) @@ -33,3 +33,4 @@ compress .Z compress uncompress zcat pack .z pack unpack pcat gzip .gz gzip -9 gunzip gunzip -c +bzip2 .bz2 bzip2 bunzip2 bzcat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 08:38:10
|
Revision: 17 http://mailagent.svn.sourceforge.net/mailagent/?rev=17&view=rev Author: rmanfredi Date: 2008-05-30 01:38:08 -0700 (Fri, 30 May 2008) Log Message: ----------- Removed legacy hardwired HOME directory. Compute it! Modified Paths: -------------- trunk/mailagent/agent/files/filter.sh Modified: trunk/mailagent/agent/files/filter.sh =================================================================== --- trunk/mailagent/agent/files/filter.sh 2008-05-30 08:22:13 UTC (rev 16) +++ trunk/mailagent/agent/files/filter.sh 2008-05-30 08:38:08 UTC (rev 17) @@ -34,7 +34,9 @@ # "|exec /users/ram/mail/filter >>/users/ram/.bak 2>&1" # Variable HOME *must* correctly be set to your home directory -HOME=/york/ram +# This should compute it correctly, if not, hardwire it +user=`(logname || whoami) 2>/dev/null` +HOME=`grep ^$user: /etc/passwd | cut -d':' -f 6` export HOME # The PATH variable must also correctly be set. This variable will be @@ -233,7 +235,6 @@ fi # Change the name of the temporary file. -user=`(logname || whoami) 2>/dev/null` tmpdir=`echo $temp | sed -e 's/\(.*\)\/.*/\1/'` mv $temp $tmpdir/$user.$$ temp="$tmpdir/$user.$$" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-30 08:22:29
|
Revision: 16 http://mailagent.svn.sourceforge.net/mailagent/?rev=16&view=rev Author: rmanfredi Date: 2008-05-30 01:22:13 -0700 (Fri, 30 May 2008) Log Message: ----------- Removed more "$*" uses that are now forbidden by perl 5.10. Modified Paths: -------------- trunk/mailagent/agent/edusers.SH trunk/mailagent/agent/mailhelp.SH trunk/mailagent/agent/maillist.SH trunk/mailagent/agent/mailpatch.SH trunk/mailagent/agent/package.SH Modified: trunk/mailagent/agent/edusers.SH =================================================================== --- trunk/mailagent/agent/edusers.SH 2008-05-29 22:13:02 UTC (rev 15) +++ trunk/mailagent/agent/edusers.SH 2008-05-30 08:22:13 UTC (rev 16) @@ -17,7 +17,7 @@ echo "Extracting agent/edusers (with variable substitutions)" $spitshell >edusers <<!GROK!THIS! $startperl - eval "exec perl -S \$0 \$*" + eval 'exec perl -S \$0 \${1+"\$@"}' if \$running_under_some_shell; # $Id$ Modified: trunk/mailagent/agent/mailhelp.SH =================================================================== --- trunk/mailagent/agent/mailhelp.SH 2008-05-29 22:13:02 UTC (rev 15) +++ trunk/mailagent/agent/mailhelp.SH 2008-05-30 08:22:13 UTC (rev 16) @@ -17,7 +17,7 @@ echo "Extracting agent/mailhelp (with variable substitutions)" $spitshell >mailhelp <<!GROK!THIS! $startperl - eval "exec perl -S \$0 \$*" + eval 'exec perl -S \$0 \${1+"\$@"}' if \$running_under_some_shell; # $Id$ Modified: trunk/mailagent/agent/maillist.SH =================================================================== --- trunk/mailagent/agent/maillist.SH 2008-05-29 22:13:02 UTC (rev 15) +++ trunk/mailagent/agent/maillist.SH 2008-05-30 08:22:13 UTC (rev 16) @@ -17,7 +17,7 @@ echo "Extracting agent/maillist (with variable substitutions)" $spitshell >maillist <<!GROK!THIS! $startperl - eval "exec perl -S \$0 \$*" + eval 'exec perl -S \$0 \${1+"\$@"}' if \$running_under_some_shell; # $Id$ Modified: trunk/mailagent/agent/mailpatch.SH =================================================================== --- trunk/mailagent/agent/mailpatch.SH 2008-05-29 22:13:02 UTC (rev 15) +++ trunk/mailagent/agent/mailpatch.SH 2008-05-30 08:22:13 UTC (rev 16) @@ -17,7 +17,7 @@ echo "Extracting agent/mailpatch (with variable substitutions)" $spitshell >mailpatch <<!GROK!THIS! $startperl - eval "exec perl -S \$0 \$*" + eval 'exec perl -S \$0 \${1+"\$@"}' if \$running_under_some_shell; # $Id$ Modified: trunk/mailagent/agent/package.SH =================================================================== --- trunk/mailagent/agent/package.SH 2008-05-29 22:13:02 UTC (rev 15) +++ trunk/mailagent/agent/package.SH 2008-05-30 08:22:13 UTC (rev 16) @@ -17,7 +17,7 @@ echo "Extracting agent/package (with variable substitutions)" $spitshell >package <<!GROK!THIS! $startperl - eval "exec perl -S \$0 \$*" + eval 'exec perl -S \$0 \${1+"\$@"}' if \$running_under_some_shell; # $Id$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-29 22:13:26
|
Revision: 15 http://mailagent.svn.sourceforge.net/mailagent/?rev=15&view=rev Author: rmanfredi Date: 2008-05-29 15:13:02 -0700 (Thu, 29 May 2008) Log Message: ----------- Integrated more changed from Debian: * Fixed maildir computation logic to avoid useless superseding. * Added regular expression for Top Level Domain validation. * Removed "compress" from the list of default compressors and added bzip2. Modified Paths: -------------- trunk/mailagent/agent/magent.sh trunk/mailagent/agent/pl/compress.pl trunk/mailagent/agent/pl/parse.pl Modified: trunk/mailagent/agent/magent.sh =================================================================== --- trunk/mailagent/agent/magent.sh 2008-05-28 20:35:53 UTC (rev 14) +++ trunk/mailagent/agent/magent.sh 2008-05-29 22:13:02 UTC (rev 15) @@ -698,10 +698,10 @@ # override value computed by Configure. $maildir = $cf'maildrop if $cf'maildrop ne ''; # If Configure gave a valid 'maildir', use it. Otherwise compute one now. - unless ($maildir ne '' && -d "$maildir") { + unless ($maildir ne '' && -d $maildir) { $maildir = "/usr/spool/mail"; # Default spooling area - -d "/usr/mail" && ($maildir = "/usr/mail"); - -d "$maildir" || ($maildir = "$cf'home"); + -d $maildir || (-d "/usr/mail" && ($maildir = "/usr/mail")); + -d $maildir || ($maildir = $cf'home); } local($mbox) = $cf'user; # Default mailbox file name $mbox = $cf'mailbox if $cf'mailbox ne ''; # Priority to config variable Modified: trunk/mailagent/agent/pl/compress.pl =================================================================== --- trunk/mailagent/agent/pl/compress.pl 2008-05-28 20:35:53 UTC (rev 14) +++ trunk/mailagent/agent/pl/compress.pl 2008-05-29 22:13:02 UTC (rev 15) @@ -62,9 +62,12 @@ unless (open(COMPSPEC, "$cf'compspec")) { # Configure a set of defaults if the user hasn't specified them manually + # Fields are: tag extension compression_prog uncompress_prog cat_prog + # The following legacy line removed as modern systems lack compress: + # compress .Z compress uncompress zcat &add_compressor(<<'EOT'); -compress .Z compress uncompress zcat -gzip .gz gzip gunzip gunzip -c +gzip .gz gzip gunzip gunzip -c +bzip2 .bz2 bzip2 bunzip2 bzcat EOT local($err) = "$!"; &'add_log("WARNING cannot open compspec file $cf'compspec: $err") Modified: trunk/mailagent/agent/pl/parse.pl =================================================================== --- trunk/mailagent/agent/pl/parse.pl 2008-05-28 20:35:53 UTC (rev 14) +++ trunk/mailagent/agent/pl/parse.pl 2008-05-29 22:13:02 UTC (rev 15) @@ -328,6 +328,37 @@ local($i); local($_); + # All the known top-level domains as of 2006-08-15 + # with the addition of "loc" and "private". + # See http://data.iana.org/TLD/tlds-alpha-by-domain.txt + my $tlds_re = qr/ + a(?:ero|rpa|[c-gil-oq-uwxz])| + b(?:iz|[abd-jmnorstvwyz])| + c(?:at|o(?:m|op)|[acdf-ik-oruvxyz])| + d[ejkmoz]| + e(?:du|[cegr-u])| + f[ijkmor]| + g(?:ov|[abd-ilmnp-uwy])| + h[kmnrtu]| + i(?:n(?:fo|t)|[del-oq-t])| + j(?:obs|[emop])| + k[eghimnrwyz]| + l(?:[abcikr-vy]|oc)| + m(?:il|obi|useum|[acdghk-z])| + n(?:ame|et|[acefgilopruz])| + o(?:m|rg)| + p(?:r(?:ivate|o)|[ae-hk-nrstwy])| + qa| + r[eouw]| + s[a-eg-ortuvyz]| + t(?:ravel|[cdfghj-prtvwz])| + u[agkmsyz]| + v[aceginu]| + w[fs]| + y[etu]| + z[amw] + /ix; + for ($i = 0; $i < @received; $i++) { $received = $_ = $received[$i]; @@ -339,7 +370,7 @@ ) { $host = $1; $host .= ".$cf::domain" - if $host =~ /^\w/ && $host !~ /\.\w{2,4}$/; + if $host =~ /^\w/ && $host !~ /\.$tlds_re$/; push(@hosts, $host); } else { &add_log("WARNING no by in first Received: line '$received'") @@ -411,7 +442,7 @@ # if the "real" host name we attempted to guess is an IP address # or looks like a fully qualified domain name. - $host = $real if $real =~ /\.\w{2,4}$/ || $real =~ /^\[[\d.]+\]$/; + $host = $real if $real =~ /\.$tlds_re$/ || $real =~ /^\[[\d.]+\]$/; if ($host eq '') { &add_log("NOTICE no relaying origin in Received: line '$received'") @@ -451,7 +482,7 @@ unless ( $host =~ /^\[[\d.]+\]$/ || - $host =~ /^[\w-.]+\.\w{2,4}$/ || + $host =~ /^[\w-.]+\.$tlds_re$/ || $host =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ ) { next if $host =~ /^[\w-]+$/; # No message for unqualified hosts This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-28 20:36:05
|
Revision: 14 http://mailagent.svn.sourceforge.net/mailagent/?rev=14&view=rev Author: rmanfredi Date: 2008-05-28 13:35:53 -0700 (Wed, 28 May 2008) Log Message: ----------- Cleaned up by fixing most of the items listed in Debian bug #43171. Modified Paths: -------------- trunk/mailagent/agent/man/mailagent.SH Modified: trunk/mailagent/agent/man/mailagent.SH =================================================================== --- trunk/mailagent/agent/man/mailagent.SH 2008-05-28 19:08:54 UTC (rev 13) +++ trunk/mailagent/agent/man/mailagent.SH 2008-05-28 20:35:53 UTC (rev 14) @@ -1032,7 +1032,7 @@ .TP .B \-F Force processing on already seen messages. Usually, \fImailagent\fR enters -the special \fI_SEEN_\fR mode when it detects an \fIX-Filter:\fR line issued +the special \fI_SEEN_\fR state when it detects an \fIX-Filter:\fR line issued by itself, but this option will have it continue as usual (although vacation messages are disabled). Use this option when post-processing mail already filtered. Also look at the @@ -1360,7 +1360,7 @@ From: r[oa]* # Match \fI...@ei...\fR but not \fI...@ei...\fR -To Cc: gu...@ei... +To Cc: /^gue@eiffel\\\\.fr/ # This will match \fI...@ei...\fR as well as \fI...@ei...\fR To Cc: /gue@eiffel/ @@ -1852,9 +1852,10 @@ .TP BEGIN [\fB\-ft\fR] \fIstate\fR Enter a new state. An explicit REJECT or RESTART is necessary to abort the -processing of the current rule. The processing begins in state INITIAL. +processing of the current rule. The processing begins in the state INITIAL. If the \fB\-f\fR (resp. \fB\-t\fR) flag is specified, then the state change only occurs if the last command status indicated a failure (resp. a success). +A state name can contain alphanumeric characters and underscores. (Does not modify existing status) .TP BIFF [\fB\-l\fR] \fIon|off|path\fR @@ -1909,7 +1910,7 @@ Feed the whole message to a program and get the output back as the new message. The header structure used by the rules is not updated: an explicit RESYNC is necessary. Hence the program appears as a filter for the whole -message. +message. It does not tag the message as having been saved. (Returns the status of \fIprogram\fR) .TP FORWARD \fIaddress(es)\fR @@ -1923,6 +1924,7 @@ GIVE \fIprogram\fR Give the body of the message to the specified program by feeding its standard input. Any output is mailed to the user who runs the \fImailagent\fR. +Note that the message is not tagged as having been saved. (Returns the status of \fIprogram\fR) .TP KEEP \fIheader_fields_list\fR @@ -1999,6 +2001,7 @@ PASS \fIprogram\fR Feed the body of the message to the specified program and get a new body back from the output of the program. +Note that the message is not tagged as having been saved. (Returns the status of \fIprogram\fR) .TP PERL \fIscript\fR [\fIarguments\fR] @@ -2010,6 +2013,9 @@ PIPE \fIprogram\fR Pipe the whole message to the specified program, but do not get anything back. Any output is mailed to the user who runs the \fImailagent\fR. +The message is not tagged as having been saved in any case, so you must +explicitly DELETE it if piping was enough and it did not fail: "REJECT -f" +is your friend here to avoid unwanted deletion. (Returns the status of \fIprogram\fR) .TP POST [\fB\-lb\fR] \fInewsgroup(s)\fR @@ -2063,22 +2069,24 @@ Feed the header into a program and get new header back. No RESYNC is done. This may be used to indeed purify the header by removing all the verbose stuff added by so many mail transport agents (X-400 like lines for instance). +Obviously, this does not flag the message as having been saved. (Returns the status of \fIprogram\fR) .TP QUEUE -Queue mail again. A successful queuing counts as if mail had been saved. +Queue mail again. A successful queuing counts as if mail has been saved. Mail queued that way will not be processed during the next 30 minutes. Note that unless mailagent is invoked on a regular basis by \fIcron\fR, the mail will remain in the queue until another mail arrives. (Fails when mail cannot be queued) .TP -RECORD [\fB\-acr\fR] [\fImode\fR] [\fI(tag-list)\fR] -Record message in the history and enters mode _SEEN_ if the message was +RECORD [\fB\-acr\fR] [\fIstate\fR] [\fI(tag-list)\fR] +Record message in the history and enters state _SEEN_ if the message was already present there. If the message is recorded for the first time, processing continues normally. Otherwise a REJECT is performed. This behavior may be somewhat modified by using some options. See UNIQUE for a complete description -of the options and arguments. Naturally, when a \fImode\fR is specified, that +of the options and arguments. Naturally, when a \fIstate\fR is specified, that overrides the default _SEEN_. +A state name can contain alphanumeric characters and underscores. .sp When a \fItag-list\fR (comma-separated list of names) is specified, the message is only recorded and checked against all those tags, but only them. Not @@ -2086,13 +2094,14 @@ See paragraph \fBUsing Tags in Record and Unique\fR for more information. (Returns a failure status if mail was already recorded) .TP -REJECT [\fB\-tf\fR] [\fImode\fR] +REJECT [\fB\-tf\fR] [\fIstate\fR] Abort execution of current action, and continue matching. If \fB\-t\fR is specified, the reject will occur only if the previous action was successfully completed (return status of true), whilst \fB\-f\fR would cause the reject only -when a failure occurred. If a \fImode\fR is specified, we enter that mode before -rejection. REJECT resets the matching flag, which means that if no further -match occurs, the default action will apply. +when a failure occurred. If a \fIstate\fR is specified, we enter that state +before rejection. REJECT resets the matching flag, which means that if no +further match occurs, the default action will apply. +A state name can contain alphanumeric characters and underscores. (Does not alter execution status) .TP REQUIRE \fIfile\fR [\fIpackage\fR] @@ -2104,10 +2113,10 @@ with a statement returning a true value. (Fails if file cannot be loaded) .TP -RESTART [\fB\-tf\fR] [\fImode\fR] +RESTART [\fB\-tf\fR] [\fIstate\fR] Abort execution of current action and restart the matching process from the beginning. To avoid loops, each rule may be walked through once in a given -mode. See REJECT for the meaning of the optional parameters. RESTART resets +state. See REJECT for the meaning of the optional parameters. RESTART resets the matching flag, which means that the default action will apply, should no further match occur. (Does not alter execution status) @@ -2118,8 +2127,8 @@ (Does not alter execution status) .TP RUN \fIprogram\fR -Run the specified program and mail any output to the user who runs the -\fImailagent\fR. +Run the specified program and mail any output to the user who runs +\fImailagent\fR. This action does not flag the message as having been saved. (Returns the status of \fIprogram\fR) .TP SAVE \fIfolder\fR @@ -2243,7 +2252,7 @@ is used to reset \fImailagent\fR's umask at the start of each mail processing. (Does not alter execution status) .TP -UNIQUE [\fB\-acr\fR] [\fImode\fR] [\fI(tag-list)\fR] +UNIQUE [\fB\-acr\fR] [\fIstate\fR] [\fI(tag-list)\fR] Record message in the history and tag message as saved if it was already present there. If the message is recorded for the first time, processing continues normally. Otherwise a REJECT is performed. If \fB\-r\fR was used, @@ -2254,8 +2263,8 @@ actually prevent the command from disturbing the execution flow, and to later use the return status to see what happened: UNIQUE returns a failure status if the message was already recorded. -If an optional \fImode\fR argument is given, then the automaton will enter that -mode if the mail was previously in the database. +If an optional \fIstate\fR argument is given, then the automaton will enter that +state if the mail was previously in the database. See also RECORD, and the paragraph entitled \fBUsing Tags in Record and Unique\fR for more information about the \fItag-list\fR. (Fails if mail was already recorded) @@ -2298,7 +2307,7 @@ action would return \fIfailed\fR if it could not save the mail in the specified folder. If that SAVE command was followed by a "REJECT -f FAILED", then the execution of the current rule would stop and the automaton would continue to -analyze the mail in the FAILED mode. +analyze the mail in the FAILED state. .PP Some of the actions however do not modify this last execution status. Typically, those are actions which make decisions based on that status, or simply actions @@ -2951,12 +2960,22 @@ some actions are not made available, namely: BACK, BOUNCE, FEED, FORWARD, GIVE, NOTIFY, PASS, PIPE, POST, PURIFY, QUEUE and RUN. Also note that although the ONCE and SELECT constructs are enabled, they will not let you execute -disallowed commands. +disallowed commands. Otherwise, the _SEEN_ state behaves like any other state +you can select or negate, so a <!_SEEN_> guard will not select the rule +when we are in state _SEEN_. .PP -The _SEEN_ mode makes it easy to deal with mails which loop because of an -alias loop you have no control on. If no action is found in the _SEEN_ mode, +The _SEEN_ state makes it easy to deal with mails which loop because of an +alias loop you have no control on. If no action is found in the _SEEN_ state, the mail is left in the mailbox, as usual. Moreover, if no saving is done, a LEAVE is executed. This is the normal behavior. +.PP +The "X-Filter:" header is only added when the message is saved. Actions such +as PIPE or GIVE do not flag the message as being saved and therefore they +do +.B not +add that header line. You can add one via ANNOTATE if you wish to prevent +loops, in case the program to which you are feeding the message might +return it to you in some strange way. ''' .SS "Message Files" .PP @@ -3550,7 +3569,7 @@ .IP \(bu Additionally, you may want to specify whether FOLD is to modify the existing execution status and whether or not it will be allowed within the special -_SEEN_ mode. +_SEEN_ state. .IP \(bu Write some rules using the new FOLD command. This is the \fIeasy\fR part! Note that your command may also be used within perl hooks as if it were @@ -3588,14 +3607,14 @@ or \fIno\fR to express falsehood. If \fIstatus_flag\fR is set to true, then the command will modify the last execution status variable. If \fIseen_flag\fR is true, then the command may be used when the filter -is in _SEEN_ mode. The default values are respectively \fItrue\fR and +is in _SEEN_ state. The default values are respectively \fItrue\fR and \fIfalse\fR. .PP So in our example, we would have written: .Ex FOLD ~/mail/cmds/fold.pl fold no yes .Ef -to allow FOLD even in _SEEN_ mode and have it executed without modifying +to allow FOLD even in _SEEN_ state and have it executed without modifying the current value of the \fIlast-command-status\fR variable. ''' .SS Writing An Implementation @@ -3754,8 +3773,8 @@ When you want to alter control flow to perform a REJECT, a RESTART or an ABORT, you have three choices. If you wish to control that action via an option, the same way the standard UNIQUE does (with \fB\-c\fR, \fB\-r\fR or -\fB\-a\fR), you may call \fI&main'alter_execution(option, mode)\fR giving it -two parameters: the option letter and the mode you wish to change to before +\fB\-a\fR), you may call \fI&main'alter_execution(option, state)\fR giving it +two parameters: the option letter and the state you wish to change to before altering the control flow. .PP You may also want to directly alter the \fI\$wmode\fR and \fI\$cont\fR variables, @@ -3763,8 +3782,8 @@ call low-level routines \fI&main'do_reject\fR, \fI&main'do_restart\fR and \fI&main'do_abort\fR to perform the corresponding operation (with logging). .PP -Remember that the mode _SEEN_ is special and directly handled at the -filter level, and the filter begins in the INITIAL mode. The default +Remember that the _SEEN_ state is special and directly handled at the +filter level, and the filter begins in the INITIAL state. The default action is to continue with the current rule, which is why there is no routine to perform this task. .PP @@ -3912,7 +3931,7 @@ .Ef and we would like that command to modify the existing status, returning a failure if the mail cannot be bounced back. Since this command actually -sends something back, we do not want it to be executed in _SEEN_ mode. +sends something back, we do not want it to be executed in the _SEEN_ state. Here is my implementation (untested): .Ex sub sendback { @@ -4665,7 +4684,7 @@ All: /^Subject: [Cc]ommand/ { SAVE cmds; PROCESS }; -To: gu...@ei... { POST -l mail.gue }; +To: /^gue@eiffel\.fr/ { POST -l mail.gue }; Apparently-To: ram, Newsgroups: mail.gue { BOUNCE gu...@ei... }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-28 19:09:50
|
Revision: 13 http://mailagent.svn.sourceforge.net/mailagent/?rev=13&view=rev Author: rmanfredi Date: 2008-05-28 12:08:54 -0700 (Wed, 28 May 2008) Log Message: ----------- Ensure POST always puts a single space after the field name to avoid INN rejecting the article due to invalid header. Modified Paths: -------------- trunk/mailagent/agent/pl/actions.pl Modified: trunk/mailagent/agent/pl/actions.pl =================================================================== --- trunk/mailagent/agent/pl/actions.pl 2008-05-28 15:28:44 UTC (rev 12) +++ trunk/mailagent/agent/pl/actions.pl 2008-05-28 19:08:54 UTC (rev 13) @@ -881,6 +881,9 @@ } next if /^\s/ && $last_was_header; # Skip removed header continuations $last_was_header = 0; # We decided to keep header line + # Ensure that we always put a single space after the field name + # (before possibly emitting a newline for the continuation) + s/^([\w-]+):(\S)/$1: $2/ || s/^([\w-]+):$/$1: /; print NEWS $_, "\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-28 15:29:18
|
Revision: 12 http://mailagent.svn.sourceforge.net/mailagent/?rev=12&view=rev Author: rmanfredi Date: 2008-05-28 08:28:44 -0700 (Wed, 28 May 2008) Log Message: ----------- Do not process the queue in the background when invoked from terminal, unless given an explicit -q switch, naturally. Modified Paths: -------------- trunk/mailagent/agent/magent.sh Modified: trunk/mailagent/agent/magent.sh =================================================================== --- trunk/mailagent/agent/magent.sh 2008-05-28 15:10:12 UTC (rev 11) +++ trunk/mailagent/agent/magent.sh 2008-05-28 15:28:44 UTC (rev 12) @@ -370,6 +370,8 @@ # message will be skipped anyway, so it's not that critical. # +my $process_queue = 1; + if (!$run_queue) { # Do not enter here if -q if (0 != &pmail($file_name, 0)) { &add_log("ERROR while processing main message--queing it") if $loglvl; @@ -377,26 +379,32 @@ unlink $lockfile; exit 0; # Do not continue } + + # If invoked from a tty and not in test mode, do not process queue + $process_queue = 0 if -t STDOUT && !$test_mode; } -unless ($test_mode) { - # Fork a child: we have to take care of the filter script which is waiting - # for us to finish processing of the delivered mail. - &fork_child() unless $run_queue; +if ($process_queue) { + unless ($test_mode) { + # Fork a child: we have to take care of the filter script which is + # waiting for us to finish processing of the delivered mail. + &fork_child() unless $run_queue; - # From now on, we are in the child process... Don't sleep at all if logging - # level is greater that 11 or if $run_queue is true. Logging level of 12 - # and higher are for debugging and should not be used on a permanent basis - # anyway. + # From now on, we are in the child process... + # Don't sleep at all if logging level is greater that 11 + # or if $run_queue is true. Logging level of 12 and higher are + # for debugging and should not be used on a permanent basis + # anyway. - $sleep = 1; # Give others a chance to queue their mail - $sleep = 0 if $loglvl > 11 || $run_queue; + $sleep = 1; # Give others a chance to queue their mail + $sleep = 0 if $loglvl > 11 || $run_queue; - do { # Eventually process the queue - sleep 30 if $sleep; # Wait in case new mail arrives - } while (&pqueue); -} else { - &pqueue; # Process the queue once in test mode + do { # Eventually process the queue + sleep 30 if $sleep; # Wait in case new mail arrives + } while (&pqueue); + } else { + &pqueue; # Process the queue once in test mode + } } # Mailagent is exiting. Remove lock file as early as possible to avoid a This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-28 15:10:15
|
Revision: 11 http://mailagent.svn.sourceforge.net/mailagent/?rev=11&view=rev Author: rmanfredi Date: 2008-05-28 08:10:12 -0700 (Wed, 28 May 2008) Log Message: ----------- Added -U switch to disable first UNIQUE / RECORD rejection for duplicates. Modified Paths: -------------- trunk/mailagent/MANIFEST trunk/mailagent/agent/magent.sh trunk/mailagent/agent/man/mailagent.SH trunk/mailagent/agent/pl/history.pl trunk/mailagent/agent/test/README trunk/mailagent/agent/test/TEST Added Paths: ----------- trunk/mailagent/agent/test/option/U.t Modified: trunk/mailagent/MANIFEST =================================================================== --- trunk/mailagent/MANIFEST 2008-05-28 15:00:47 UTC (rev 10) +++ trunk/mailagent/MANIFEST 2008-05-28 15:10:12 UTC (rev 11) @@ -273,6 +273,7 @@ agent/test/option/I.t Test -I option agent/test/option/L.t Test -L option agent/test/option/V.t Test -V option +agent/test/option/U.t Test -U option agent/test/option/c.t Test -c option agent/test/option/d.t Test -d option agent/test/option/e.t Test -e option Modified: trunk/mailagent/agent/magent.sh =================================================================== --- trunk/mailagent/agent/magent.sh 2008-05-28 15:00:47 UTC (rev 10) +++ trunk/mailagent/agent/magent.sh 2008-05-28 15:10:12 UTC (rev 11) @@ -241,6 +241,9 @@ print STDERR "$prog_name $mversion PL$patchlevel\n"; exit 0; } + elsif ($_ eq '-U') { # Do not allow UNIQUE to reject / abort + ++$disable_unique; + } elsif ($_ eq '-TEST') { # Mailagent run via TEST (undocumented feature) ++$test_mode; } @@ -411,7 +414,7 @@ # Print usage and exit sub usage { print STDERR <<EOF; -Usage: $prog_name [-dhilqtFIV] [-s{umaryt}] [-f file] [-e rules] [-c config] +Usage: $prog_name [-dhilqtFIVU] [-s{umaryt}] [-f file] [-e rules] [-c config] [-L level] [-r file] [-o def] [mailfile] -c : specify alternate configuration file. -d : dump filter rules (special). @@ -429,6 +432,7 @@ -I : install configuration and perform sanity checks. -L : force logging level. -V : print version number and exits. + -U : prevent UNIQUE from rejecting an already processed Message-ID. EOF exit 1; } Modified: trunk/mailagent/agent/man/mailagent.SH =================================================================== --- trunk/mailagent/agent/man/mailagent.SH 2008-05-28 15:00:47 UTC (rev 10) +++ trunk/mailagent/agent/man/mailagent.SH 2008-05-28 15:10:12 UTC (rev 11) @@ -166,7 +166,7 @@ .SH NAME mailagent \- an automatic mail-processing tool .SH SYNOPSIS -\fBmailagent\fR [ \fB\-dhilqtFIV\fR ] [ \fB\-s{umaryt}\fR ] +\fBmailagent\fR [ \fB\-dhilqtFIVU\fR ] [ \fB\-s{umaryt}\fR ] [ \fB\-f\fI file\fR ] [ \fB\-e\fI rule\fR ] [ \fB\-c\fI config\fR ] [ \fB\-L\fI loglevel\fR ] [ \fB\-r\fI rulefile\fR ] [ \fB\-o\fI override\fR ] [ \fImailfile\fR ] @@ -1035,7 +1035,9 @@ the special \fI_SEEN_\fR mode when it detects an \fIX-Filter:\fR line issued by itself, but this option will have it continue as usual (although vacation messages are disabled). Use this option when post-processing mail already -filtered. +filtered. Also look at the +.B \-U +switch if you are using the RECORD or UNIQUE actions in some rules. .TP .B \-h Print out a usage message on the standard error and exit. @@ -1105,6 +1107,16 @@ .TP .B \-V Print version number and exit. +.TP +.B \-U +Prevent the UNIQUE and RECORD commands from rejecting an already processed +Message-ID the first time they are run on a given message. +This is useful when processing messages that have been dropped in the +.I emergdir +directory due to some abnormal (but transient) condition and you wish to +reprocess the message. Also see the +.B \-F +switch if you are re-processing messages. .PP If you invoke mailagent without options and without any arguments, the program waits for a mail on its standard input. If an argument is provided, it Modified: trunk/mailagent/agent/pl/history.pl =================================================================== --- trunk/mailagent/agent/pl/history.pl 2008-05-28 15:00:47 UTC (rev 10) +++ trunk/mailagent/agent/pl/history.pl 2008-05-28 15:10:12 UTC (rev 11) @@ -94,7 +94,7 @@ if ($time > 0) { # Message already recorded local($tagmsg) = $tag eq '' ? '' : " ($tag)"; &add_log("history duplicate <$msg_id>" . $tagmsg) if $loglvl > 6; - $seen++; + $seen++ unless history_ignore($msg_id, $tag); } else { # Record message (appending) &dbr'update($host, 'HISTORY', 0, @regexp); } @@ -102,6 +102,27 @@ return $seen; # Return seen status } +# Look at whether we should ignore the duplicate if -U was given +# We ignore the first match for a given tag, so if one of the tags here +# was already recorded in %ignored_history_tag, we ignore the -U switch. +# The reason is that different paths in the rules could lead to a UNIQUE +# command that is meant to trap the fact the message was already seen... +# Return TRUE if we need to ignore the duplicate for this time +sub history_ignore { + my ($msg_id, $tag) = @_; + return 0 unless $disable_unique; # return unless -U given + if ($ignored_history_tag{$tag}++) { + # We already ignored once for this tag + add_log("not ignoring this duplicate <$msg_id>$tagmsg despite -U") + if $loglvl > 6; + return 0 + } + my $tagmsg = $tag eq '' ? '' : " ($tag)"; + add_log("ignoring duplicate <$msg_id>$tagmsg since you gave -U") + if $loglvl > 6; + return 1; # Ignore this duplicate +} + # Obsolete -- will be removed in next release sub history_record { &history_tag(); Modified: trunk/mailagent/agent/test/README =================================================================== --- trunk/mailagent/agent/test/README 2008-05-28 15:00:47 UTC (rev 10) +++ trunk/mailagent/agent/test/README 2008-05-28 15:10:12 UTC (rev 11) @@ -17,30 +17,48 @@ them. Running the whole test suite takes a long time. On my machine with 40 Mb of -main memory, it requires 12 minutes to complete. It may take a lot longer -if you do not have at least 16 Mb of RAM. +main memory, it requires 12 minutes to complete (in 1991). It may take a lot +longer if you do not have at least 16 Mb of RAM. +The following options are available to TEST: + + -i incremental, rerun only failed tests + -m monitor logfile with "atail" + -n use the non-dataloaded version + -o allow outdated mailagent / filter + -s stop at first error + The option -i turns the incremental mode on. This proved really nice to me when I was writing this suite, as I was able to skip all the successful -tests and focus only on those which failed or the new ones. The -s option will -cause the test suite to stop at the first error. Normally, only failed basic -tests abort the process. The -o option will not restart the tests from scratch, -even if the mailagent or filter is newer than the current OK file. Option -n -will test the non-dataloaded version of the mailagent (because of some bugs -with eval() which cause the dataloaded version to dump core via a segmentation -violation). +tests and focus only on those which failed or the new ones. +The -s option will cause the test suite to stop at the first error. Normally, +only failed basic tests abort the process. + +The -o option will not restart the tests from scratch, even if the mailagent +or filter is newer than the current OK file. + +Option -n will test the non-dataloaded version of the mailagent (because +of some bugs with eval() which cause the dataloaded version to dump core +via a segmentation violation). + The -m option is for desperate cases. It launches the atail process in the background (a real CPU hog) to monitor all changes to the out/agentlog file. This may be really convenient when debugging a test suite failure... -I don't know why I spent some time documenting all this, as I don't expect -anybody to have any chance working on this suite. Anyway, it might be nice -knowing that all the successful tests are recorded in an OK file, along -with the time stamp of the test, so we may re-run those which were updated -since last run. In the event the mailagent or the filter are modified, the -tests are re-run throughoutfully. +Specifying a list of files on the command line will only run these tests. +For instance: + ./TEST options/i.t + +I don't know why I spent some time documenting all this (in 1992), as I +don't expect anybody to have any chance working on this suite. Anyway, it +might be nice knowing that all the successful tests are recorded in an OK +file, along with the time stamp of the test, so we may re-run those which +were updated since last run. In the event the mailagent or the filter are +modified, the tests are re-run throughoutfully. NB: in 2008, I'm glad I +did document all that. :-) + The file 'level' is optional. If present, it gives the default logging level to be applied when most of the tests are run (i.e. for those who do not require any special logging level). If absent, no logging will be done (except for Modified: trunk/mailagent/agent/test/TEST =================================================================== --- trunk/mailagent/agent/test/TEST 2008-05-28 15:00:47 UTC (rev 10) +++ trunk/mailagent/agent/test/TEST 2008-05-28 15:10:12 UTC (rev 11) @@ -98,6 +98,17 @@ select(STDOUT); $| = 1; + +# If they specified a list of files, run them and do not update "OK" +# nor print any summary status. + +if (@ARGV) { + foreach my $file (@ARGV) { + run_file($file); + exit($failed ? 1 : 0) ; + } +} + open(OK, ">>OK"); select(OK); $| = 1; # We may safely interrupt @@ -185,7 +196,7 @@ sub run { local($dir) = @_; - chdir $dir || die "Cannot chdir to $dir: $!\n"; + chdir $dir or die "Cannot chdir to $dir: $!\n"; local(@files) = <*.t>; local($test); local($output); @@ -200,9 +211,24 @@ &result($test, $output); &basic_failed if $dir eq 'basic' && $failed; } - chdir '..' || die "Cannot chdir back to ..: $!\n"; + chdir '..' or die "Cannot chdir back to ..: $!\n"; } +sub run_file { + my ($path) = @_; + my ($dir, $file) = $path =~ m|^(.*)/(.*)|; + my $test = "$dir/$file"; + unless (-f $test) { + warn "WARNING: ignoring missing $path\n"; + return; + } + &print($dir, $file); + chdir $dir or die "Cannot chdir to $dir: $!\n"; + $output = `perl $file`; + &result($test, $output); + chdir $pwd or die "Cannot chdir back to ..: $!\n"; +} + sub basic_failed { print "Failed a basic test, cannot continue.\n"; unlink 'OK'; Added: trunk/mailagent/agent/test/option/U.t =================================================================== --- trunk/mailagent/agent/test/option/U.t (rev 0) +++ trunk/mailagent/agent/test/option/U.t 2008-05-28 15:10:12 UTC (rev 11) @@ -0,0 +1,68 @@ +# -U : disable reject / abort of first UNIQUE and REJECT. + +# $Id$ +# +# Copyright (c) 1990-2006, Raphael Manfredi +# +# You may redistribute only under the terms of the Artistic License, +# as specified in the README file that comes with the distribution. +# You may reuse parts of this distribution only within the terms of +# that same Artistic License; a copy of which may be found at the root +# of the source tree for mailagent 3.0. +# +# $Log: F.t,v $ +# Revision 3.0.1.1 1994/01/26 09:36:08 ram +# patch5: created +# + +do '../pl/init.pl'; +do '../pl/logfile.pl'; +chdir '../out'; +$user = $ENV{'USER'}; # Don't want to include ../pl/filter.pl +unlink 'folder', 'again', $user; + +$devnull = ">/dev/null 2>&1"; + +# Load the dbr database +unlink("dbr/i/e"); +system "$mailagent -e '{ UNIQUE (a); UNIQUE (b); }' -f ../mail $devnull"; +$? == 0 || print "1\n"; +-f $user || print "2\n"; + +unlink $user; +system "$mailagent -U -e '{ UNIQUE (a); SAVE ~/again; }' -f ../mail $devnull"; +$? == 0 || print "3\n"; +-f $user && print "4\n"; +-s 'again' || print "5\n"; +&get_log(6, 'again'); +&check_log('^X-Filter:', 7) == 1 || print "8\n"; + +unlink $user, 'again'; +system "$mailagent -U -e '{ UNIQUE (a); UNIQUE (b); SAVE ~/again; }' -f ../mail" + . $devnull; +$? == 0 || print "9\n"; +-f $user && print "10\n"; +-s 'again' || print "11\n"; + +unlink $user, 'again'; +system "$mailagent -U -e '{ RECORD (a); RECORD (b); SAVE ~/again; }' -f ../mail" + . $devnull; +$? == 0 || print "12\n"; +-f $user && print "13\n"; +-s 'again' || print "14\n"; + +unlink $user, 'again'; +system "$mailagent -U -e '{ RECORD (a); UNIQUE (a); SAVE ~/again; }' -f ../mail" + . $devnull; +$? == 0 || print "15\n"; +-f $user || print "16\n"; +-s 'again' && print "17\n"; + +unlink $user, 'again'; +system "$mailagent -U -e '{ UNIQUE (a); RECORD (a); SAVE ~/again; }' -f ../mail" + . $devnull; +$? == 0 || print "18\n"; +-f $user || print "19\n"; +-s 'again' && print "20\n"; + +print "0\n"; Property changes on: trunk/mailagent/agent/test/option/U.t ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-28 15:01:28
|
Revision: 10 http://mailagent.svn.sourceforge.net/mailagent/?rev=10&view=rev Author: rmanfredi Date: 2008-05-28 08:00:47 -0700 (Wed, 28 May 2008) Log Message: ----------- Reduce maximum article age for POST to 10 days. Modified Paths: -------------- trunk/mailagent/agent/pl/actions.pl Modified: trunk/mailagent/agent/pl/actions.pl =================================================================== --- trunk/mailagent/agent/pl/actions.pl 2008-05-28 14:51:41 UTC (rev 9) +++ trunk/mailagent/agent/pl/actions.pl 2008-05-28 15:00:47 UTC (rev 10) @@ -763,7 +763,7 @@ my $when = &header'parsedate($str); my $now = time; my $date; - my $AGEMAX = 14 * 86400; # 14 days + my $AGEMAX = 10 * 86400; # 10 days my $THRESH = 86400; # 1 day my $WARN_THRESH = 600; # 10 minutes if ($when < 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-28 14:52:40
|
Revision: 9 http://mailagent.svn.sourceforge.net/mailagent/?rev=9&view=rev Author: rmanfredi Date: 2008-05-28 07:51:41 -0700 (Wed, 28 May 2008) Log Message: ----------- Look for utmp in /var/run as well, for modern systems with read-only /etc. Modified Paths: -------------- trunk/mailagent/Configure trunk/mailagent/U/utmp.U Modified: trunk/mailagent/Configure =================================================================== --- trunk/mailagent/Configure 2008-05-28 09:27:26 UTC (rev 8) +++ trunk/mailagent/Configure 2008-05-28 14:51:41 UTC (rev 9) @@ -18,7 +18,7 @@ # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $ # -# Generated on Wed May 28 11:04:29 CEST 2008 [metaconfig 3.5 PL0] +# Generated on Wed May 28 11:41:09 CEST 2008 [metaconfig 3.5 PL0] cat >c1$$ <<EOF ARGGGHHHH!!!!! @@ -6751,7 +6751,7 @@ : determines where the utmp file lies echo " " case "$utmp" in -'') dflt=`./loc utmp /etc/utmp /etc /var/adm /usr/etc`;; +'') dflt=`./loc utmp /etc/utmp /etc /var/adm /usr/etc /var/run`;; *) dflt="$utmp";; esac fn='l/:utmp' Modified: trunk/mailagent/U/utmp.U =================================================================== --- trunk/mailagent/U/utmp.U 2008-05-28 09:27:26 UTC (rev 8) +++ trunk/mailagent/U/utmp.U 2008-05-28 14:51:41 UTC (rev 9) @@ -13,12 +13,12 @@ ?MAKE: -pick add $@ %< ?S:utmp: ?S: The path of the utmp file where logins are recorded on the system. -?S: Typically something like '/etc/utmp' or '/var/adm/utmp'. +?S: Typically something like '/etc/utmp' or '/var/run/utmp'. ?S:. : determines where the utmp file lies echo " " case "$utmp" in -'') dflt=`./loc utmp /etc/utmp /etc /var/adm /usr/etc`;; +'') dflt=`./loc utmp /etc/utmp /etc /var/adm /usr/etc /var/run`;; *) dflt="$utmp";; esac fn='l/:utmp' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rma...@us...> - 2008-05-28 09:27:31
|
Revision: 8 http://mailagent.svn.sourceforge.net/mailagent/?rev=8&view=rev Author: rmanfredi Date: 2008-05-28 02:27:26 -0700 (Wed, 28 May 2008) Log Message: ----------- Cleaned up code a little bit since now Configure enables gcc warnings by default and thus code required some uplifting. Modified Paths: -------------- trunk/mailagent/agent/filter/environ.c trunk/mailagent/agent/filter/hash.c trunk/mailagent/agent/filter/io.c trunk/mailagent/agent/filter/lock.c trunk/mailagent/agent/filter/logfile.c trunk/mailagent/agent/filter/logfile.h trunk/mailagent/agent/filter/main.c trunk/mailagent/agent/filter/misc.c trunk/mailagent/agent/filter/msg.c trunk/mailagent/agent/filter/parser.c trunk/mailagent/agent/pl/utmp/utmp_ph.c Modified: trunk/mailagent/agent/filter/environ.c =================================================================== --- trunk/mailagent/agent/filter/environ.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/environ.c 2008-05-28 09:27:26 UTC (rev 8) @@ -36,7 +36,9 @@ #include "config.h" #include "portable.h" +#include "logfile.h" #include "hash.h" +#include "msg.h" #include <stdio.h> #ifdef I_STRING @@ -44,6 +46,11 @@ #else #include <strings.h> #endif +#ifdef I_MALLOC +#include <malloc.h> +#else +extern char *malloc(); /* Memory allocation */ +#endif #include "confmagic.h" #define ENV_VARS 200 /* An average number of environment vars */ @@ -56,7 +63,6 @@ */ private struct htable henv; /* The associative array for env */ -extern char *malloc(); /* Memory allocation */ extern char *strsave(); /* String saving */ public void print_env(fd, envp) @@ -85,7 +91,7 @@ if (-1 == ht_create(&henv, ENV_VARS)) return -1; /* Cannot create H table */ - while (env = *envp++) { + while ((env = *envp++)) { strncpy(env_line, env, MAX_STRING); ptr = index(env_line, '='); if (ptr == (char *) 0) { Modified: trunk/mailagent/agent/filter/hash.c =================================================================== --- trunk/mailagent/agent/filter/hash.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/hash.c 2008-05-28 09:27:26 UTC (rev 8) @@ -29,7 +29,19 @@ #include "config.h" #include "portable.h" + +#ifdef I_MALLOC +#include <malloc.h> +#endif + +#ifdef I_STRING +#include <string.h> +#else +#include <strings.h> +#endif + #include "hash.h" +#include "msg.h" #include "confmagic.h" #ifndef lint @@ -41,8 +53,6 @@ private int prime(); /* Is a number a prime one? */ private uint32 nprime(); /* Find next prime number */ -extern char *malloc(); /* Memory allocation */ -extern char *calloc(); /* Character allocation */ extern char *strsave(); /* Save string in memory */ public int ht_create(ht, n) @@ -58,6 +68,7 @@ int hsize; /* Size of created table */ char **array; /* For array creation (keys/values) */ + (void) rcsid; /* Shut up compiler warning */ hsize = nprime((5 * n) / 4); /* Table's size */ array = (char **) calloc(hsize, sizeof(char *)); /* Array of keys */ Modified: trunk/mailagent/agent/filter/io.c =================================================================== --- trunk/mailagent/agent/filter/io.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/io.c 2008-05-28 09:27:26 UTC (rev 8) @@ -95,6 +95,7 @@ #include "config.h" #include "portable.h" + #include <sys/types.h> #include <stdio.h> #include <errno.h> @@ -104,6 +105,12 @@ #include <unistd.h> /* R_OK and friends */ #endif +#ifdef I_MALLOC +#include <malloc.h> +#else +extern char *malloc(); +#endif + #ifdef I_SYS_WAIT #include <sys/wait.h> #endif @@ -157,12 +164,14 @@ #define R_OK 4 /* Test for read permission */ #endif +#include "io.h" #include "hash.h" #include "parser.h" #include "lock.h" #include "logfile.h" #include "environ.h" #include "sysexits.h" +#include "msg.h" #include "confmagic.h" #define BUFSIZE 1024 /* Amount of bytes read in a single call */ @@ -185,7 +194,7 @@ 0, /* ... 1 */ 0, /* ... 2 */ }; -#define STDIO_FDS (sizeof(stream_by_fd) / sizeof(FILE *)) +#define STDIO_FDS (int) (sizeof(stream_by_fd) / sizeof(FILE *)) private char *agent_lockfile(); /* Name of the mailagent lock */ private int get_lock(); /* Attempt to get a lockfile */ @@ -217,13 +226,13 @@ private int queued = 0; /* True when mail queued safely */ private struct mail mail; /* Where mail is expected to lie */ -extern char *malloc(); /* Memory allocation */ -extern char *realloc(); /* Re-allocation of memory pool */ extern char *logname(); /* User's login name */ extern char *strsave(); /* Save string somewhere in core */ +extern void my_exit(); extern int loglvl; /* Logging level */ private struct pool *pool_alloc(size) +int size; { /* Allocate a new pool of given size, or fail if not enough memory */ @@ -245,6 +254,8 @@ failed: fatal("out of memory"); + /* NOTREACHED */ + return NULL; /* Shut up compiler warnings */ } private struct pool *pool_init(size) @@ -295,7 +306,7 @@ struct pool *lp = *pool; /* Local pool pointer */ int fit; /* Amount of data that can fit */ - while (fit = len) { /* Assume everything will fit */ + while ((fit = len)) { /* Assume everything will fit */ if ((lp->offset + len) > lp->size) fit = lp->size - lp->offset; @@ -371,7 +382,7 @@ pool = pool_init(CHUNK); - while (n = read(0, buf, BUFSIZE)) { + while ((n = read(0, buf, BUFSIZE))) { if (n == -1) { add_log(1, "SYSERR read: %m (%e)"); fatal("I/O error while reading mail"); @@ -686,7 +697,8 @@ for (ep = cp = path; ep && *cp; cp = ep ? (ep + 1) : ep) { ep = index(cp, ':'); /* Lookup next `:' separator */ - len = ep ? (ep - cp) : strlen(cp); /* Slurp remaining if not found */ + len = ep ? (ep - cp) : + (int) strlen(cp); /* Slurp remaining if not found */ if ((len + proglen + 1) > MAX_STRING) { add_log(4, "WARNING skipping directory while looking for %s", prog); continue; @@ -925,15 +937,15 @@ goto ok; if ((home != (char *) 0) && (char *) 0 != (where = save_file(home))) goto ok; - if (where = save_file("/usr/spool/uucppublic")) + if ((where = save_file("/usr/spool/uucppublic"))) goto ok; - if (where = save_file("/var/spool/uucppublic")) + if ((where = save_file("/var/spool/uucppublic"))) goto ok; - if (where = save_file("/usr/tmp")) + if ((where = save_file("/usr/tmp"))) goto ok; - if (where = save_file("/var/tmp")) + if ((where = save_file("/var/tmp"))) goto ok; - if (where = save_file("/tmp")) + if ((where = save_file("/tmp"))) goto ok; /* @@ -1258,7 +1270,7 @@ filename); return 0; } - if (buf.st_uid != ruid) { + if ((int) buf.st_uid != ruid) { add_log(1, "ERROR cannot append to %s (not owned by UID %d)", filename, ruid); return 0; @@ -1292,7 +1304,7 @@ add_log(2, "ERROR can't locate %s after opening", filename); return 0; } - if (buf.st_uid != ruid) { + if ((int) buf.st_uid != ruid) { close(fd); add_log(1, "ERROR cannot append to %s (not owned by UID %d)", filename, ruid); Modified: trunk/mailagent/agent/filter/lock.c =================================================================== --- trunk/mailagent/agent/filter/lock.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/lock.c 2008-05-28 09:27:26 UTC (rev 8) @@ -45,10 +45,16 @@ #include "config.h" #include "portable.h" + +#include <stdio.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> +#ifdef I_UNISTD +#include <unistd.h> +#endif + #ifdef I_FCNTL #include <fcntl.h> #endif @@ -63,6 +69,8 @@ #endif #include "parser.h" +#include "msg.h" +#include "logfile.h" #include "lock.h" #include "confmagic.h" Modified: trunk/mailagent/agent/filter/logfile.c =================================================================== --- trunk/mailagent/agent/filter/logfile.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/logfile.c 2008-05-28 09:27:26 UTC (rev 8) @@ -48,6 +48,10 @@ #include <errno.h> #include <sys/types.h> +#ifdef I_MALLOC +#include <malloc.h> +#endif + #ifdef I_TIME # include <time.h> #endif @@ -60,6 +64,12 @@ # undef KERNEL #endif +#ifdef I_STRING +#include <string.h> +#else +#include <strings.h> +#endif + /* Get the O_* constants */ #ifdef I_FCNTL #include <fcntl.h> @@ -88,7 +98,6 @@ public Pid_t progpid = 0; /* Program PID */ extern Time_t time(); /* Time in seconds since the Epoch */ -extern char *malloc(); /* Memory allocation */ extern char *strsave(); /* Save string in memory */ extern int errno; /* System error report variable */ @@ -200,8 +209,8 @@ int len; /* Length of substituted text */ - while (*to++ = *from) - if (*from++ == '%') + while ((*to++ = *from)) { + if (*from++ == '%') { switch (*from) { case 'm': /* %m is the English description */ len = add_error(to - 1); @@ -214,6 +223,8 @@ from++; break; } + } + } } private int add_error(where) Modified: trunk/mailagent/agent/filter/logfile.h =================================================================== --- trunk/mailagent/agent/filter/logfile.h 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/logfile.h 2008-05-28 09:27:26 UTC (rev 8) @@ -31,6 +31,7 @@ #define _logfile_h_ #include "config.h" +#include <sys/types.h> /* Routine defined by logging package */ extern void add_log(); /* Add logging message */ Modified: trunk/mailagent/agent/filter/main.c =================================================================== --- trunk/mailagent/agent/filter/main.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/main.c 2008-05-28 09:27:26 UTC (rev 8) @@ -59,6 +59,15 @@ #include <signal.h> #include <sys/types.h> #include <errno.h> + +#ifdef I_UNISTD +#include <unistd.h> +#endif + +#ifdef I_STDLIB +#include <stdlib.h> +#endif + #include "logfile.h" #include "io.h" #include "hash.h" @@ -78,9 +87,9 @@ private void no_setid(); /* Option not allowed when running set[ug]id */ extern void env_home(); /* Only for tests */ +extern void my_exit(); - -public void main(argc, argv, envp) +public int main(argc, argv, envp) int argc; char **argv; char **envp; @@ -178,6 +187,7 @@ process(); /* Process mail */ my_exit(EX_OK); /* We did it */ + return 0; /* Shut up compielr warnings */ } private int set_real_uid(ruid) Modified: trunk/mailagent/agent/filter/misc.c =================================================================== --- trunk/mailagent/agent/filter/misc.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/misc.c 2008-05-28 09:27:26 UTC (rev 8) @@ -38,11 +38,33 @@ #include "config.h" #include "portable.h" + +#include <stdio.h> + +#ifdef I_MALLOC +#include <malloc.h> +#else +extern char *malloc(); +#endif + +#ifdef I_STRING +#include <string.h> +#else +#include <strings.h> +#endif + +#ifdef I_STDLIB +#include <stdlib.h> +#endif + #include <ctype.h> + #include "sysexits.h" +#include "msg.h" +#include "logfile.h" #include "confmagic.h" -extern char *malloc(); /* Memory allocation */ +extern void my_exit(); public char *strsave(string) char *string; Modified: trunk/mailagent/agent/filter/msg.c =================================================================== --- trunk/mailagent/agent/filter/msg.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/msg.c 2008-05-28 09:27:26 UTC (rev 8) @@ -57,7 +57,7 @@ #define MAX_STRING 1024 /* Maximum length for error string */ -extern Pid_t progpid; /* Program PID */ +extern void my_exit(); /* VARARGS2 */ public void say(msg, arg1, arg2, arg3, arg4, arg5) Modified: trunk/mailagent/agent/filter/parser.c =================================================================== --- trunk/mailagent/agent/filter/parser.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/filter/parser.c 2008-05-28 09:27:26 UTC (rev 8) @@ -434,7 +434,7 @@ } else *parent = '\0'; /* Null string */ strcat(parent, file); /* Append file to get an absolute path */ - if (c = rindex(parent, '/')) + if ((c = rindex(parent, '/'))) *c = '\0'; /* Strip down last path component */ add_log(17, "checking directory %s", parent); @@ -551,7 +551,7 @@ char buffer[MAX_STRING]; char *namestr; /* String in H table */ - char *val; /* Returned value */ + char *val = dflt; /* Returned value */ namestr = ht_value(&symtab, name); if (namestr == (char *) 0) { @@ -561,7 +561,6 @@ fatal(buffer); /* NOTREACHED */ case CF_DEFAULT: /* May use default if variable not defined */ - val = dflt; break; default: fatal("BUG: get_confval"); @@ -602,7 +601,7 @@ char *ptr = buffer; /* To iterate over the buffer */ strcpy(buffer, value); /* Make a copy of original line */ - while (*value++ = *ptr) /* Line is updated in-place */ + while ((*value++ = *ptr)) { /* Line is updated in-place */ switch(*ptr++) { case '~': /* Replace by home directory */ add_home(&value); @@ -611,6 +610,7 @@ add_variable(&value, &ptr); break; } + } } private void add_home(to) @@ -631,7 +631,7 @@ if (symbol != (char *) 0) /* Yes, we did */ ptr = symbol; /* Use it for ~ substitution */ - while (*value++ = *ptr++) /* Copy string */ + while ((*value++ = *ptr++)) /* Copy string */ ; *to = value - 1; /* Update position in substituted string */ @@ -650,7 +650,7 @@ char *dol_value; /* $value of variable */ /* Get variable's name */ - while (*name++ = *ptr) { + while ((*name++ = *ptr)) { if (isalnum(*ptr) || *ptr == '_') ptr++; else @@ -666,7 +666,7 @@ return; /* Do the variable substitution */ - while (*value++ = *dol_value++) + while ((*value++ = *dol_value++)) ; *to = value - 1; /* Update pointer to substituted text */ @@ -694,7 +694,7 @@ if (*path == '\0') /* A line full of spaces */ return; /* Ignore it */ - while (*nptr++ = *path) { /* Copy everything until non alphanum */ + while ((*nptr++ = *path)) { /* Copy everything until non alphanum */ if (*path == '_') { /* Valid variable character, although not 'isalnum' */ path++; @@ -732,7 +732,7 @@ char *first = (char *) 0; /* First space in sequence */ char c; /* Character at current position */ - while (c = *line++) { + while ((c = *line++)) { if (isspace(c) && first != (char *) 0) continue; if (c == '#') { /* This has to be a comment */ @@ -823,7 +823,7 @@ if (host == (char *) 0) return (char *) 0; - while (c = *host) { /* Lower-case name */ + while ((c = *host)) { /* Lower-case name */ if (isupper(c)) *ptr = tolower(c); else { Modified: trunk/mailagent/agent/pl/utmp/utmp_ph.c =================================================================== --- trunk/mailagent/agent/pl/utmp/utmp_ph.c 2008-05-28 09:25:49 UTC (rev 7) +++ trunk/mailagent/agent/pl/utmp/utmp_ph.c 2008-05-28 09:27:26 UTC (rev 8) @@ -40,6 +40,8 @@ #define MAX_LEN 1024 /* Maximum length for strings */ #define PADSTR "..pad.. " /* Pad string, for comment */ +#include <stdio.h> + #ifdef I_SYS_TYPES #include <sys/types.h> #endif @@ -50,6 +52,10 @@ #include <strings.h> #endif +#ifdef I_STDLIB +#include <stdlib.h> +#endif + #include <utmp.h> #include "confmagic.h" @@ -70,7 +76,7 @@ strcat(fields, "'line', "); \ last_off += line_len; -main() +int main() { struct utmp *utmp = (struct utmp *) 0; char comment[MAX_LEN]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |