home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: Raphael Manfredi <ram@acri.fr>
- Subject: v41i125: mailagent - Flexible mail filtering and processing package, v3.0, Patch06
- Message-ID: <1994Feb1.065417.15086@sparky.sterling.com>
- X-Md4-Signature: 51bd12485543b3bdc520e524b44c158a
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Advanced Computer Research Institute, Lyon, France
- Date: Tue, 1 Feb 1994 06:54:17 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: Raphael Manfredi <ram@acri.fr>
- Posting-number: Volume 41, Issue 125
- Archive-name: mailagent/patch06
- Environment: UNIX, Perl
- Patch-To: mailagent: Volume 41, Issue 1-26
-
- [The latest patch for mailagent version 3.0 is #6.]
-
- System: mailagent version 3.0
- Patch #: 6
- Priority: LOW
- Subject: patch #5, continued
- Date: Wed Jan 26 10:46:48 MET 1994
- From: Raphael Manfredi <ram@acri.fr>
-
- Description:
- See patch #5.
-
-
- 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:
- Configure -ders
- make depend
- make
- make install
- make install.man
-
- 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: 5
- 4c4
- < #define PATCHLEVEL 5
- ---
- > #define PATCHLEVEL 6
-
- Index: agent/pl/actions.pl
- Prereq: 3.0
- *** agent/pl/actions.pl.old Wed Jan 26 10:36:42 1994
- --- agent/pl/actions.pl Wed Jan 26 10:36:42 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: actions.pl,v 3.0 1993/11/29 13:48:33 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: actions.pl,v 3.0.1.1 1994/01/26 09:30:03 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: actions.pl,v $
- + ;# Revision 3.0.1.1 1994/01/26 09:30:03 ram
- + ;# patch5: restored ability to use Cc: and Bcc: in message files
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:33 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 394,404 ****
- &add_log("ERROR cannot open message $msg") if $loglvl > 0;
- return 1;
- }
- - unless (open(MAILER,"|$cf'sendmail $cf'mailopt $recipients")) {
- - &add_log("ERROR cannot run $cf'sendmail to send message: $!")
- - if $loglvl;
- - return 1;
- - }
-
- # Construction of value for the %T macro
- local($macro_T); # Default value of macro %T is overwritten
- --- 397,402 ----
- ***************
- *** 420,439 ****
- # overwritten with the one found in the file.
- if (&header_found($msg)) { # Top of message is a header
- local(@newhead); # New header is constructed here
- local($field);
- while (<MSG>) { # Read the header then
- last if /^$/; # End of header
- chop;
- push(@newhead, $_);
- ! if (/^([\w\-]+):/) {
- $field = $1;
- @head = grep(!/^$field:/, @head); # Field is overwritten
- }
- }
- foreach (@newhead) {
- push(@head, $_);
- }
- }
- push(@head, $FILTER); # Avoid loops: replying to ourselves or whatever
- foreach $line (@head) {
- ¯os_subst(*line); # In-place macro substitutions
- --- 418,478 ----
- # overwritten with the one found in the file.
- if (&header_found($msg)) { # Top of message is a header
- local(@newhead); # New header is constructed here
- + local($cc) = ''; # Carbon copy recipients
- + local($collect) = 0; # True when collecting recipients
- local($field);
- + local($_);
- while (<MSG>) { # Read the header then
- last if /^$/; # End of header
- chop;
- push(@newhead, $_);
- ! if (/^([\w\-]+):(.*)/) {
- $field = $1;
- + $_ = $2;
- @head = grep(!/^$field:/, @head); # Field is overwritten
- +
- + # The following used to be done directly by sendmail -t.
- + # However, mailagent does not make use of that option any
- + # longer since $cf'sendmail might not be sendmail and the
- + # mailer used might therefore not understand this -t option.
- +
- + $collect = ($field =~ /^b?cc$/i);
- + $cc .= ¯os_subst(*_) if $collect;
- + } else {
- + $cc .= ¯os_subst(*_) if $collect; # Continuation lines
- }
- }
- foreach (@newhead) {
- push(@head, $_);
- }
- +
- + # Now update the recipient line by parsing $cc and extracting the
- + # e-mail addresses, discarding the comments. Note that this code
- + # will fail if ',' is used in address comments.
- +
- + local(@addr) = split(/,/, $cc);
- + foreach $addr (@addr) {
- + $recipients .= ' ' . (&parse_address($addr))[0];
- + }
- }
- +
- + # Remove duplicate e-mail addresses in the recipient list. Again,
- + # mailagent used to rely on sendmail to do this, but we can't assume
- + # any user-defined mailer will do it.
- + local(%seen);
- + foreach $addr (split(' ', $recipients)) {
- + $seen{$addr}++;
- + }
- + $recipients = join(' ', sort keys %seen);
- + undef %seen;
- +
- + unless (open(MAILER,"|$cf'sendmail $cf'mailopt $recipients")) {
- + &add_log("ERROR cannot run $cf'sendmail to send message: $!")
- + if $loglvl;
- + close MSG;
- + return 1;
- + }
- +
- push(@head, $FILTER); # Avoid loops: replying to ourselves or whatever
- foreach $line (@head) {
- ¯os_subst(*line); # In-place macro substitutions
-
- Index: agent/pl/history.pl
- Prereq: 3.0
- *** agent/pl/history.pl.old Wed Jan 26 10:36:45 1994
- --- agent/pl/history.pl Wed Jan 26 10:36:45 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: history.pl,v 3.0 1993/11/29 13:48:50 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: history.pl,v 3.0.1.1 1994/01/26 09:32:54 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: history.pl,v $
- + ;# Revision 3.0.1.1 1994/01/26 09:32:54 ram
- + ;# patch5: history can now handle distinct tags on messages
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:50 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 20,26 ****
- # Record the message ID of the current message and return 0 if the
- # message was recorded for the first time or if there is no valid message ID.
- # Return 1 if the message was already recorded, and hence was already seen.
- ! sub history_record {
- local($msg_id) = $Header{'Message-Id'}; # Message-ID header
-
- # If there is no message ID, use the concatenation of date + from fields.
- --- 23,32 ----
- # Record the message ID of the current message and return 0 if the
- # message was recorded for the first time or if there is no valid message ID.
- # Return 1 if the message was already recorded, and hence was already seen.
- ! # If tags are provided (string list of words, separated by commas), then
- ! # information is only fetched/recorded for those tags.
- ! sub history_tag {
- ! local($tags) = @_;
- local($msg_id) = $Header{'Message-Id'}; # Message-ID header
-
- # If there is no message ID, use the concatenation of date + from fields.
- ***************
- *** 48,60 ****
- return 0; # Cannot record message if invalid ID
- }
-
- ! local($time, $line) = &dbr'info($host, 'HISTORY', $stamp);
- ! return 0 if $time == -1; # An error occurred
- ! if ($time > 0) { # Message already recorded
- ! &add_log("history duplicate <$msg_id>") if $loglvl > 6;
- ! return 1;
- }
- ! &dbr'update($host, 'HISTORY', 0, $stamp); # Record message (appending)
- ! 0; # First time ever seen
- }
-
- --- 54,95 ----
- return 0; # Cannot record message if invalid ID
- }
-
- ! # Compute a tag array. If no tag given, insert a null tag so that we
- ! # enter the loop below anyway.
- !
- ! $tags =~ s/\s+//g;
- ! local(@tags) = split(/,+/, $tags);
- ! push(@tags, '') unless @tags;
- !
- ! # Now loop for each tag given. We record the message ID stamp followed
- ! # by a tab, then the tag between <>. If no tag is given, we look for any
- ! # occurence.
- !
- ! local($time, $line); # Time stamp, line number of DBR entry
- ! local(@regexp); # DBR regular expression lookup
- ! local($seen) = 0; # Assume new instance
- !
- ! foreach $tag (@tags) {
- ! @regexp = ($stamp);
- ! push(@regexp, "<$tag>") if $tag ne '';
- ! ($time, $line) = &dbr'info($host, 'HISTORY', @regexp);
- ! if ($time == -1) { # An error occurred
- ! &add_log("ERROR while dbr-looking for '@regexp'") if $loglvl > 1;
- ! next;
- ! }
- ! if ($time > 0) { # Message already recorded
- ! local($tagmsg) = $tag eq '' ? '' : " ($tag)";
- ! &add_log("history duplicate <$msg_id>" . $tagmsg) if $loglvl > 6;
- ! $seen++;
- ! } else { # Record message (appending)
- ! &dbr'update($host, 'HISTORY', 0, @regexp);
- ! }
- }
- ! return $seen; # Return seen status
- ! }
- !
- ! # Obsolete -- will be removed in next release
- ! sub history_record {
- ! &history_tag();
- }
-
-
- Index: agent/test/actions
- Prereq: 3.0.1.2
- *** agent/test/actions.old Wed Jan 26 10:36:45 1994
- --- agent/test/actions Wed Jan 26 10:36:46 1994
- ***************
- *** 2,8 ****
- # Mailagent rules for action regression tests
- #
-
- ! # $Id: actions,v 3.0.1.2 1993/12/17 08:13:20 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 2,8 ----
- # Mailagent rules for action regression tests
- #
-
- ! # $Id: actions,v 3.0.1.3 1994/01/26 09:35:08 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 13,18 ****
- --- 13,22 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: actions,v $
- + # Revision 3.0.1.3 1994/01/26 09:35:08 ram
- + # patch5: added new tests for UNIQUE and RECORD tags
- + # patch5: ensure header-added recipients looked for in messages
- + #
- # Revision 3.0.1.2 1993/12/17 08:13:20 ram
- # patch4: one spurious single quote still remained after patch3
- #
- ***************
- *** 111,117 ****
- }
- X-Tag: /keep/, To: ram { SAVE no_resync };
-
- ! X-Tag: /message/ { MESSAGE msg; DELETE };
-
- X-Tag: /macro/
- {
- --- 115,122 ----
- }
- X-Tag: /keep/, To: ram { SAVE no_resync };
-
- ! X-Tag: /message 1/ { MESSAGE msg; DELETE };
- ! X-Tag: /message 2/ { MESSAGE msg.2; DELETE };
-
- X-Tag: /macro/
- {
- ***************
- *** 130,135 ****
- --- 135,141 ----
-
- X-Tag: /notify 1/ { NOTIFY msg nobody; DELETE };
- X-Tag: /notify 2/ { NOTIFY msg "list"; DELETE };
- + X-Tag: /notify 3/ { NOTIFY msg.2 some@random.ctry %u; DELETE };
-
- X-Tag: /once/
- {
- ***************
- *** 172,177 ****
- --- 178,190 ----
- X-Tag: /record #3/ { RECORD -a; SAVE %u.1 };
- X-Tag: /record #4/ { RECORD -c; REJECT -f RECORD; SAVE %u.1 };
- <RECORD> X-Tag: /record #4/ { SAVE %u.2 };
- + <RECORD_CATCH> X-Tag: /record/ { DELETE };
- + X-Tag: /record #5/ { RECORD (tag1,tag2); SAVE %u.1; REJECT };
- + X-Tag: /record #5/ { RECORD INITIAL (tag2); SAVE %u.2; REJECT };
- + X-Tag: /record #5/ { RECORD -r RECORD_CATCH; SAVE %u.3 };
- + X-Tag: /record #6/ { RECORD (tag); SAVE %u.1; REJECT };
- + X-Tag: /record #6/ { RECORD (other); SAVE %u.2; REJECT };
- + X-Tag: /record #6/ { RECORD -r RECORD_CATCH; SAVE %u.3 };
-
- X-Tag: /require/ { REJECT REQUIRE; };
- <REQUIRE> { REQUIRE non_existent; REJECT -f; SAVE never };
- ***************
- *** 272,277 ****
- --- 285,296 ----
- X-Tag: /unique #3/ { UNIQUE -a; SAVE %u.1 };
- X-Tag: /unique #4/ { UNIQUE -c; REJECT -f UNIQUE; SAVE %u.1 };
- <UNIQUE> X-Tag: /unique #4/ { SAVE %u.2 };
- + X-Tag: /unique #5/ { UNIQUE -a (tag1,tag2); SAVE %u.1; REJECT };
- + X-Tag: /unique #5/ { UNIQUE (tag2); REJECT -f; SAVE %u.2; REJECT };
- + X-Tag: /unique #5/ { UNIQUE -a; SAVE %u.3 };
- + X-Tag: /unique #6/ { UNIQUE (tag); REJECT -f; SAVE %u.1; REJECT };
- + X-Tag: /unique #6/ { UNIQUE (other); REJECT -f; SAVE %u.2; REJECT };
- + X-Tag: /unique #6/ { UNIQUE -a; SAVE %u.3 };
-
- X-Tag: /write #1/ { WRITE mbox };
- X-Tag: /write #2/ { WRITE path/another/third/mbox };
-
- Index: agent/test/cmd/message.t
- Prereq: 3.0
- *** agent/test/cmd/message.t.old Wed Jan 26 10:36:46 1994
- --- agent/test/cmd/message.t Wed Jan 26 10:36:46 1994
- ***************
- *** 1,6 ****
- # Test MESSAGE command
-
- ! # $Id: message.t,v 3.0 1993/11/29 13:49:34 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 1,6 ----
- # Test MESSAGE command
-
- ! # $Id: message.t,v 3.0.1.1 1994/01/26 09:35:22 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 11,16 ****
- --- 11,19 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: message.t,v $
- + # Revision 3.0.1.1 1994/01/26 09:35:22 ram
- + # patch5: ensure header-added recipients looked for in messages
- + #
- # Revision 3.0 1993/11/29 13:49:34 ram
- # Baseline for mailagent 3.0 netwide release.
- #
- ***************
- *** 21,41 ****
- open(MSG, '>msg') || print "1\n";
- print MSG <<EOM;
- Organization: Public Domain Software, Earth, Milkway.
-
- Sent by %n.
- EOM
- close MSG;
-
- ! &add_header('X-Tag: message');
- `$cmd`;
- $? == 0 || print "2\n";
- -f "$user" && print "3\n"; # Mail not saved
- &get_log(4, 'send.mail');
- ! &check_log('^$', 5) == 1 || print "6\n";
- &check_log('^Subject: Re: melting', 7) == 1 || print "8\n";
- &check_log('^Recipients: compilers-request@iecc', 9) == 1 || print "10\n";
- &check_log('^Sent by compilers-request.$', 11) == 1 || print "12\n";
-
- &clear_mta;
- ! unlink 'mail', 'msg';
- print "0\n";
- --- 24,68 ----
- open(MSG, '>msg') || print "1\n";
- print MSG <<EOM;
- Organization: Public Domain Software, Earth, Milkway.
- + Above line was not a header, since no space before this line.
-
- Sent by %n.
- EOM
- close MSG;
-
- ! open(MSG, '>msg.2') || print "13\n";
- ! print MSG <<EOM;
- ! Cc: some@random.ctry, %u
- ! Organization: Public Domain Software, Earth, Milkway.
- !
- ! Body of message.
- ! EOM
- ! close MSG;
- !
- ! &add_header('X-Tag: message 1');
- `$cmd`;
- $? == 0 || print "2\n";
- -f "$user" && print "3\n"; # Mail not saved
- &get_log(4, 'send.mail');
- ! &check_log('^$', 5) == 2 || print "6\n";
- &check_log('^Subject: Re: melting', 7) == 1 || print "8\n";
- &check_log('^Recipients: compilers-request@iecc', 9) == 1 || print "10\n";
- &check_log('^Sent by compilers-request.$', 11) == 1 || print "12\n";
- + unlink 'send.mail', $user;
-
- + &replace_header('X-Tag: message 2');
- + `$cmd`;
- + $? == 0 || print "14\n";
- + -f "$user" && print "15\n"; # Mail not saved
- + &get_log(16, 'send.mail');
- + &check_log('^$', 17) == 1 || print "18\n";
- + &check_log('^Subject: Re: melting', 19) == 1 || print "20\n";
- + $recipients = join(' ', sort split(' ',
- + "compilers-request@iecc.cambridge.ma.us some@random.ctry $user"));
- + &check_log("^Recipients: $recipients", 21) == 1 || print "22\n";
- + &check_log("^Cc: some@random.ctry, $user", 23) == 1 || print "24\n";
- +
- &clear_mta;
- ! unlink 'mail', 'msg', 'msg.2', $user;
- ! # Last is 24
- print "0\n";
-
- Index: agent/magent.SH
- Prereq: 3.0
- *** agent/magent.SH.old Wed Jan 26 10:36:37 1994
- --- agent/magent.SH Wed Jan 26 10:36:37 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 1993/11/29 13:48:22 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.1 1994/01/26 09:27:56 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.1 1994/01/26 09:27:56 ram
- + # patch5: new -F option to force procesing on filtered messages
- + #
- # Revision 3.0 1993/11/29 13:48:22 ram
- # Baseline for mailagent 3.0 netwide release.
- #
- ***************
- *** 158,163 ****
- --- 161,169 ----
- elsif ($_ eq '-t') { # Track rule matches on stdout
- ++$track_all;
- }
- + elsif ($_ eq '-F') { # Force processing, even if already seen
- + ++$force_seen;
- + }
- elsif ($_ eq '-L') { # Specify new logging level
- $log_level = int(shift);
- }
- ***************
- *** 319,330 ****
- # Print usage and exit
- sub usage {
- print STDERR <<EOF;
- ! Usage: $prog_name [-dhilqtV] [-s{umary}] [-f file] [-e rules] [-c config]
- [-L level] [-r file] [-o def] [mailfile]
- -c : specify alternate configuration file.
- -d : dump filter rules (special).
- -e : enter rules to be applied.
- -f : get messages from UNIX-style mailbox file.
- -h : print this help message and exits.
- -i : interactive usage -- print log messages on stderr.
- -l : list message queue (special).
- --- 325,337 ----
- # Print usage and exit
- sub usage {
- print STDERR <<EOF;
- ! Usage: $prog_name [-dFhilqtV] [-s{umary}] [-f file] [-e rules] [-c config]
- [-L level] [-r file] [-o def] [mailfile]
- -c : specify alternate configuration file.
- -d : dump filter rules (special).
- -e : enter rules to be applied.
- -f : get messages from UNIX-style mailbox file.
- + -F : force processing on already filtered messages.
- -h : print this help message and exits.
- -i : interactive usage -- print log messages on stderr.
- -l : list message queue (special).
-
- Index: agent/test/cmd/notify.t
- Prereq: 3.0
- *** agent/test/cmd/notify.t.old Wed Jan 26 10:36:47 1994
- --- agent/test/cmd/notify.t Wed Jan 26 10:36:47 1994
- ***************
- *** 1,6 ****
- # Test NOTIFY command
-
- ! # $Id: notify.t,v 3.0 1993/11/29 13:49:36 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 1,6 ----
- # Test NOTIFY command
-
- ! # $Id: notify.t,v 3.0.1.1 1994/01/26 09:35:34 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 11,16 ****
- --- 11,19 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: notify.t,v $
- + # Revision 3.0.1.1 1994/01/26 09:35:34 ram
- + # patch5: ensure header-added recipients looked for in messages
- + #
- # Revision 3.0 1993/11/29 13:49:36 ram
- # Baseline for mailagent 3.0 netwide release.
- #
- ***************
- *** 26,31 ****
- --- 29,43 ----
- EOM
- close MSG;
-
- + open(MSG, '>msg.2') || print "21\n";
- + print MSG <<EOM;
- + Cc: someone@random, %u
- + Organization: Public Domain Software, Earth, Milkway.
- +
- + Message body.
- + EOM
- + close MSG;
- +
- &add_header('X-Tag: notify 1');
- `$cmd`;
- $? == 0 || print "2\n";
- ***************
- *** 53,59 ****
- &get_log(16, 'send.mail');
- &check_log('^To: first, second, third$', 17) == 1 || print "18\n";
- &check_log('^Recipients: first second third$', 19) == 1 || print "20\n";
-
- &clear_mta;
- ! unlink 'mail', 'list', 'msg';
- print "0\n";
- --- 65,85 ----
- &get_log(16, 'send.mail');
- &check_log('^To: first, second, third$', 17) == 1 || print "18\n";
- &check_log('^Recipients: first second third$', 19) == 1 || print "20\n";
- + unlink 'send.mail', $user;
-
- + &replace_header('X-Tag: notify 3');
- + `$cmd`;
- + $? == 0 || print "22\n";
- + -f "$user" && print "23\n"; # Mail not saved
- + &get_log(24, 'send.mail');
- + &check_log('^$', 25) == 1 || print "26\n";
- + &check_log('^Subject: Re: melting', 27) == 1 || print "28\n";
- + $recipients = join(' ', sort split(' ',
- + "someone@random some@random.ctry $user"));
- + &check_log("^Recipients: $recipients", 29) == 1 || print "30\n";
- + &check_log("^Cc: someone@random, $user", 31) == 1 || print "32\n";
- +
- &clear_mta;
- ! unlink 'mail', 'list', 'msg', 'msg.2', $user;
- ! # Last is 32
- print "0\n";
-
- Index: agent/test/cmd/record.t
- Prereq: 3.0
- *** agent/test/cmd/record.t.old Wed Jan 26 10:36:47 1994
- --- agent/test/cmd/record.t Wed Jan 26 10:36:47 1994
- ***************
- *** 1,6 ****
- # The RECORD command
-
- ! # $Id: record.t,v 3.0 1993/11/29 13:49:42 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 1,6 ----
- # The RECORD command
-
- ! # $Id: record.t,v 3.0.1.1 1994/01/26 09:35:57 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 11,16 ****
- --- 11,19 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: record.t,v $
- + # Revision 3.0.1.1 1994/01/26 09:35:57 ram
- + # patch5: added tests for tag support
- + #
- # Revision 3.0 1993/11/29 13:49:42 ram
- # Baseline for mailagent 3.0 netwide release.
- #
- ***************
- *** 55,60 ****
- --- 58,88 ----
- -f "$user.1" && print "16\n"; # We rejected
- -f "$user.2" || print "17\n"; # Must be there (saved in mode RECORD)
- -f "$user" && print "18\n";
- + unlink "$user.1", "$user.2", $user;
- +
- + &replace_header('X-Tag: record #5');
- + `$cmd`;
- + $? == 0 || print "19\n";
- + -f "$user.1" || print "20\n"; # First time with both tags tag1 and tag2
- + -f "$user.2" && print "21\n"; # Can't be there (tag2 already recorded)
- + -f "$user.3" && print "22\n"; # Can't be there (already recorded previously)
- + -f "$user" && print "23\n";
- + &get_log(24, 'dbr/i/e');
- + &check_log('<tag2>$', 25) == 1 || print "26\n";
- + &check_log('<tag1>$', 27) == 1 || print "28\n";
- + &check_log('cambridge', 29) == 3 || print "30\n";
- + unlink "$user.1", "$user.2", "$user.3", $user;
- +
- + &replace_header('X-Tag: record #6');
- + `rm -rf dbr` if -d 'dbr';
- + `$cmd`;
- + $? == 0 || print "31\n";
- + -f "$user.1" || print "32\n"; # First time with tag 'tag'
- + -f "$user.2" || print "33\n"; # Tag 'other' distinct from 'tag'
- + -f "$user.3" && print "34\n"; # Sorry, already recorded
- + -f "$user" && print "35\n";
- + &get_log(36, 'dbr/i/e');
- + &check_log('cambridge', 37) == 2 || print "38\n";
-
- `rm -rf dbr` if -d 'dbr';
- unlink "$user", "$user.1", "$user.2", "$user.3", 'mail';
-
- Index: agent/test/cmd/unique.t
- Prereq: 3.0
- *** agent/test/cmd/unique.t.old Wed Jan 26 10:36:48 1994
- --- agent/test/cmd/unique.t Wed Jan 26 10:36:48 1994
- ***************
- *** 1,6 ****
- # The UNIQUE command
-
- ! # $Id: unique.t,v 3.0 1993/11/29 13:49:53 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- --- 1,6 ----
- # The UNIQUE command
-
- ! # $Id: unique.t,v 3.0.1.1 1994/01/26 09:36:02 ram Exp $
- #
- # Copyright (c) 1990-1993, Raphael Manfredi
- #
- ***************
- *** 11,16 ****
- --- 11,19 ----
- # of the source tree for mailagent 3.0.
- #
- # $Log: unique.t,v $
- + # Revision 3.0.1.1 1994/01/26 09:36:02 ram
- + # patch5: added tests for tag support
- + #
- # Revision 3.0 1993/11/29 13:49:53 ram
- # Baseline for mailagent 3.0 netwide release.
- #
- ***************
- *** 55,60 ****
- --- 58,88 ----
- -f "$user.1" && print "16\n"; # We rejected
- -f "$user.2" || print "17\n"; # Must be there (saved in mode UNIQUE)
- -f "$user" && print "18\n";
- + unlink "$user.1", "$user.2", $user;
- +
- + &replace_header('X-Tag: unique #5');
- + `$cmd`;
- + $? == 0 || print "19\n";
- + -f "$user.1" || print "20\n"; # First time with both tags tag1 and tag2
- + -f "$user.2" && print "21\n"; # Can't be there (tag2 already recorded)
- + -f "$user.3" && print "22\n"; # Can't be there (already recorded previously)
- + -f "$user" && print "23\n";
- + &get_log(24, 'dbr/i/e');
- + &check_log('<tag2>$', 25) == 1 || print "26\n";
- + &check_log('<tag1>$', 27) == 1 || print "28\n";
- + &check_log('cambridge', 29) == 3 || print "30\n";
- + unlink "$user.1", "$user.2", "$user.3", $user;
- +
- + &replace_header('X-Tag: unique #6');
- + `rm -rf dbr` if -d 'dbr';
- + `$cmd`;
- + $? == 0 || print "31\n";
- + -f "$user.1" || print "32\n"; # First time with tag 'tag'
- + -f "$user.2" || print "33\n"; # Tag 'other' distinct from 'tag'
- + -f "$user.3" && print "34\n"; # Sorry, already recorded
- + -f "$user" && print "35\n";
- + &get_log(36, 'dbr/i/e');
- + &check_log('cambridge', 37) == 2 || print "38\n";
-
- `rm -rf dbr` if -d 'dbr';
- unlink "$user", "$user.1", "$user.2", "$user.3", 'mail';
-
- Index: agent/test/option/F.t
- *** agent/test/option/F.t.old Wed Jan 26 10:36:49 1994
- --- agent/test/option/F.t Wed Jan 26 10:36:49 1994
- ***************
- *** 0 ****
- --- 1,48 ----
- + # -F : force processing on seen mail
- +
- + # $Id: F.t,v 3.0.1.1 1994/01/26 09:36:08 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: 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;
- +
- + system "$mailagent -e '{SAVE ~/folder}' -f ../mail >/dev/null 2>&1";
- + $? == 0 || print "1\n";
- + -f $user && print "2\n";
- + ($old_size = -s 'folder') || print "3\n";
- + &get_log(4, 'folder');
- + &check_log('^X-Filter:', 5) == 1 || print "6\n";
- +
- + system "$mailagent -e '{SAVE ~/folder}' -f ./folder >/dev/null 2>&1";
- + $? == 0 || print "7\n";
- + -f $user || print "8\n";
- + ($old_size == -s 'folder') || print "9\n";
- + ($old_size == -s $user) || print "10\n";
- + &get_log(11, $user);
- + &check_log('^X-Filter:', 12) == 1 || print "13\n";
- +
- + # Now here comes the -F check, now that we know everything works fine
- + unlink $user;
- + system "$mailagent -F -e '{SAVE ~/again}' -f ./folder >/dev/null 2>&1";
- + $? == 0 || print "14\n";
- + -f $user && print "15\n";
- + -s 'again' || print "16\n";
- + &get_log(17, 'again');
- + &check_log('^X-Filter:', 18) == 1 || print "19\n";
- +
- + print "0\n";
-
- Index: agent/pl/analyze.pl
- Prereq: 3.0
- *** agent/pl/analyze.pl.old Wed Jan 26 10:36:43 1994
- --- agent/pl/analyze.pl Wed Jan 26 10:36:43 1994
- ***************
- *** 1,4 ****
- ! ;# $Id: analyze.pl,v 3.0 1993/11/29 13:48:35 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- --- 1,4 ----
- ! ;# $Id: analyze.pl,v 3.0.1.1 1994/01/26 09:30:23 ram Exp $
- ;#
- ;# Copyright (c) 1990-1993, Raphael Manfredi
- ;#
- ***************
- *** 9,14 ****
- --- 9,17 ----
- ;# of the source tree for mailagent 3.0.
- ;#
- ;# $Log: analyze.pl,v $
- + ;# Revision 3.0.1.1 1994/01/26 09:30:23 ram
- + ;# patch5: now understands new -F option to force processing
- + ;#
- ;# Revision 3.0 1993/11/29 13:48:35 ram
- ;# Baseline for mailagent 3.0 netwide release.
- ;#
- ***************
- *** 84,92 ****
- }
- }
- if ($done) { # We already processed that message
- ! &add_log("NOTICE already filtered, entering seen mode")
- ! if $loglvl > 5;
- ! $mode = '_SEEN_'; # This is a special mode
- $ever_seen = 1; # This will prevent vacation messages
- &s_seen; # Update statistics
- }
- --- 87,100 ----
- }
- }
- if ($done) { # We already processed that message
- ! if ($force_seen) { # They used the -F option
- ! &add_log("NOTICE already filtered, processing anyway")
- ! if $loglvl > 5;
- ! } else {
- ! &add_log("NOTICE already filtered, entering seen mode")
- ! if $loglvl > 5;
- ! $mode = '_SEEN_'; # This is a special mode
- ! }
- $ever_seen = 1; # This will prevent vacation messages
- &s_seen; # Update statistics
- }
-
- Index: agent/filter/parser.c
- Prereq: 3.0
- *** agent/filter/parser.c.old Wed Jan 26 10:36:36 1994
- --- agent/filter/parser.c Wed Jan 26 10:36:36 1994
- ***************
- *** 11,17 ****
- */
-
- /*
- ! * $Id: parser.c,v 3.0 1993/11/29 13:48:18 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- --- 11,17 ----
- */
-
- /*
- ! * $Id: parser.c,v 3.0.1.1 1994/01/26 09:27:37 ram Exp $
- *
- * Copyright (c) 1990-1993, Raphael Manfredi
- *
- ***************
- *** 22,27 ****
- --- 22,30 ----
- * of the source tree for mailagent 3.0.
- *
- * $Log: parser.c,v $
- + * Revision 3.0.1.1 1994/01/26 09:27:37 ram
- + * patch5: typo fix in a comment
- + *
- * Revision 3.0 1993/11/29 13:48:18 ram
- * Baseline for mailagent 3.0 netwide release.
- *
- ***************
- *** 189,195 ****
- private void check_perm(file)
- char *file;
- {
- ! /* Check basic permissions on the specified file. If cannot be world
- * writable and must be owned by the user. If the file specified does not
- * exist, no error is reported however.
- */
- --- 192,198 ----
- private void check_perm(file)
- char *file;
- {
- ! /* Check basic permissions on the specified file. It cannot be world
- * writable and must be owned by the user. If the file specified does not
- * exist, no error is reported however.
- */
-
- Index: MANIFEST
- *** MANIFEST.old Wed Jan 26 10:36:50 1994
- --- MANIFEST Wed Jan 26 10:36:50 1994
- ***************
- *** 228,233 ****
- --- 228,234 ----
- agent/test/misc/newcmd.t Filter command extension tests
- agent/test/misc/usrmac.t User-defined macros checks
- agent/test/option/ Tests the options to the mailagent program
- + agent/test/option/F.t Test -F option
- agent/test/option/L.t Test -L option
- agent/test/option/V.t Test -V option
- agent/test/option/c.t Test -c option
-
- Index: Credits
- *** Credits.old Wed Jan 26 10:36:34 1994
- --- Credits Wed Jan 26 10:36:34 1994
- ***************
- *** 89,94 ****
- --- 89,95 ----
- Jim McCoy <mccoy@ccwf.cc.utexas.edu>
- John Plate <plate@infotek.dk>
- Jost Krieger <x920031@rubb.rz.ruhr-uni-bochum.de>
- + Harald Koch <chk@enfm.utcc.utoronto.ca>
- Keith Pyle <keith@ibmoto.com>
- Keith Rose <rose@ultryx.com>
- Kent Landfield <kent@imd.sterling.com>
-
- *** End of Patch 6 ***
-
- exit 0 # Just in case...
-