home *** CD-ROM | disk | FTP | other *** search
- From: Raphael Manfredi <ram@acri.fr>
- Newsgroups: comp.sources.misc
- Subject: v43i127: mailagent - Flexible mail filtering and processing package, v3.0, Patch10
- Date: 24 Jul 1994 19:41:26 -0500
- Organization: Advanced Computer Research Institute, Lyon, France
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <30v1nm$i4p@sparky.sterling.com>
- X-Md4-Signature: 8d110af6ec215184b4f7f975884744f1
-
- Submitted-by: Raphael Manfredi <ram@acri.fr>
- Posting-number: Volume 43, Issue 127
- Archive-name: mailagent/patch10
- Environment: UNIX, Perl
- Patch-To: mailagent: Volume 41, Issue 1-26
-
- [The latest patch for mailagent version 3.0 is #11.]
-
- System: mailagent version 3.0
- Patch #: 10
- Priority: LOW
- Subject: patch #8, continued
- Date: Fri Jul 01 17:27:46 MET DST 1994
- From: Raphael Manfredi <ram@acri.fr>
-
- Description:
- See patch #8.
-
-
- Fix: From rn, say "| patch -p -N -d DIR", where DIR is your mailagent source
- directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle".
- If you don't have the patch program, apply the following by hand,
- or get patch (version 2.0, latest patchlevel).
-
- After patching:
- *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #11 FIRST ***
-
- If patch indicates that patchlevel is the wrong version, you may need
- to apply one or more previous patches, or the patch may already
- have been applied. See the patchlevel.h file to find out what has or
- has not been applied. In any event, don't continue with the patch.
-
- If you are missing previous patches they can be obtained from me:
-
- Raphael Manfredi <ram@acri.fr>
-
- If you send a mail message of the following form it will greatly speed
- processing:
-
- Subject: Command
- @SH mailpatch PATH mailagent 3.0 LIST
- ^ note the c
-
- where PATH is a return path FROM ME TO YOU either in Internet notation,
- or in bang notation from some well-known host, and LIST is the number
- of one or more patches you need, separated by spaces, commas, and/or
- hyphens. Saying 35- says everything from 35 to the end.
-
- To get some more detailed instructions, send me the following mail:
-
- Subject: Command
- @SH mailhelp PATH
-
-
- Index: patchlevel.h
- Prereq: 9
- 4c4
- < #define PATCHLEVEL 9
- ---
- > #define PATCHLEVEL 10
-
- Index: agent/files/mailagent.cf
- Prereq: 3.0.1.1
- *** agent/files/mailagent.cf.old Fri Jul 1 17:16:02 1994
- --- agent/files/mailagent.cf Fri Jul 1 17:16:02 1994
- ***************
- *** 2,8 ****
- # Configuration file for mailagent
- #
-
- ! # $Id: mailagent.cf,v 3.0.1.1 1994/04/25 15:11:03 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 2,8 ----
- # Configuration file for mailagent
- #
-
- ! # $Id: mailagent.cf,v 3.0.1.2 1994/07/01 14:51:36 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 13,18 ****
- --- 13,21 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: mailagent.cf,v $
- + # Revision 3.0.1.2 1994/07/01 14:51:36 ram
- + # patch8: eleven new config variables for better tuning
- + #
- # Revision 3.0.1.1 1994/04/25 15:11:03 ram
- # patch7: added new 'fromesc' config variable for From line escapes
- #
- ***************
- *** 61,66 ****
- --- 64,70 ----
- #
-
- # Define main configuration parameters
- + umask : 077 # Default umask
- spool : ~/var/mailagent # Spool directory
- queue : $spool/queue # Queue directory (must exist)
- logdir : ~/var/log # Where logfile is stored
- ***************
- *** 80,94 ****
- --- 84,112 ----
- mmdf : OFF # Allow MMDF-style mailbox delivery
- mmdfbox : OFF # Force new folders to MMDF format
- fromesc : ON # Escape leading From into >From
- + fromall : OFF # Escape all From, even within paragraph
-
- # MH-style folders
- mhprofile: ~/.mh_profile # Name of the MH profile file (optional)
- msgprefix: .msg_prefix # File containing message name prefix
-
- + # Locking parameters
- + lockmax : 20 # Maximum number of locking attempts
- + lockdelay: 2 # Amount of seconds between two lock attempts
- + lockhold : 3600 # Amount of seconds before breaking lock
- +
- + # Timeout parameters
- + queuewait: 60 # Delay for filter before calling mailagent
- + queuehold: 1800 # Amount of seconds queued mail remains skipped
- + queuelost: 86400 # Timeout before flagging old queued mail
- + runmax : 3600 # Timeout for RUN command and friends
- +
- # Optional parameters (for experts...)
- #compress : ~/.compress # Folder compression list
- #newcmd : $spool/newcmd # Definition of new filtering commands
- #perlib : pl # Extended perl library search path
- + #tome : also-me # Alternate logins for me
- + #rulemac : ON # Macro substitution in rule patterns
-
- # Database hashing directory (in $spool) and other controls
- hash : dbr # Hashing directory
-
- Index: agent/pl/listqueue.pl
- Prereq: 3.0
- *** agent/pl/listqueue.pl.old Fri Jul 1 17:16:19 1994
- --- agent/pl/listqueue.pl Fri Jul 1 17:16:19 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: listqueue.pl,v 3.0 1993/11/29 13:48:56 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: listqueue.pl,v 3.0.1.1 1994/07/01 15:01:45 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: listqueue.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:01:45 ram
- + ;# patch8: now honours new queuehold and queuelost config variables
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:56 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 112,121 ****
- # is an emergency saving done by the filter.
- $file =~ s/^mbox\.// && ($status = 'Backup');
- $file =~ s/^$cf'user\.// && ($status = 'Backup');
- ! if ($file =~ /^qm/ && (time - $mtime) < 1800) {
- # Queue mails starting with 'qm' have been queued by the filter
- # program. To avoid race conditions, those mails are skipped for
- ! # half an hour (cf to pqueue subroutine).
- $status = 'Skipped' unless $status; # Filter queued mail
- } else {
- # Processing of mail allowed (mailagent -q would flush it)
- --- 115,124 ----
- # is an emergency saving done by the filter.
- $file =~ s/^mbox\.// && ($status = 'Backup');
- $file =~ s/^$cf'user\.// && ($status = 'Backup');
- ! if ($file =~ /^qm/ && (time - $mtime) < $cf'queuehold) {
- # Queue mails starting with 'qm' have been queued by the filter
- # program. To avoid race conditions, those mails are skipped for
- ! # some time (cf to pqueue subroutine).
- $status = 'Skipped' unless $status; # Filter queued mail
- } else {
- # Processing of mail allowed (mailagent -q would flush it)
- ***************
- *** 127,133 ****
- $queued = 'Now' if (time - $mtime) < 60;
- $star = '';
- $star = '*' if $directory ne $cf'queue; # Spot out-of-queue mails
- ! if ((time - $mtime) > 86400) { # Also spot old mails
- $star = '#';
- $star = '@' if $directory ne $cf'queue;
- }
- --- 130,136 ----
- $queued = 'Now' if (time - $mtime) < 60;
- $star = '';
- $star = '*' if $directory ne $cf'queue; # Spot out-of-queue mails
- ! if ((time - $mtime) > $cf'queuelost) { # Also spot old mails
- $star = '#';
- $star = '@' if $directory ne $cf'queue;
- }
-
- Index: agent/test/pl/cmd.pl
- Prereq: 3.0
- *** agent/test/pl/cmd.pl.old Fri Jul 1 17:16:29 1994
- --- agent/test/pl/cmd.pl Fri Jul 1 17:16:29 1994
- ***************
- *** 1,37 ****
- # Common actions at the top of each command test
-
- ! # $Id: cmd.pl,v 3.0 1993/11/29 13:50:22 ram Exp $
- ! #
- ! # Copyright (c) 1990-1993, 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: cmd.pl,v $
- ;# Revision 3.0 1993/11/29 13:50:22 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
-
- ! do '../pl//init.pl';
- chdir '../out';
- do '../pl/mail.pl';
- ! &cp_mail;
- $user = $ENV{'USER'};
- unlink "$user", 'agentlog', 'send.mail', 'send.news';
- $cmd = "$mailagent -L $ENV{'LEVEL'} -r ../actions mail 2>/dev/null";
-
- # We might need this
- do '../pl/logfile.pl';
- -
- - sub cp_mail {
- - local($_);
- - open(MAIL, '../mail');
- - open(HERE, '>mail');
- - print HERE while <MAIL>;
- - close MAIL;
- - close HERE;
- - }
-
- --- 1,31 ----
- # Common actions at the top of each command test
-
- ! ;# $Id: cmd.pl,v 3.0.1.1 1994/07/01 15:09:44 ram Exp $
- ! ;#
- ! ;# Copyright (c) 1990-1993, 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: cmd.pl,v $
- ! ;# Revision 3.0.1.1 1994/07/01 15:09:44 ram
- ! ;# patch8: the cp_mail routine is now located in mail.pl
- ! ;#
- ;# Revision 3.0 1993/11/29 13:50:22 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
-
- ! do '../pl/init.pl';
- chdir '../out';
- do '../pl/mail.pl';
- ! &cp_mail; # From mail.pl
- $user = $ENV{'USER'};
- unlink "$user", 'agentlog', 'send.mail', 'send.news';
- $cmd = "$mailagent -L $ENV{'LEVEL'} -r ../actions mail 2>/dev/null";
-
- # We might need this
- do '../pl/logfile.pl';
-
-
- Index: agent/test/cmd/perl.t
- Prereq: 3.0
- *** agent/test/cmd/perl.t.old Fri Jul 1 17:16:26 1994
- --- agent/test/cmd/perl.t Fri Jul 1 17:16:27 1994
- ***************
- *** 1,6 ****
- # Test PERL command
-
- ! # $Id: perl.t,v 3.0 1993/11/29 13:49:38 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 1,6 ----
- # Test PERL command
-
- ! # $Id: perl.t,v 3.0.1.1 1994/07/01 15:08:05 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 11,22 ****
- # of the source tree for mailagent 3.0.
- #
- # $Log: perl.t,v $
- # Revision 3.0 1993/11/29 13:49:38 ram
- # Baseline for mailagent 3.0 netwide release.
- #
-
- do '../pl/cmd.pl';
- ! unlink 'perl.1', 'perl.2', 'never', 'always';
-
- open(PERL, ">perl.1") || print "1\n";
- print PERL <<'EOP';
- --- 11,25 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: perl.t,v $
- + # Revision 3.0.1.1 1994/07/01 15:08:05 ram
- + # patch8: added test for correct exit status propagation
- + #
- # Revision 3.0 1993/11/29 13:49:38 ram
- # Baseline for mailagent 3.0 netwide release.
- #
-
- do '../pl/cmd.pl';
- ! unlink 'perl.1', 'perl.2', 'never', 'always', 'exit_ok';
-
- open(PERL, ">perl.1") || print "1\n";
- print PERL <<'EOP';
- ***************
- *** 29,35 ****
- open(PERL, ">perl.2") || print "2\n";
- print PERL <<'EOP';
- unlink 'always' if -d '../out';
- ! &exit(0) if $ARGV[1] != 'arg 1' || $ARGV[2] != 'arg 2';
- &perl('perl.1'); # Recursion
- &save('never');
- EOP
- --- 32,38 ----
- open(PERL, ">perl.2") || print "2\n";
- print PERL <<'EOP';
- unlink 'always' if -d '../out';
- ! &exit(1) if $ARGV[1] ne 'arg 1' || $ARGV[2] ne 'arg 2';
- &perl('perl.1'); # Recursion
- &save('never');
- EOP
- ***************
- *** 42,47 ****
- -f 'never' && print "5\n";
- &get_log(6, 'always');
- &check_log('^To: ram', 7) == 2 || print "8\n";
-
- ! unlink 'mail', 'perl.1', 'perl.2', 'never', 'always';
- print "0\n";
- --- 45,51 ----
- -f 'never' && print "5\n";
- &get_log(6, 'always');
- &check_log('^To: ram', 7) == 2 || print "8\n";
- + -f 'exit_ok' || print "9\n";
-
- ! unlink 'mail', 'perl.1', 'perl.2', 'never', 'always', 'exit_ok';
- print "0\n";
-
- Index: agent/test/cmd/umask.t
- *** agent/test/cmd/umask.t.old Fri Jul 1 17:16:27 1994
- --- agent/test/cmd/umask.t Fri Jul 1 17:16:27 1994
- ***************
- *** 0 ****
- --- 1,64 ----
- + # Test UMASK command
- +
- + # $Id: umask.t,v 3.0.1.1 1994/07/01 15:08:10 ram Exp $
- + #
- + # Copyright (c) 1990-1993, 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: umask.t,v $
- + # Revision 3.0.1.1 1994/07/01 15:08:10 ram
- + # patch8: created
- + #
- +
- + do '../pl/misc.pl'; # Uses &add_option
- +
- + sub cleanup {
- + unlink $user, 'ok.1', 'ok.2', 'ok.3', 'never';
- + }
- +
- + open(PERL, ">umask_is") || print "1\n";
- + print PERL <<'EOP';
- + $mode = $ARGV[1];
- + $mode = oct($mode) if $mode =~ /^0/;
- + $umask = umask;
- + &exit($mode == $umask ? 0 : 1);
- + EOP
- + close PERL;
- +
- + &add_header('X-Tag: umask #1');
- + `$cmd`;
- + $? == 0 || print "2\n";
- + -f $user && print "3\n";
- + -f 'never' && print "4\n";
- + -f 'ok.1' || print "5\n";
- + -f 'ok.2' || print "6\n";
- +
- + &cleanup;
- + &replace_header('X-Tag: umask #3');
- + system '(cat mail; echo " "; cat mail) > mail2 && mv mail2 mail';
- + print "7\n" if $?;
- + $cmd =~ s/\bmail\b/-f mail/;
- + &add_option("-o 'umask: 027'");
- + &replace_header('X-Tag: umask #2');
- +
- + # At this point, we're going to process two messages in mail. The first
- + # one is tagged 'umask #2' and the second is tagged 'umask #3'. We wish
- + # to make sure that mailagent restores the default umask before processing
- + # a new message.
- +
- + `$cmd`;
- + $? == 0 || print "8\n";
- + -f $user && print "9\n";
- + -f 'never' && print "10\n";
- + -f 'ok.1' || print "11\n";
- + -f 'ok.2' || print "12\n";
- + -f 'ok.3' || print "13\n";
- +
- + &cleanup;
- + unlink 'umask_is';
- + print "0\n";
-
- Index: agent/pl/makedir.pl
- Prereq: 3.0
- *** agent/pl/makedir.pl.old Fri Jul 1 17:16:19 1994
- --- agent/pl/makedir.pl Fri Jul 1 17:16:19 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: makedir.pl,v 3.0 1993/11/29 13:48:59 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: makedir.pl,v 3.0.1.1 1994/07/01 15:02:07 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,26 ****
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: makedir.pl,v $
- ;# Revision 3.0 1993/11/29 13:48:59 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ;#
- # Make directories for files
- ! # E.g, for /usr/lib/perl/foo, it will check for all the
- ! # directories /usr, /usr/lib, /usr/lib/perl and make
- ! # them if they do not exist.
- sub makedir {
- local($dir, $mode) = @_; # directory name, mode (optional)
- local($parent);
- ! $mode = 0700 unless defined $mode;
- if (!-d $dir && $dir ne '') {
- # Make parent dir first
- &makedir($parent, $mode) if ($parent = $dir) =~ s|(.*)/.*|\1|;
- --- 9,30 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: makedir.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:02:07 ram
- + ;# patch8: default mode is now 0777, relies on umask for proper setting
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:59 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ;#
- # Make directories for files
- ! # E.g, for /usr/lib/perl/foo, it will check for all the directories /usr,
- ! # /usr/lib, /usr/lib/perl and make them if they do not exist.
- ! # Note: default mode is now 0777 since we have an umask config parameter.
- sub makedir {
- local($dir, $mode) = @_; # directory name, mode (optional)
- local($parent);
- ! $mode = 0777 unless defined $mode;
- ! $dir =~ s|/$||; # no trailing / or we'll try to make dir twice
- if (!-d $dir && $dir ne '') {
- # Make parent dir first
- &makedir($parent, $mode) if ($parent = $dir) =~ s|(.*)/.*|\1|;
-
- Index: agent/pl/runcmd.pl
- Prereq: 3.0
- *** agent/pl/runcmd.pl.old Fri Jul 1 17:16:23 1994
- --- agent/pl/runcmd.pl Fri Jul 1 17:16:23 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: runcmd.pl,v 3.0 1993/11/29 13:49:15 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: runcmd.pl,v 3.0.1.1 1994/07/01 15:04:58 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: runcmd.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:04:58 ram
- + ;# patch8: new UMASK command
- + ;#
- ;# Revision 3.0 1993/11/29 13:49:15 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 57,62 ****
- --- 60,66 ----
- ;# STRIP header(s) Removes the lines from the message's header
- ;# SUBST var // Apply a substitution on variable
- ;# TR var // Apply a translation on variable
- + ;# UMASK value Set a new umask for the process
- ;# UNIQUE Delete message if already in history and REJECT
- ;# VACATION on/off Allow/disallow vacation messages
- ;# WRITE folder Writes mail in folder (replaces, does not append)
- ***************
- *** 199,204 ****
- --- 203,209 ----
- 'STRIP', 'run_strip', # Strip some header lines
- 'SUBST', 'run_subst', # Substitution on variable
- 'TR', 'run_tr', # Translation on variable
- + 'UMASK', 'run_umask', # Set new umask
- 'UNIQUE', 'run_unique', # Delete message if already in history
- 'VACATION', 'run_vacation', # Allow or forbid vacation messages
- 'WRITE', 'run_write', # Write mail in folder
- ***************
- *** 231,236 ****
- --- 236,242 ----
- 'RESTART', 1,
- 'RESYNC', 1,
- 'STRIP', 1,
- + 'UMASK', 1,
- 'VACATION', 1,
- );
- }
-
- Index: agent/pl/parse.pl
- Prereq: 3.0.1.1
- *** agent/pl/parse.pl.old Fri Jul 1 17:16:21 1994
- --- agent/pl/parse.pl Fri Jul 1 17:16:21 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: parse.pl,v 3.0.1.1 1994/04/25 15:18:14 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: parse.pl,v 3.0.1.2 1994/07/01 15:04:02 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: parse.pl,v $
- + ;# Revision 3.0.1.2 1994/07/01 15:04:02 ram
- + ;# patch8: now systematically escape leading From if fromall is ON
- + ;#
- ;# Revision 3.0.1.1 1994/04/25 15:18:14 ram
- ;# patch7: global fix for From line escapes to make them configurable
- ;#
- ***************
- *** 93,100 ****
- $lines++; # One more line in body
- $length += length($_); # Update length of message
- # Protect potentially dangerous lines when asked to do so
- s/^From(\s)/>From$1/ if $last_was_nl && $cf'fromesc =~ /on/i;
- ! $last_was_nl = /^$/; # Keep track of single '\n'
- $Header{'Body'} .= $_;
- chop;
- # Deal with builtin commands
- --- 96,106 ----
- $lines++; # One more line in body
- $length += length($_); # Update length of message
- # Protect potentially dangerous lines when asked to do so
- + # From could normally be mis-interpreted only after a blank line,
- + # but some "broken" User Agents also look for them everywhere...
- + # That's where fromall must be set to ON to escape all of them.
- s/^From(\s)/>From$1/ if $last_was_nl && $cf'fromesc =~ /on/i;
- ! $last_was_nl = /^$/ || $cf'fromall =~ /on/i;
- $Header{'Body'} .= $_;
- chop;
- # Deal with builtin commands
-
- Index: agent/pl/checklock.pl
- Prereq: 3.0
- *** agent/pl/checklock.pl.old Fri Jul 1 17:16:16 1994
- --- agent/pl/checklock.pl Fri Jul 1 17:16:16 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: checklock.pl,v 3.0 1993/11/29 13:48:36 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: checklock.pl,v 3.0.1.1 1994/07/01 15:00:20 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: checklock.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:00:20 ram
- + ;# patch8: now honours new lockhold config variable for lock breaking
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:36 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 23,33 ****
- # There is a lock file -- look for how long it's been there
- ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat($lockfile);
- ! if ((time - $mtime) > 3600) {
- ! # More than one hour !! Something must have gone wrong
- unlink $lockfile;
- $file =~ s|.*/(.*)|$1|; # Keep only basename
- ! &add_log("UNLOCKED $file (lock older than one hour)")
- if $loglvl > 5;
- }
- }
- --- 26,36 ----
- # There is a lock file -- look for how long it's been there
- ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat($lockfile);
- ! if ((time - $mtime) > $cf'lockhold) {
- ! # More than outdating time!! Something must have gone wrong
- unlink $lockfile;
- $file =~ s|.*/(.*)|$1|; # Keep only basename
- ! &add_log("UNLOCKED $file (lock older than $cf'lockhold seconds)")
- if $loglvl > 5;
- }
- }
-
- Index: agent/test/pl/init.pl
- Prereq: 3.0
- *** agent/test/pl/init.pl.old Fri Jul 1 17:16:30 1994
- --- agent/test/pl/init.pl Fri Jul 1 17:16:30 1994
- ***************
- *** 1,16 ****
- # Set up mailagent and filter paths
-
- ! # $Id: init.pl,v 3.0 1993/11/29 13:50:24 ram Exp $
- ! #
- ! # Copyright (c) 1990-1993, 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: init.pl,v $
- ;# Revision 3.0 1993/11/29 13:50:24 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- --- 1,19 ----
- # Set up mailagent and filter paths
-
- ! ;# $Id: init.pl,v 3.0.1.1 1994/07/01 15:10:38 ram Exp $
- ! ;#
- ! ;# Copyright (c) 1990-1993, 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: init.pl,v $
- ! ;# Revision 3.0.1.1 1994/07/01 15:10:38 ram
- ! ;# patch8: fixed RCS leading comment string
- ! ;#
- ;# Revision 3.0 1993/11/29 13:50:24 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 24,26 ****
- --- 27,30 ----
-
- # Make sure no lock were left by previous test
- unlink "$pwd/out/filter.lock", "$pwd/out/perl.lock";
- +
-
- Index: agent/pl/matching.pl
- Prereq: 3.0.1.1
- *** agent/pl/matching.pl.old Fri Jul 1 17:16:20 1994
- --- agent/pl/matching.pl Fri Jul 1 17:16:20 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: matching.pl,v 3.0.1.1 1994/04/25 15:17:49 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: matching.pl,v 3.0.1.2 1994/07/01 15:02:33 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: matching.pl,v $
- + ;# Revision 3.0.1.2 1994/07/01 15:02:33 ram
- + ;# patch8: allow macro substitution on patterns if rulemac is ON
- + ;#
- ;# Revision 3.0.1.1 1994/04/25 15:17:49 ram
- ;# patch7: fixed selector combination logic and added some debug logs
- ;#
- ***************
- *** 213,218 ****
- --- 216,223 ----
-
- # Attempt a match of a pattern against a selector, return boolean status.
- # If pattern is preceded by a '!', the boolean status is negated.
- + # If the 'rulemac' configuration variable is set to ON, a macro substitution
- + # is performed on the search pattern.
- sub selector_match {
- local($selector) = shift(@_); # The selector on which pattern applies
- local($pattern) = shift(@_); # The pattern to apply
- ***************
- *** 224,229 ****
- --- 229,235 ----
- $matcher = $Matcher{$selector};
- $matcher = 'match_var' unless $matcher;
- $pattern =~ s/^!// && ($not = '!');
- + ¯os_subst(*pattern) if $cf'rulemac =~ /on/i; # Macro substitution
- $matched = &$matcher($selector, $pattern, $range);
- $matched = !$matched if $not; # Revert matching status if ! pattern
- if ($loglvl > 19) {
-
- Index: agent/test/cmd/leave.t
- Prereq: 3.0
- *** agent/test/cmd/leave.t.old Fri Jul 1 17:16:25 1994
- --- agent/test/cmd/leave.t Fri Jul 1 17:16:25 1994
- ***************
- *** 1,6 ****
- # Test LEAVE command
-
- ! # $Id: leave.t,v 3.0 1993/11/29 13:49:33 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 1,6 ----
- # Test LEAVE command
-
- ! # $Id: leave.t,v 3.0.1.1 1994/07/01 15:07:21 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 11,21 ****
- # of the source tree for mailagent 3.0.
- #
- # $Log: leave.t,v $
- # Revision 3.0 1993/11/29 13:49:33 ram
- # Baseline for mailagent 3.0 netwide release.
- #
-
- ! do '../pl/cmd.pl';
-
- &add_header('X-Tag: leave');
- `$cmd`;
- --- 11,24 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: leave.t,v $
- + # Revision 3.0.1.1 1994/07/01 15:07:21 ram
- + # patch8: added tests for new fromall config option
- + #
- # Revision 3.0 1993/11/29 13:49:33 ram
- # Baseline for mailagent 3.0 netwide release.
- #
-
- ! do '../pl/misc.pl'; # Need &add_option also
-
- &add_header('X-Tag: leave');
- `$cmd`;
- ***************
- *** 54,59 ****
- --- 57,72 ----
- &get_log(11, $user);
- &check_log('^>From', 12) == 2 || print "13\n";
- &check_log('^From line', 14) == 1 || print "15\n";
- +
- + # Make sure all From lines are escaped when fromall is activated.
- + &add_option('-o fromall:ON');
- + unlink "$user";
- + `$cmd`;
- + $? == 0 || print "16\n";
- + -f "$user" || print "17\n";
- + &get_log(18, $user);
- + &check_log('^>From', 19) == 3 || print "20\n";
- + ¬_log('^From line', 21);
-
- unlink <emerg/*>;
- unlink "$user", 'mail', 'ok';
-
- Index: agent/test/pl/logfile.pl
- Prereq: 3.0
- *** agent/test/pl/logfile.pl.old Fri Jul 1 17:16:31 1994
- --- agent/test/pl/logfile.pl Fri Jul 1 17:16:31 1994
- ***************
- *** 1,16 ****
- # Get log file (by default) or any other file into @log
-
- ! # $Id: logfile.pl,v 3.0 1993/11/29 13:50:24 ram Exp $
- ! #
- ! # Copyright (c) 1990-1993, 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: logfile.pl,v $
- ;# Revision 3.0 1993/11/29 13:50:24 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- --- 1,19 ----
- # Get log file (by default) or any other file into @log
-
- ! ;# $Id: logfile.pl,v 3.0.1.1 1994/07/01 15:10:42 ram Exp $
- ! ;#
- ! ;# Copyright (c) 1990-1993, 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: logfile.pl,v $
- ! ;# Revision 3.0.1.1 1994/07/01 15:10:42 ram
- ! ;# patch8: fixed RCS leading comment string
- ! ;#
- ;# Revision 3.0 1993/11/29 13:50:24 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
-
- Index: agent/pl/read_conf.pl
- Prereq: 3.0.1.1
- *** agent/pl/read_conf.pl.old Fri Jul 1 17:16:22 1994
- --- agent/pl/read_conf.pl Fri Jul 1 17:16:22 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: read_conf.pl,v 3.0.1.1 1994/04/25 15:21:34 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: read_conf.pl,v 3.0.1.2 1994/07/01 15:04:50 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: read_conf.pl,v $
- + ;# Revision 3.0.1.2 1994/07/01 15:04:50 ram
- + ;# patch8: set proper default values for new optional config variables
- + ;#
- ;# Revision 3.0.1.1 1994/04/25 15:21:34 ram
- ;# patch7: made sure new variable 'fromesc' has a meaningful default
- ;#
- ***************
- *** 110,115 ****
- --- 113,128 ----
-
- # Backward compatibility -- RAM, 25/04/94
- $fromesc = 'ON' unless defined $fromesc; # If absent from ~/.mailagent
- + $lockmax = 20 unless defined $lockmax;
- + $lockdelay = 2 unless defined $lockdelay;
- + $lockhold = 3600 unless defined $lockhold;
- + $queuewait = 60 unless defined $queuewait;
- + $queuehold = 1800 unless defined $queuehold;
- + $queuelost = 86400 unless defined $queuelost;
- + $runmax = 3600 unless defined $runmax;
- + $umask = 077 unless defined $umask;
- +
- + $umask = oct($umask) if $umask =~ /^0/; # Translate umask into decimal
-
- # Update @INC perlib search path with the perlib variable. Paths not
- # starting by a '/' are supposed to be under the mailagent private lib
-
- Index: MANIFEST
- *** MANIFEST.old Fri Jul 1 17:16:34 1994
- --- MANIFEST Fri Jul 1 17:16:34 1994
- ***************
- *** 148,153 ****
- --- 148,154 ----
- agent/pl/sendfile.pl Perl library to send files in shar / kit mode
- agent/pl/stats.pl Mailagent's statistics recording and printing
- agent/pl/tilde.pl Perl library to perform ~name expansion
- + agent/pl/umask.pl Handles UMASK in local mode
- agent/pl/unpack.pl Perl library to unpack archive files
- agent/pl/usrmac.pl User-defined macros
- agent/test/ Regression test suite
- ***************
- *** 200,205 ****
- --- 201,207 ----
- agent/test/cmd/strip.t Test STRIP command
- agent/test/cmd/subst.t Test SUBST command
- agent/test/cmd/tr.t Test TR command
- + agent/test/cmd/umask.t Test UMASK command
- agent/test/cmd/unique.t Test UNIQUE command
- agent/test/cmd/unknown.t Make sure unknown command defaults correctly
- agent/test/cmd/vacation.t Test VACATION command
- ***************
- *** 213,218 ****
- --- 215,221 ----
- agent/test/filter/hook.t Ensure hooks are correctly invoked
- agent/test/filter/list.t Check matching on lists like To and Newsgroups
- agent/test/filter/loop.t Check loop detection
- + agent/test/filter/macros.t Check optional macro subsitution in patterns
- agent/test/filter/mode.t Make sure mode selection logic works
- agent/test/filter/multiple.t Check multiple selectors
- agent/test/filter/not.t Negated pattern tests
-
- Index: agent/test/pl/misc.pl
- Prereq: 3.0
- *** agent/test/pl/misc.pl.old Fri Jul 1 17:16:32 1994
- --- agent/test/pl/misc.pl Fri Jul 1 17:16:32 1994
- ***************
- *** 1,16 ****
- # Common actions at the top of each misc test
-
- ! # $Id: misc.pl,v 3.0 1993/11/29 13:50:26 ram Exp $
- ! #
- ! # Copyright (c) 1990-1993, 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: misc.pl,v $
- ;# Revision 3.0 1993/11/29 13:50:26 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- --- 1,19 ----
- # Common actions at the top of each misc test
-
- ! ;# $Id: misc.pl,v 3.0.1.1 1994/07/01 15:11:55 ram Exp $
- ! ;#
- ! ;# Copyright (c) 1990-1993, 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: misc.pl,v $
- ! ;# Revision 3.0.1.1 1994/07/01 15:11:55 ram
- ! ;# patch8: fixed RCS leading comment string
- ! ;#
- ;# Revision 3.0 1993/11/29 13:50:26 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
-
- Index: agent/pl/acs_rqst.pl
- Prereq: 3.0
- *** agent/pl/acs_rqst.pl.old Fri Jul 1 17:16:11 1994
- --- agent/pl/acs_rqst.pl Fri Jul 1 17:16:11 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: acs_rqst.pl,v 3.0 1993/11/29 13:48:32 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: acs_rqst.pl,v 3.0.1.1 1994/07/01 14:56:37 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: acs_rqst.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 14:56:37 ram
- + ;# patch8: now uses lockmax and lockdelay config variables
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:32 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 41,48 ****
- # process is written. It is checked afterwards.
- sub acs_rqst {
- local($file) = @_; # file to be locked
- ! local($max) = 30; # max number of attempts
- ! local($delay) = 2; # seconds to wait between attempts
- local($mask); # to save old umask
- local($stamp); # string written in lock file
- &checklock($file); # avoid long-lasting locks
- --- 44,51 ----
- # process is written. It is checked afterwards.
- sub acs_rqst {
- local($file) = @_; # file to be locked
- ! local($max) = $cf'lockmax; # max number of attempts
- ! local($delay) = $cf'lockdelay; # seconds to wait between attempts
- local($mask); # to save old umask
- local($stamp); # string written in lock file
- &checklock($file); # avoid long-lasting locks
-
- Index: agent/pl/umask.pl
- *** agent/pl/umask.pl.old Fri Jul 1 17:16:23 1994
- --- agent/pl/umask.pl Fri Jul 1 17:16:23 1994
- ***************
- *** 0 ****
- --- 1,42 ----
- + ;# $Id: umask.pl,v 3.0.1.1 1994/07/01 15:05:10 ram Exp $
- + ;#
- + ;# Copyright (c) 1990-1993, 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: umask.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:05:10 ram
- + ;# patch8: created
- + ;#
- + ;#
- + package u_mask;
- +
- + # Handles the UMASK command. Since the umask may be set locally in rules,
- + # we must record the previous global setting to be able to restore it when
- + # we leave scope.
- +
- + # Initialize at rule entrance
- + sub init {
- + $umask = -1;
- + }
- +
- + # When leaving a rule, reset the umask if it has been set locally.
- + # If a global setting has been used, then we do not wish to interfere.
- + sub reset {
- + return if $umask == -1; # Umask was not changed locally in rule
- + umask($umask); # Restore previous umask
- + }
- +
- + # Record a local umask settting
- + sub set {
- + local($new) = @_; # New umask wanted
- + $umask = umask($new); # Set new umask, save previous one
- + # Failure of the umask() system call is unlikely.
- + }
- +
- + package main;
- +
-
- Index: agent/magent.SH
- Prereq: 3.0.1.1
- *** agent/magent.SH.old Fri Jul 1 17:16:06 1994
- --- agent/magent.SH Fri Jul 1 17:16:07 1994
- ***************
- *** 24,30 ****
- # via the filter. Mine looks like this:
- # "|exec /users/ram/mail/filter >>/users/ram/.bak 2>&1"
-
- ! # $Id: magent.SH,v 3.0.1.1 1994/01/26 09:27:56 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 24,30 ----
- # via the filter. Mine looks like this:
- # "|exec /users/ram/mail/filter >>/users/ram/.bak 2>&1"
-
- ! # $Id: magent.SH,v 3.0.1.2 1994/07/01 14:54:29 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 35,40 ****
- --- 35,43 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: magent.SH,v $
- + # Revision 3.0.1.2 1994/07/01 14:54:29 ram
- + # patch8: fixed leading From date format (spacing problem)
- + #
- # Revision 3.0.1.1 1994/01/26 09:27:56 ram
- # patch5: new -F option to force procesing on filtered messages
- #
- ***************
- *** 426,431 ****
- --- 429,435 ----
-
- # Faked leading From line (used for digest items, by SPLIT)
- local($now) = &ctime(time);
- + $now =~ s/\s(\d:\d\d:\d\d)\b/0$1/; # Add leading 0 if hour < 10
- chop($now);
- $FAKE_FROM = "From mailagent " . $now;
- }
- ***************
- *** 633,637 ****
- --- 637,642 ----
- $grep -v '^;#' pl/usrmac.pl >>magent
- $grep -v '^;#' pl/tilde.pl >>magent
- $grep -v '^;#' pl/mh.pl >>magent
- + $grep -v '^;#' pl/umask.pl >>magent
- chmod 755 magent
- $eunicefix magent
-
- Index: agent/pl/pqueue.pl
- Prereq: 3.0
- *** agent/pl/pqueue.pl.old Fri Jul 1 17:16:21 1994
- --- agent/pl/pqueue.pl Fri Jul 1 17:16:21 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: pqueue.pl,v 3.0 1993/11/29 13:49:09 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: pqueue.pl,v 3.0.1.1 1994/07/01 15:04:20 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: pqueue.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:04:20 ram
- + ;# patch8: now honours new queuehold config variable
- + ;#
- ;# Revision 3.0 1993/11/29 13:49:09 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 38,45 ****
- foreach $file (@filter_files) {
- ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
- ! if ((time - $mtime) > 1800) {
- ! # More than 30 minutes -- there must have been a failure
- push(@files, $file); # Add file to the to-be-parsed list
- }
- }
- --- 41,48 ----
- foreach $file (@filter_files) {
- ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
- ! if ((time - $mtime) > $cf'queuehold) {
- ! # More than queue timeout -- there must have been a failure
- push(@files, $file); # Add file to the to-be-parsed list
- }
- }
-
- Index: agent/pl/interface.pl
- Prereq: 3.0
- *** agent/pl/interface.pl.old Fri Jul 1 17:16:18 1994
- --- agent/pl/interface.pl Fri Jul 1 17:16:18 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: interface.pl,v 3.0 1993/11/29 13:48:53 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: interface.pl,v 3.0.1.1 1994/07/01 15:01:19 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,18 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: interface.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:01:19 ram
- + ;# patch8: new UMASK command
- + ;# patch8: cannot dataload exit
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:53 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 64,79 ****
- --- 68,87 ----
- sub strip { &interface'dispatch; }
- sub subst { &interface'dispatch; }
- sub tr { &interface'dispatch; }
- + sub umask { &interface'dispatch; }
- sub unique { &interface'dispatch; }
- sub vacation { &interface'dispatch; }
- sub write { &interface'dispatch; }
-
- # A perl filtering script should call &exit and not exit directly.
- + # Perload OFF
- + # (Cannot be data-loaded or it will corrupt $@ expected by &main'perl)
- sub exit {
- local($code) = @_;
- die "OK\n" unless $code;
- die "Exit $code\n";
- }
- + # Perload ON
-
- package interface;
-
-
- Index: agent/filter/parser.h
- Prereq: 3.0
- *** agent/filter/parser.h.old Fri Jul 1 17:16:06 1994
- --- agent/filter/parser.h Fri Jul 1 17:16:06 1994
- ***************
- *** 11,17 ****
- */
-
- /*
- ! * $Id: parser.h,v 3.0 1993/11/29 13:48:19 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- --- 11,17 ----
- */
-
- /*
- ! * $Id: parser.h,v 3.0.1.1 1994/07/01 14:54:06 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- ***************
- *** 22,27 ****
- --- 22,30 ----
- * of the source tree for mailagent 3.0.
- *
- * $Log: parser.h,v $
- + * Revision 3.0.1.1 1994/07/01 14:54:06 ram
- + * patch8: new routine get_confval to get integer config variables
- + *
- * Revision 3.0 1993/11/29 13:48:19 ram
- * Baseline for mailagent 3.0 netwide release.
- *
- ***************
- *** 34,38 ****
- --- 37,50 ----
- extern void read_conf(); /* Read configuration file */
- extern void set_env_vars(); /* Set correct environment variables */
- extern char *homedir(); /* Location of the home directory */
- + extern int get_confval(); /* Get configuration value */
- +
- + /*
- + * Parameters for get_confval().
- + */
- +
- + #define CF_MANDATORY 0 /* Must be there, or fatal error */
- + #define CF_DEFAULT 1 /* Use default value if not there */
-
- #endif
- +
-
- Index: agent/filter/logfile.c
- Prereq: 3.0
- *** agent/filter/logfile.c.old Fri Jul 1 17:16:04 1994
- --- agent/filter/logfile.c Fri Jul 1 17:16:04 1994
- ***************
- *** 11,17 ****
- */
-
- /*
- ! * $Id: logfile.c,v 3.0 1993/11/29 13:48:14 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- --- 11,17 ----
- */
-
- /*
- ! * $Id: logfile.c,v 3.0.1.1 1994/07/01 14:53:21 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- ***************
- *** 22,27 ****
- --- 22,30 ----
- * of the source tree for mailagent 3.0.
- *
- * $Log: logfile.c,v $
- + * Revision 3.0.1.1 1994/07/01 14:53:21 ram
- + * patch8: metaconfig now defines Strerror instead of strerror
- + *
- * Revision 3.0 1993/11/29 13:48:14 ram
- * Baseline for mailagent 3.0 netwide release.
- *
- ***************
- *** 181,187 ****
- sprintf(where, "%s", strerror(errno));
- #else
- #ifdef HAS_SYS_ERRLIST
- ! sprintf(where, "%s", strerror(errno)); /* Macro defined by Configure */
- #else
- sprintf(where, "error #%d", errno);
- #endif
- --- 184,190 ----
- sprintf(where, "%s", strerror(errno));
- #else
- #ifdef HAS_SYS_ERRLIST
- ! sprintf(where, "%s", Strerror(errno)); /* Macro defined by Configure */
- #else
- sprintf(where, "error #%d", errno);
- #endif
-
- Index: agent/test/filter/macros.t
- *** agent/test/filter/macros.t.old Fri Jul 1 17:16:28 1994
- --- agent/test/filter/macros.t Fri Jul 1 17:16:28 1994
- ***************
- *** 0 ****
- --- 1,36 ----
- + # Test patterns with macros in them
- +
- + # $Id: macros.t,v 3.0.1.1 1994/07/01 15:09:17 ram Exp $
- + #
- + # Copyright (c) 1990-1993, 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: macros.t,v $
- + # Revision 3.0.1.1 1994/07/01 15:09:17 ram
- + # patch8: created
- + #
- +
- + do '../pl/filter.pl';
- +
- + &add_header('X-Tag: macros');
- + &replace_header("To: $user@eiffel.com");
- + `$cmd`;
- + $? == 0 || print "1\n";
- + -f "$user" && print "2\n"; # Must have been deleted
- +
- + unlink $user; # Just in case
- +
- + # Now check that macro susbstitution occurs in pattern when enabled
- +
- + $cmd =~ s/^(\S+)/$1 -o 'rulemac: ON'/;
- + `$cmd`;
- + $? == 0 || print "3\n";
- + -f "$user" || print "4\n"; # This time, it has been leaved
- +
- + unlink $user;
- + print "0\n";
-
- Index: agent/test/rules
- Prereq: 3.0.1.1
- *** agent/test/rules.old Fri Jul 1 17:16:32 1994
- --- agent/test/rules Fri Jul 1 17:16:33 1994
- ***************
- *** 2,8 ****
- # Mailagent rules for filter regression tests
- #
-
- ! # $Id: rules,v 3.0.1.1 1994/04/25 15:26:12 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 2,8 ----
- # Mailagent rules for filter regression tests
- #
-
- ! # $Id: rules,v 3.0.1.2 1994/07/01 15:12:23 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 13,18 ****
- --- 13,21 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: rules,v $
- + # Revision 3.0.1.2 1994/07/01 15:12:23 ram
- + # patch8: added test rules for macro substitution in patterns
- + #
- # Revision 3.0.1.1 1994/04/25 15:26:12 ram
- # patch7: added three more tests in filter/group
- #
- ***************
- *** 146,149 ****
- --- 149,157 ----
- <RANGE> Body <-3, ->: /request/ { SAVE never.5; REJECT };
- <RANGE> Cc <-1, ->: must { SAVE never.6 };
- <RANGE> { DELETE };
- +
- + # filter/macros
- + X-Tag: /macros/ { REJECT MACROS };
- + <MACROS> To: %u { LEAVE };
- + <MACROS> { DELETE };
-
-
- Index: agent/pl/header.pl
- Prereq: 3.0
- *** agent/pl/header.pl.old Fri Jul 1 17:16:17 1994
- --- agent/pl/header.pl Fri Jul 1 17:16:17 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: header.pl,v 3.0 1993/11/29 13:48:49 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: header.pl,v 3.0.1.1 1994/07/01 15:00:51 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: header.pl,v $
- + ;# Revision 3.0.1.1 1994/07/01 15:00:51 ram
- + ;# patch8: fixed leading From date format (spacing problem)
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:49 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 126,132 ****
- --- 129,137 ----
- require 'ctime.pl';
- local($date) = &'ctime(time);
- # Traditionally, MTAs add a ',' right after week day
- + # Moreover, RFC-822 and RFC-1123 require a leading 0 if hour < 10
- $date =~ s/^(\w+)(\s)/$1,$2/;
- + $date =~ s/\s(\d:\d\d:\d\d)\b/0$1/;
- chop($date); # Ctime adds final new-line
- $date;
- }
-
- *** End of Patch 10 ***
-
- exit 0 # Just in case...
-