home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume42 / mailagent / patch07 next >
Encoding:
Internet Message Format  |  1994-05-06  |  37.6 KB

  1. From: Raphael Manfredi <ram@acri.fr>
  2. Newsgroups: comp.sources.misc
  3. Subject: v42i071:  mailagent - Flexible mail filtering and processing package, v3.0, Patch07
  4. Date: 6 May 1994 13:45:23 -0500
  5. Organization: Advanced Computer Research Institute, Lyon, France
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <2qe383$t1s@sparky.sterling.com>
  9. X-Md4-Signature: 3d83d9cfd7bc03d0d9ffa63e9d88efa1
  10.  
  11. Submitted-by: Raphael Manfredi <ram@acri.fr>
  12. Posting-number: Volume 42, Issue 71
  13. Archive-name: mailagent/patch07
  14. Environment: UNIX, Perl
  15. Patch-To: mailagent: Volume 41, Issue 1-26
  16.  
  17. [The latest patch for mailagent version 3.0 is #7.]
  18.  
  19. System: mailagent version 3.0
  20. Patch #: 7
  21. Priority: MEDIUM
  22. Subject: removed a duplicate address in credit list
  23. Subject: also extract system error messages from logfile
  24. Subject: added new 'fromesc' config variable for From line escapes
  25. Subject: removed incorrect sanity check for zcat (void when portable)
  26. Subject: documented new 'fromesc' config variable
  27. Subject: forgot to insert the new -F option in the synopsis line
  28. Subject: here and there fixes
  29. Subject: global fix for From line escapes to make them configurable
  30. Subject: fixed selector combination logic and added some debug logs
  31. Subject: made sure new variable 'fromesc' has a meaningful default
  32. Subject: now also understands @domain:user@other addresses
  33. Subject: more accurate for group name parsing
  34. Subject: added locking protections when updating rule cache
  35. Subject: check bug reported by Andy Seaborne <afs@hplb.hpl.hp.com>
  36. Subject: added commented 'fromesc' new variable
  37. Subject: now make sure From line escaping is correctly removed
  38. Subject: added three additional tests after a bug was found
  39. Subject: added three more tests in filter/group
  40. Subject: make sure unkit directory is not hidden by leading dot
  41. Date: Mon Apr 25 17:26:57 MET DST 1994
  42. From: Raphael Manfredi <ram@acri.fr>
  43.  
  44. Description:
  45.     Removed a duplicate address in credit list.
  46.  
  47.     Make sure the chkagent.sh script also extract system error
  48.     messages from logfile (this script is intended to be run
  49.     by cron every night).
  50.  
  51.     Added new 'fromesc' config variable for From line escapes. By
  52.     setting this variable to OFF, mailagent will stop escaping the
  53.     potentially dangerous From_ lines in your messages by prepending
  54.     a '>' in front. If you don't add it to your ~/.mailagent, it
  55.     will default to ON.
  56.  
  57.     Removed incorrect sanity check for zcat (void when portable)
  58.     in the mailpatch script. When Configure told it to be portable,
  59.     the $zcat variable is not holding the full path name...
  60.  
  61.     Documented new 'fromesc' config variable in manual page and
  62.     added the new -F option in the synopsis line (miss reported
  63.     by Shigeya Suzuki <shigeya@foretune.co.jp>.
  64.  
  65.     Fixed selector combination logic and added some debug logs.
  66.     I found a bug in it, and therefore I added three more tests
  67.     in the regression test suite to make sure they never reappear
  68.     again...
  69.  
  70.     RFC-822 parser now also understands @domain:user@other addresses,
  71.     which makes it possible to select on the user login name...
  72.     Also made more accurate for group name parsing.
  73.  
  74.     Added locking protections when updating rule cache. Since the -r
  75.     option may update the cache and no global mailagent locking is
  76.     performed in that case, it was mandatory to fix it. Otherwise,
  77.     the rule cache could have got corrupted in some way, resulting
  78.     in incorrect filtering.
  79.  
  80.     Check bug reported by Andy Seaborne <afs@hplb.hpl.hp.com>. The
  81.     From_ line escaping was not done properly. Sorry.
  82.  
  83.     Make sure unkit directory is not hidden by leading dot. The UNKIT
  84.     command under the misc/ directory was updated to avoid the creation
  85.     of an hidden archive (created from subject when someone runs a
  86.     'kit ./file'.
  87.  
  88.  
  89. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your mailagent source
  90.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  91.     If you don't have the patch program, apply the following by hand,
  92.     or get patch (version 2.0, latest patchlevel).
  93.  
  94.     After patching:
  95.         Configure -ders
  96.         make depend
  97.         make
  98.         make install
  99.         make install.man
  100.  
  101.     If patch indicates that patchlevel is the wrong version, you may need
  102.     to apply one or more previous patches, or the patch may already
  103.     have been applied.  See the patchlevel.h file to find out what has or
  104.     has not been applied.  In any event, don't continue with the patch.
  105.  
  106.     If you are missing previous patches they can be obtained from me:
  107.  
  108.         Raphael Manfredi <ram@acri.fr>
  109.  
  110.     If you send a mail message of the following form it will greatly speed
  111.     processing:
  112.  
  113.         Subject: Command
  114.         @SH mailpatch PATH mailagent 3.0 LIST
  115.                ^ note the c
  116.  
  117.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  118.     or in bang notation from some well-known host, and LIST is the number
  119.     of one or more patches you need, separated by spaces, commas, and/or
  120.     hyphens.  Saying 35- says everything from 35 to the end.
  121.  
  122.     To get some more detailed instructions, send me the following mail:
  123.  
  124.         Subject: Command
  125.         @SH mailhelp PATH
  126.  
  127.  
  128. Index: patchlevel.h
  129. Prereq: 6
  130. 4c4
  131. < #define PATCHLEVEL 6
  132. ---
  133. > #define PATCHLEVEL 7
  134.  
  135. Index: agent/pl/actions.pl
  136. Prereq: 3.0.1.1
  137. *** agent/pl/actions.pl.old    Mon Apr 25 17:26:46 1994
  138. --- agent/pl/actions.pl    Mon Apr 25 17:26:46 1994
  139. ***************
  140. *** 1,4 ****
  141. ! ;# $Id: actions.pl,v 3.0.1.1 1994/01/26 09:30:03 ram Exp $
  142.   ;#
  143.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  144.   ;#  
  145. --- 1,4 ----
  146. ! ;# $Id: actions.pl,v 3.0.1.2 1994/04/25 15:16:53 ram Exp $
  147.   ;#
  148.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  149.   ;#  
  150. ***************
  151. *** 9,14 ****
  152. --- 9,18 ----
  153.   ;#  of the source tree for mailagent 3.0.
  154.   ;#
  155.   ;# $Log: actions.pl,v $
  156. + ;# Revision 3.0.1.2  1994/04/25  15:16:53  ram
  157. + ;# patch7: here and there fixes
  158. + ;# patch7: global fix for From line escapes to make them configurable
  159. + ;#
  160.   ;# Revision 3.0.1.1  1994/01/26  09:30:03  ram
  161.   ;# patch5: restored ability to use Cc: and Bcc: in message files
  162.   ;#
  163. ***************
  164. *** 886,899 ****
  165.           open(STDIN, "<&READ");                # Redirect stdin to pipe
  166.           close READ if $input == $NO_INPUT;    # Close stdin if needed
  167.           unless (open(STDOUT, ">$trace")) {    # Where output goes
  168. !             &add_log("WARNING couldn't create $trace") if $loglvl > 5;
  169.               if ($feedback == $FEEDBACK) {    # Need trace if feedback
  170.                   kill 'SIGPIPE', $ppid;        # Parent still waiting
  171.                   exit 1;
  172.               }
  173.           }
  174.           open(STDERR, ">&STDOUT");            # Make it follow pipe
  175. !         exec "$program";                    # Run the program now
  176.           &add_log("ERROR couldn't exec '$program': $!") if $loglvl > 1;
  177.           kill 'SIGPIPE', $ppid;                # Parent still waiting
  178.           exit 1;
  179. --- 890,903 ----
  180.           open(STDIN, "<&READ");                # Redirect stdin to pipe
  181.           close READ if $input == $NO_INPUT;    # Close stdin if needed
  182.           unless (open(STDOUT, ">$trace")) {    # Where output goes
  183. !             &add_log("WARNING couldn't create $trace: $!") if $loglvl > 5;
  184.               if ($feedback == $FEEDBACK) {    # Need trace if feedback
  185.                   kill 'SIGPIPE', $ppid;        # Parent still waiting
  186.                   exit 1;
  187.               }
  188.           }
  189.           open(STDERR, ">&STDOUT");            # Make it follow pipe
  190. !         exec $program;                        # Run the program now
  191.           &add_log("ERROR couldn't exec '$program': $!") if $loglvl > 1;
  192.           kill 'SIGPIPE', $ppid;                # Parent still waiting
  193.           exit 1;
  194. ***************
  195. *** 1002,1010 ****
  196.       }
  197.       local($temp) = ' ' x 2000;            # Temporary storage (pre-extended)
  198.       $temp = '';
  199.       if ($input == $BODY_INPUT) {        # We have to feed back the body only
  200.           while (<TRACE>) {
  201. !             s/^From\s/>From$1/;            # Protect potentially dangerous lines
  202.               $temp .= $_;
  203.           }
  204.       } else {
  205. --- 1006,1017 ----
  206.       }
  207.       local($temp) = ' ' x 2000;            # Temporary storage (pre-extended)
  208.       $temp = '';
  209. +     local($last_was_nl) = 1;            # True when previous line was blank
  210.       if ($input == $BODY_INPUT) {        # We have to feed back the body only
  211.           while (<TRACE>) {
  212. !             # Protect potentially dangerous lines
  213. !             s/^From(\s)/>From$1/ if $last_was_nl && $cf'fromesc =~ /on/i;
  214. !             $last_was_nl = /^$/;
  215.               $temp .= $_;
  216.           }
  217.       } else {
  218. ***************
  219. *** 1014,1020 ****
  220.               if (1../^$/) {
  221.                   $head .= $_ unless /^$/;
  222.               } else {
  223. !                 s/^From\s/>From$1/;        # Protect potentially dangerous lines
  224.                   $temp .= $_;
  225.               }
  226.           }
  227. --- 1021,1029 ----
  228.               if (1../^$/) {
  229.                   $head .= $_ unless /^$/;
  230.               } else {
  231. !                 # Protect potentially dangerous lines
  232. !                 s/^From(\s)/>From$1/ if $last_was_nl && $cf'fromesc =~ /on/i;
  233. !                 $last_was_nl = /^$/;
  234.                   $temp .= $_;
  235.               }
  236.           }
  237. ***************
  238. *** 1369,1375 ****
  239.       # escape all potentially dangerous From lines.
  240.       local($last_was_space);
  241.       foreach (@array) {
  242. !         s/^From\s+(\S+)/>From $1/ if $last_was_space;
  243.           s/^- -/-/;                    # This is the EB escape in RFC-934
  244.           $last_was_space = /^$/;        # From is dangerous after blank line
  245.       }
  246. --- 1378,1385 ----
  247.       # escape all potentially dangerous From lines.
  248.       local($last_was_space);
  249.       foreach (@array) {
  250. !         # Protect potentially dangerous lines
  251. !         s/^From\s+(\S+)/>From $1/ if $last_was_space && $cf'fromesc =~ /on/i;
  252.           s/^- -/-/;                    # This is the EB escape in RFC-934
  253.           $last_was_space = /^$/;        # From is dangerous after blank line
  254.       }
  255.  
  256. Index: agent/pl/rules.pl
  257. Prereq: 3.0
  258. *** agent/pl/rules.pl.old    Mon Apr 25 17:26:50 1994
  259. --- agent/pl/rules.pl    Mon Apr 25 17:26:51 1994
  260. ***************
  261. *** 1,4 ****
  262. ! ;# $Id: rules.pl,v 3.0 1993/11/29 13:49:14 ram Exp $
  263.   ;#
  264.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  265.   ;#  
  266. --- 1,4 ----
  267. ! ;# $Id: rules.pl,v 3.0.1.1 1994/04/25 15:23:03 ram Exp $
  268.   ;#
  269.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  270.   ;#  
  271. ***************
  272. *** 9,14 ****
  273. --- 9,17 ----
  274.   ;#  of the source tree for mailagent 3.0.
  275.   ;#
  276.   ;# $Log: rules.pl,v $
  277. + ;# Revision 3.0.1.1  1994/04/25  15:23:03  ram
  278. + ;# patch7: added locking protections when updating rule cache
  279. + ;#
  280.   ;# Revision 3.0  1993/11/29  13:49:14  ram
  281.   ;# Baseline for mailagent 3.0 netwide release.
  282.   ;#
  283. ***************
  284. *** 290,295 ****
  285. --- 293,302 ----
  286.   sub write_cache {
  287.       return 0 unless defined $cf'rulecache;
  288.       local(*CACHE);                    # File handle used to write the cache
  289. +     if (0 != &'acs_rqst($cf'rulecache)) {
  290. +         &'add_log("NOTICE unable to write-lock $cf'rulecache") if $'loglvl > 6;
  291. +         return 0;                    # Cannot write
  292. +     }
  293.       unless (open(CACHE, ">$cf'rulecache")) {
  294.           &'add_log("ERROR cannot create rule cache $cf'rulecache: $!")
  295.               if $'loglvl;
  296. ***************
  297. *** 303,311 ****
  298.       &write_fd(CACHE) || $error++;        # Write rules
  299.       &writevar_fd(CACHE) || $error++;    # And XENV variables
  300.       close(CACHE) || $error++;
  301.       if ($error) {
  302. -         &'add_log("WARNING could not cache rules") if $'loglvl > 5;
  303.           unlink $cf'rulecache;
  304.           return 0;
  305.       }
  306.       1;    # Success
  307. --- 310,319 ----
  308.       &write_fd(CACHE) || $error++;        # Write rules
  309.       &writevar_fd(CACHE) || $error++;    # And XENV variables
  310.       close(CACHE) || $error++;
  311. +     &'free_file($cf'rulecache);        # Unlock cache
  312.       if ($error) {
  313.           unlink $cf'rulecache;
  314. +         &'add_log("WARNING could not cache rules") if $'loglvl > 5;
  315.           return 0;
  316.       }
  317.       1;    # Success
  318. ***************
  319. *** 313,322 ****
  320. --- 321,336 ----
  321.   
  322.   # Read cached rules into @Rules and %Rules and returns 1 if done, 0 when
  323.   # the cache may not be read for whatever reason (e.g. out of date).
  324. + # Since the '-r' option may also need to cache rules and no mailagent lock
  325. + # is taken in that case, we need to lock the rule file before accessing it.
  326.   sub read_cache {
  327.       return 0 unless &cache_ok;
  328.       local(*CACHE);                    # File handle used to read the cache
  329.       local($_);
  330. +     if (0 != &'acs_rqst($cf'rulecache)) {
  331. +         &'add_log("NOTICE unable to read-lock $cf'rulecache") if $'loglvl > 6;
  332. +         return 0;                    # Cannot read
  333. +     }
  334.       open(CACHE, $cf'rulecache) || return 0;    # Cannot open, assume out of date
  335.       $_ = <CACHE>;                    # Disregard top line
  336.       while (<CACHE>) {                # First read the @Rules
  337. ***************
  338. *** 336,341 ****
  339. --- 350,356 ----
  340.           s/^\s*(\w+)\s*=\s*// && ($'XENV{$1} = $_);
  341.       }
  342.       close CACHE;
  343. +     &'free_file($cf'rulecache);        # Unlock cache
  344.       1;    # Success
  345.   }
  346.   
  347.  
  348. Index: agent/pl/analyze.pl
  349. Prereq: 3.0.1.1
  350. *** agent/pl/analyze.pl.old    Mon Apr 25 17:26:47 1994
  351. --- agent/pl/analyze.pl    Mon Apr 25 17:26:47 1994
  352. ***************
  353. *** 1,4 ****
  354. ! ;# $Id: analyze.pl,v 3.0.1.1 1994/01/26 09:30:23 ram Exp $
  355.   ;#
  356.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  357.   ;#  
  358. --- 1,4 ----
  359. ! ;# $Id: analyze.pl,v 3.0.1.2 1994/04/25 15:17:24 ram Exp $
  360.   ;#
  361.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  362.   ;#  
  363. ***************
  364. *** 9,14 ****
  365. --- 9,17 ----
  366.   ;#  of the source tree for mailagent 3.0.
  367.   ;#
  368.   ;# $Log: analyze.pl,v $
  369. + ;# Revision 3.0.1.2  1994/04/25  15:17:24  ram
  370. + ;# patch7: fixed selector combination logic and added some debug logs
  371. + ;#
  372.   ;# Revision 3.0.1.1  1994/01/26  09:30:23  ram
  373.   ;# patch5: now understands new -F option to force processing
  374.   ;#
  375. ***************
  376. *** 245,251 ****
  377.                   # Here it is the OR which is guaranteed to be optimized. Do
  378.                   # not attempt the match if an identical selector already
  379.                   # matched sucessfully.
  380. !                 unless ($Matched{$selist}) {
  381.                       $Matched{$selist} = &match($selector, $pattern, $range);
  382.                   }
  383.               }
  384. --- 248,254 ----
  385.                   # Here it is the OR which is guaranteed to be optimized. Do
  386.                   # not attempt the match if an identical selector already
  387.                   # matched sucessfully.
  388. !                 unless (defined $Matched{$selist} && $Matched{$selist}) {
  389.                       $Matched{$selist} = &match($selector, $pattern, $range);
  390.                   }
  391.               }
  392. ***************
  393. *** 257,270 ****
  394.   
  395.           $matched = 1;                        # Assume everything matched
  396.           foreach $key (keys %Matched) {        # All entries must have matched
  397. !             $matched = 0 unless $Matched{$key};
  398.           }
  399.           if ($matched) {                        # If %Matched failed, all failed!
  400.               foreach $key (keys %Inverted) {    # Only one entry needs to match
  401. !                 $matched = 0 unless $Inverted{$key};
  402.                   last if $matched;
  403.               }
  404.           }
  405.   
  406.           if ($matched) {                        # Execute action if pattern matched
  407.               # Make sure the rule has not already been executed in that mode
  408. --- 260,281 ----
  409.   
  410.           $matched = 1;                        # Assume everything matched
  411.           foreach $key (keys %Matched) {        # All entries must have matched
  412. !             $matched = $Matched{$key} ? 1 : 0;
  413. !             &add_log("rule #$j: direct $key " . ($matched ? 'ok' : 'failed'))
  414. !                 if $loglvl > 19;
  415. !             last unless $matched;
  416.           }
  417.           if ($matched) {                        # If %Matched failed, all failed!
  418.               foreach $key (keys %Inverted) {    # Only one entry needs to match
  419. !                 $matched = $Inverted{$key} ? 1 : 0;
  420. !                 &add_log("rule #$j: neg $key " . ($matched ? 'ok' : 'failed'))
  421. !                     if $loglvl > 19;
  422.                   last if $matched;
  423.               }
  424.           }
  425. +         &add_log("matching summary rule #$j: " . ($matched ? 'ok' : 'failed'))
  426. +             if $loglvl > 17;
  427.   
  428.           if ($matched) {                        # Execute action if pattern matched
  429.               # Make sure the rule has not already been executed in that mode
  430.  
  431. Index: agent/man/mailagent.SH
  432. Prereq: 3.0.1.2
  433. *** agent/man/mailagent.SH.old    Mon Apr 25 17:26:43 1994
  434. --- agent/man/mailagent.SH    Mon Apr 25 17:26:44 1994
  435. ***************
  436. *** 20,26 ****
  437.   .TH MAILAGENT $manext "Version $VERSION PL$PATCHLEVEL"
  438.   ''' @(#) Manual page for mailagent's filter -- (c) ram February 1991
  439.   '''
  440. ! ''' $Id: mailagent.SH,v 3.0.1.2 1994/01/26 09:29:24 ram Exp $
  441.   '''
  442.   '''  Copyright (c) 1990-1993, Raphael Manfredi
  443.   '''  
  444. --- 20,26 ----
  445.   .TH MAILAGENT $manext "Version $VERSION PL$PATCHLEVEL"
  446.   ''' @(#) Manual page for mailagent's filter -- (c) ram February 1991
  447.   '''
  448. ! ''' $Id: mailagent.SH,v 3.0.1.3 1994/04/25 15:15:56 ram Exp $
  449.   '''
  450.   '''  Copyright (c) 1990-1993, Raphael Manfredi
  451.   '''  
  452. ***************
  453. *** 31,36 ****
  454. --- 31,40 ----
  455.   '''  of the source tree for mailagent 3.0.
  456.   '''
  457.   ''' $Log: mailagent.SH,v $
  458. + ''' Revision 3.0.1.3  1994/04/25  15:15:56  ram
  459. + ''' patch7: documented new 'fromesc' config variable
  460. + ''' patch7: forgot to insert the new -F option in the synopsis line
  461. + '''
  462.   ''' Revision 3.0.1.2  1994/01/26  09:29:24  ram
  463.   ''' patch5: documents new tag feature for UNIQUE and RECORD
  464.   ''' patch5: documents new -F option
  465. ***************
  466. *** 55,61 ****
  467.   .SH NAME
  468.   mailagent \- an automatic mail-processing tool
  469.   .SH SYNOPSIS
  470. ! \fBmailagent\fR [ \fB\-dhilqtV\fR ] [ \fB\-s{umary}\fR ] [ \fB\-f\fI file\fR ]
  471.   [ \fB\-e\fI rule\fR ] [ \fB\-c\fI config\fR ] [ \fB\-L\fI loglevel\fR ]
  472.   [ \fB\-r\fI rulefile\fR ] [ \fB\-o\fI override\fR ] [ \fImailfile\fR ]
  473.   .SH DESCRIPTION
  474. --- 59,65 ----
  475.   .SH NAME
  476.   mailagent \- an automatic mail-processing tool
  477.   .SH SYNOPSIS
  478. ! \fBmailagent\fR [ \fB\-dhilqtFV\fR ] [ \fB\-s{umary}\fR ] [ \fB\-f\fI file\fR ]
  479.   [ \fB\-e\fI rule\fR ] [ \fB\-c\fI config\fR ] [ \fB\-L\fI loglevel\fR ]
  480.   [ \fB\-r\fI rulefile\fR ] [ \fB\-o\fI override\fR ] [ \fImailfile\fR ]
  481.   .SH DESCRIPTION
  482. ***************
  483. *** 225,230 ****
  484. --- 229,239 ----
  485.   .I emergdir
  486.   Name of the directory which should be used for dumps, preferably. This is
  487.   optional. (suggested: ~/tmp/lost+mail)
  488. + .TP
  489. + .I fromesc
  490. + Whether or not \fImailagent\fR should escape potentially dangerous \fIFrom\fR
  491. + lines in mail messages. If you use MH or if your mail reader does not use
  492. + those lines to separate messages, then you may set it to OFF. (suggested: ON)
  493.   .TP
  494.   .I hash
  495.   The directory used for name hashing by the built-in database used by ONCE,
  496.  
  497. Index: agent/test/cmd/pass.t
  498. Prereq: 3.0
  499. *** agent/test/cmd/pass.t.old    Mon Apr 25 17:26:53 1994
  500. --- agent/test/cmd/pass.t    Mon Apr 25 17:26:53 1994
  501. ***************
  502. *** 1,6 ****
  503.   # The PASS command
  504.   
  505. ! # $Id: pass.t,v 3.0 1993/11/29 13:49:37 ram Exp $
  506.   #
  507.   #  Copyright (c) 1990-1993, Raphael Manfredi
  508.   #  
  509. --- 1,6 ----
  510.   # The PASS command
  511.   
  512. ! # $Id: pass.t,v 3.0.1.1 1994/04/25 15:25:22 ram Exp $
  513.   #
  514.   #  Copyright (c) 1990-1993, Raphael Manfredi
  515.   #  
  516. ***************
  517. *** 11,32 ****
  518.   #  of the source tree for mailagent 3.0.
  519.   #
  520.   # $Log: pass.t,v $
  521.   # Revision 3.0  1993/11/29  13:49:37  ram
  522.   # Baseline for mailagent 3.0 netwide release.
  523.   #
  524.   
  525. ! do '../pl/cmd.pl';
  526.   unlink 'output';
  527.   
  528.   &add_header('X-Tag: pass');
  529.   `$cmd`;
  530.   $? == 0 || print "1\n";
  531.   -f 'output' || print "2\n";        # Where mail is saved
  532.   `grep -v X-Filter: output > comp`;
  533.   $? == 0 || print "3\n";
  534.   `grep -v and mail > ok`;
  535. ! ((-s 'comp') - 1) == -s 'ok' || print "4\n";    # SAVE adds extra final new-line
  536.   -s 'comp' != -s 'output' || print "5\n";    # Casually check X-Filter was there
  537.   
  538.   unlink 'output', 'mail', 'ok', 'comp';
  539.   print "0\n";
  540. --- 11,42 ----
  541.   #  of the source tree for mailagent 3.0.
  542.   #
  543.   # $Log: pass.t,v $
  544. + # Revision 3.0.1.1  1994/04/25  15:25:22  ram
  545. + # patch7: now make sure From line escaping is correctly removed
  546. + #
  547.   # Revision 3.0  1993/11/29  13:49:37  ram
  548.   # Baseline for mailagent 3.0 netwide release.
  549.   #
  550.   
  551. ! do '../pl/misc.pl';
  552.   unlink 'output';
  553.   
  554.   &add_header('X-Tag: pass');
  555. + &add_option("-o 'fromesc: OFF'");
  556. + open(MAIL, '>>mail');
  557. + print MAIL "\n>From test bug reported by Andy Seaborne <afs@hplb.hpl.hp.com>\n";
  558. + close MAIL;
  559.   `$cmd`;
  560.   $? == 0 || print "1\n";
  561.   -f 'output' || print "2\n";        # Where mail is saved
  562.   `grep -v X-Filter: output > comp`;
  563.   $? == 0 || print "3\n";
  564.   `grep -v and mail > ok`;
  565. ! # SAVE adds extra final new-line, but the leading '>' from From is removed
  566. ! (-s 'comp') == -s 'ok' || print "4\n";
  567.   -s 'comp' != -s 'output' || print "5\n";    # Casually check X-Filter was there
  568. + &get_log(6, 'output');
  569. + &check_log('^From test bug', 7) == 1 || print "8\n";
  570.   
  571.   unlink 'output', 'mail', 'ok', 'comp';
  572.   print "0\n";
  573.  
  574. Index: agent/test/filter/group.t
  575. Prereq: 3.0
  576. *** agent/test/filter/group.t.old    Mon Apr 25 17:26:53 1994
  577. --- agent/test/filter/group.t    Mon Apr 25 17:26:53 1994
  578. ***************
  579. *** 1,6 ****
  580.   # Test grouping of selectors (mixing normal and inverted selections)
  581.   
  582. ! # $Id: group.t,v 3.0 1993/11/29 13:49:59 ram Exp $
  583.   #
  584.   #  Copyright (c) 1990-1993, Raphael Manfredi
  585.   #  
  586. --- 1,6 ----
  587.   # Test grouping of selectors (mixing normal and inverted selections)
  588.   
  589. ! # $Id: group.t,v 3.0.1.1 1994/04/25 15:25:47 ram Exp $
  590.   #
  591.   #  Copyright (c) 1990-1993, Raphael Manfredi
  592.   #  
  593. ***************
  594. *** 11,24 ****
  595.   #  of the source tree for mailagent 3.0.
  596.   #
  597.   # $Log: group.t,v $
  598.   # Revision 3.0  1993/11/29  13:49:59  ram
  599.   # Baseline for mailagent 3.0 netwide release.
  600.   #
  601.   
  602.   do '../pl/filter.pl';
  603. - unlink 'never', 'always', 'always.2', 'always.3';
  604.   
  605.   &add_header('X-Tag: group');
  606.   `$cmd`;
  607.   $? == 0 || print "1\n";
  608.   -f "$user" && print "2\n";        # Mail has been deleted
  609. --- 11,34 ----
  610.   #  of the source tree for mailagent 3.0.
  611.   #
  612.   # $Log: group.t,v $
  613. + # Revision 3.0.1.1  1994/04/25  15:25:47  ram
  614. + # patch7: added three additional tests after a bug was found
  615. + #
  616.   # Revision 3.0  1993/11/29  13:49:59  ram
  617.   # Baseline for mailagent 3.0 netwide release.
  618.   #
  619.   
  620.   do '../pl/filter.pl';
  621.   
  622. + sub cleanup {
  623. +     unlink 'never', 'never.2', 'always', 'always.2', 'always.3',
  624. +         'always.4', 'always.5';
  625. + }
  626. + &add_header('Cc: guy_1@acri.fr, guy_2@eiffel.com, guy_3@inria.fr');
  627.   &add_header('X-Tag: group');
  628. + &cleanup;
  629.   `$cmd`;
  630.   $? == 0 || print "1\n";
  631.   -f "$user" && print "2\n";        # Mail has been deleted
  632. ***************
  633. *** 26,31 ****
  634.   -f 'always' || print "4\n";        # This one must have matched
  635.   -f 'always.2' || print "5\n";
  636.   -f 'always.3' || print "6\n";
  637.   
  638. ! unlink 'never', 'always', 'always.2', 'always.3';
  639.   print "0\n";
  640. --- 36,44 ----
  641.   -f 'always' || print "4\n";        # This one must have matched
  642.   -f 'always.2' || print "5\n";
  643.   -f 'always.3' || print "6\n";
  644. + -f 'never.2' && print "7\n";
  645. + -f 'always.4' || print "8\n";
  646. + -f 'always.5' || print "9\n";
  647.   
  648. ! &cleanup;
  649.   print "0\n";
  650.  
  651. Index: agent/test/rules
  652. Prereq: 3.0
  653. *** agent/test/rules.old    Mon Apr 25 17:26:54 1994
  654. --- agent/test/rules    Mon Apr 25 17:26:54 1994
  655. ***************
  656. *** 2,8 ****
  657.   # Mailagent rules for filter regression tests
  658.   #
  659.   
  660. ! # $Id: rules,v 3.0 1993/11/29 13:50:27 ram Exp $
  661.   #
  662.   #  Copyright (c) 1990-1993, Raphael Manfredi
  663.   #  
  664. --- 2,8 ----
  665.   # Mailagent rules for filter regression tests
  666.   #
  667.   
  668. ! # $Id: rules,v 3.0.1.1 1994/04/25 15:26:12 ram Exp $
  669.   #
  670.   #  Copyright (c) 1990-1993, Raphael Manfredi
  671.   #  
  672. ***************
  673. *** 13,18 ****
  674. --- 13,21 ----
  675.   #  of the source tree for mailagent 3.0.
  676.   #
  677.   # $Log: rules,v $
  678. + # Revision 3.0.1.1  1994/04/25  15:26:12  ram
  679. + # patch7: added three more tests in filter/group
  680. + #
  681.   # Revision 3.0  1993/11/29  13:50:27  ram
  682.   # Baseline for mailagent 3.0 netwide release.
  683.   #
  684. ***************
  685. *** 97,103 ****
  686.   <GROUP> !To !From: ram    { SAVE never };
  687.   <GROUP> To !From: !ram    { SAVE never };
  688.   <GROUP> !To !From: ram,
  689. !     !Subject !From: ram        { SAVE never };
  690.   <GROUP> !To: root, ram        { SAVE never };
  691.   <GROUP> !F.*: /compiler/    { SAVE never };
  692.   <GROUP> !From: ram, !To: ram    { SAVE always; REJECT };
  693. --- 100,106 ----
  694.   <GROUP> !To !From: ram    { SAVE never };
  695.   <GROUP> To !From: !ram    { SAVE never };
  696.   <GROUP> !To !From: ram,
  697. !     !Subject !To: ram        { SAVE never };
  698.   <GROUP> !To: root, ram        { SAVE never };
  699.   <GROUP> !F.*: /compiler/    { SAVE never };
  700.   <GROUP> !From: ram, !To: ram    { SAVE always; REJECT };
  701. ***************
  702. *** 107,113 ****
  703.   <GROUP> From !Cc !To: /compiler/,
  704.       From !Cc !To: ram,
  705.       !From To Cc: /eiffel/,
  706. !     !From To Cc: !/ice/            { SAVE always.3 };
  707.   
  708.   # filter/case
  709.   X-Tag: case, Cc: root    { STRIP Cc; SAVE always };
  710. --- 110,119 ----
  711.   <GROUP> From !Cc !To: /compiler/,
  712.       From !Cc !To: ram,
  713.       !From To Cc: /eiffel/,
  714. !     !From To Cc: !/ice/            { SAVE always.3; REJECT };
  715. ! <GROUP> !To !Cc: guy_3            { SAVE never.2 };
  716. ! <GROUP> !To Cc: guy_3            { SAVE always.4; REJECT };
  717. ! <GROUP> !To: unknown, !Subject !From: ram    { SAVE always.5 };
  718.   
  719.   # filter/case
  720.   X-Tag: case, Cc: root    { STRIP Cc; SAVE always };
  721.  
  722. Index: agent/pl/rfc822.pl
  723. Prereq: 3.0
  724. *** agent/pl/rfc822.pl.old    Mon Apr 25 17:26:50 1994
  725. --- agent/pl/rfc822.pl    Mon Apr 25 17:26:50 1994
  726. ***************
  727. *** 1,4 ****
  728. ! ;# $Id: rfc822.pl,v 3.0 1993/11/29 13:49:13 ram Exp $
  729.   ;#
  730.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  731.   ;#  
  732. --- 1,4 ----
  733. ! ;# $Id: rfc822.pl,v 3.0.1.1 1994/04/25 15:22:39 ram Exp $
  734.   ;#
  735.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  736.   ;#  
  737. ***************
  738. *** 9,14 ****
  739. --- 9,18 ----
  740.   ;#  of the source tree for mailagent 3.0.
  741.   ;#
  742.   ;# $Log: rfc822.pl,v $
  743. + ;# Revision 3.0.1.1  1994/04/25  15:22:39  ram
  744. + ;# patch7: now also understands @domain:user@other addresses
  745. + ;# patch7: more accurate for group name parsing
  746. + ;#
  747.   ;# Revision 3.0  1993/11/29  13:49:13  ram
  748.   ;# Baseline for mailagent 3.0 netwide release.
  749.   ;#
  750. ***************
  751. *** 55,65 ****
  752.   
  753.   # Parses an internet address and returns the login name of the sender. When
  754.   # facing an RFC 822 group addressing (like To: group:;), it returns the group
  755. ! # name.
  756.   sub login_name {
  757.       local($_) = shift(@_);                # The internet address
  758. !     if (/^(\S+):;/) {                    # rfc-822-group:;
  759. !         &last_name($1);
  760.       } elsif (s/^"(\S+)"@\S+/$1/) {        # "user@domain"@other
  761.           &login_name($_);                # parse user@domain
  762.       } elsif (s/^(\S+)@\S+/$1/) {        # user@domain.name
  763. --- 59,75 ----
  764.   
  765.   # Parses an internet address and returns the login name of the sender. When
  766.   # facing an RFC 822 group addressing (like To: group:;), it returns the group
  767. ! # name when mailbox is not specified.
  768.   sub login_name {
  769.       local($_) = shift(@_);                # The internet address
  770. !     if (/^(\S+):(\S*);/) {                # rfc-822-group:mailbox;
  771. !         if ($2 eq '') {
  772. !             &last_name($1);                # empty mailbox name, use phrase
  773. !         } else {
  774. !             &login_name($2);            # mailbox name
  775. !         }
  776. !     } elsif (s/^@\S+://) {                # @domain:user@other
  777. !         &login_name($_);                # parse user@other
  778.       } elsif (s/^"(\S+)"@\S+/$1/) {        # "user@domain"@other
  779.           &login_name($_);                # parse user@domain
  780.       } elsif (s/^(\S+)@\S+/$1/) {        # user@domain.name
  781.  
  782. Index: agent/pl/matching.pl
  783. Prereq: 3.0
  784. *** agent/pl/matching.pl.old    Mon Apr 25 17:26:48 1994
  785. --- agent/pl/matching.pl    Mon Apr 25 17:26:48 1994
  786. ***************
  787. *** 1,4 ****
  788. ! ;# $Id: matching.pl,v 3.0 1993/11/29 13:49:00 ram Exp $
  789.   ;#
  790.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  791.   ;#  
  792. --- 1,4 ----
  793. ! ;# $Id: matching.pl,v 3.0.1.1 1994/04/25 15:17:49 ram Exp $
  794.   ;#
  795.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  796.   ;#  
  797. ***************
  798. *** 9,14 ****
  799. --- 9,17 ----
  800.   ;#  of the source tree for mailagent 3.0.
  801.   ;#
  802.   ;# $Log: matching.pl,v $
  803. + ;# Revision 3.0.1.1  1994/04/25  15:17:49  ram
  804. + ;# patch7: fixed selector combination logic and added some debug logs
  805. + ;#
  806.   ;# Revision 3.0  1993/11/29  13:49:00  ram
  807.   ;# Baseline for mailagent 3.0 netwide release.
  808.   ;#
  809. ***************
  810. *** 143,157 ****
  811.                   $match = &selector_match($select, $pattern, $range);
  812.               }
  813.               if ($not) {                                # Negated test
  814. !                 $invert = !$match if $invert;
  815. !                 $inverted = $invert if !$match;        # '!' tests AND'ed
  816.               } else {
  817.                   $matched = $match;                    # Normal tests OR'ed
  818.               }
  819.               last if $matched;        # Stop when matching status known
  820.           }
  821.       }
  822. !     $matched || $inverted;            # Return matching status
  823.   }
  824.   
  825.   # Attempt a pattern match on a set of selectors, and set the special macro %&
  826. --- 146,166 ----
  827.                   $match = &selector_match($select, $pattern, $range);
  828.               }
  829.               if ($not) {                                # Negated test
  830. !                 $invert = !$match if $invert;        # '!' tests AND'ed
  831. !                 $inverted = $invert;                # Meaningful from now on
  832.               } else {
  833.                   $matched = $match;                    # Normal tests OR'ed
  834.               }
  835.               last if $matched;        # Stop when matching status known
  836.           }
  837.       }
  838. !     $matched = $matched || $inverted;
  839. !     if ($loglvl > 19) {
  840. !         local($logmsg) = "applied '$pattern' on '$selector' ($range) was ";
  841. !         $logmsg .= $matched ? "true" : "false";
  842. !         &add_log($logmsg);
  843. !     }
  844. !     $matched;                        # Return matching status
  845.   }
  846.   
  847.   # Attempt a pattern match on a set of selectors, and set the special macro %&
  848.  
  849. Index: agent/mailpatch.SH
  850. Prereq: 3.0
  851. *** agent/mailpatch.SH.old    Mon Apr 25 17:26:41 1994
  852. --- agent/mailpatch.SH    Mon Apr 25 17:26:41 1994
  853. ***************
  854. *** 20,26 ****
  855.       eval "exec perl -S \$0 \$*"
  856.           if \$running_under_some_shell;
  857.   
  858. ! # $Id: mailpatch.SH,v 3.0 1993/11/29 13:48:25 ram Exp $
  859.   #
  860.   #  Copyright (c) 1990-1993, Raphael Manfredi
  861.   #  
  862. --- 20,26 ----
  863.       eval "exec perl -S \$0 \$*"
  864.           if \$running_under_some_shell;
  865.   
  866. ! # $Id: mailpatch.SH,v 3.0.1.1 1994/04/25 15:12:06 ram Exp $
  867.   #
  868.   #  Copyright (c) 1990-1993, Raphael Manfredi
  869.   #  
  870. ***************
  871. *** 31,36 ****
  872. --- 31,39 ----
  873.   #  of the source tree for mailagent 3.0.
  874.   #
  875.   # $Log: mailpatch.SH,v $
  876. + # Revision 3.0.1.1  1994/04/25  15:12:06  ram
  877. + # patch7: removed incorrect sanity check for zcat (void when portable)
  878. + #
  879.   # Revision 3.0  1993/11/29  13:48:25  ram
  880.   # Baseline for mailagent 3.0 netwide release.
  881.   #
  882. ***************
  883. *** 261,274 ****
  884.           $append = $cat;
  885.           $extent = '';
  886.       } elsif (-f "$patchfile.Z") {    # Compressed patch
  887. !         if ($zcat ne 'zcat') {        # Zcat found by Configure
  888. !             $append = $zcat;
  889. !             $extent = '.Z';
  890. !         } else {
  891. !             &add_log("ERROR no zcat to uncompress patch #$num ($system)")
  892. !                 if $loglvl > 1;
  893. !             next;
  894. !         }
  895.       } else {
  896.           &add_log("ERROR no patch #$num ($system)") if $loglvl > 1;
  897.           next;
  898. --- 264,271 ----
  899.           $append = $cat;
  900.           $extent = '';
  901.       } elsif (-f "$patchfile.Z") {    # Compressed patch
  902. !         $append = $zcat;
  903. !         $extent = '.Z';
  904.       } else {
  905.           &add_log("ERROR no patch #$num ($system)") if $loglvl > 1;
  906.           next;
  907. ***************
  908. *** 289,294 ****
  909. --- 286,298 ----
  910.   ";
  911.       close TMP;
  912.       system "$append <$patchfile$extent >>$tmp/$patchfile";
  913. +     if ($? && $loglvl > 1) {
  914. +         &add_log("ERROR can't uncompress patch #$num ($system)")
  915. +             if $append eq $zcat;
  916. +         &add_log("ERROR can't copy patch #$num ($system)")
  917. +             if $append eq $cat;
  918. +         next;
  919. +     }
  920.       &add_log("copied file $patchfile into $tmp") if $loglvl > 17;
  921.   }
  922.   
  923.  
  924. Index: agent/pl/parse.pl
  925. Prereq: 3.0
  926. *** agent/pl/parse.pl.old    Mon Apr 25 17:26:48 1994
  927. --- agent/pl/parse.pl    Mon Apr 25 17:26:48 1994
  928. ***************
  929. *** 1,4 ****
  930. ! ;# $Id: parse.pl,v 3.0 1993/11/29 13:49:05 ram Exp $
  931.   ;#
  932.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  933.   ;#  
  934. --- 1,4 ----
  935. ! ;# $Id: parse.pl,v 3.0.1.1 1994/04/25 15:18:14 ram Exp $
  936.   ;#
  937.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  938.   ;#  
  939. ***************
  940. *** 9,14 ****
  941. --- 9,17 ----
  942.   ;#  of the source tree for mailagent 3.0.
  943.   ;#
  944.   ;# $Log: parse.pl,v $
  945. + ;# Revision 3.0.1.1  1994/04/25  15:18:14  ram
  946. + ;# patch7: global fix for From line escapes to make them configurable
  947. + ;#
  948.   ;# Revision 3.0  1993/11/29  13:49:05  ram
  949.   ;# Baseline for mailagent 3.0 netwide release.
  950.   ;#
  951. ***************
  952. *** 89,95 ****
  953.               last if $head_only;        # Stop parsing if only header wanted
  954.               $lines++;                                # One more line in body
  955.               $length += length($_);                    # Update length of message
  956. !             s/^From(\s)/>From$1/ if $last_was_nl;    # Escape From keyword
  957.               $last_was_nl = /^$/;                    # Keep track of single '\n'
  958.               $Header{'Body'} .= $_;
  959.               chop;
  960. --- 92,99 ----
  961.               last if $head_only;        # Stop parsing if only header wanted
  962.               $lines++;                                # One more line in body
  963.               $length += length($_);                    # Update length of message
  964. !             # Protect potentially dangerous lines when asked to do so
  965. !             s/^From(\s)/>From$1/ if $last_was_nl && $cf'fromesc =~ /on/i;
  966.               $last_was_nl = /^$/;                    # Keep track of single '\n'
  967.               $Header{'Body'} .= $_;
  968.               chop;
  969.  
  970. Index: agent/pl/read_conf.pl
  971. Prereq: 3.0
  972. *** agent/pl/read_conf.pl.old    Mon Apr 25 17:26:49 1994
  973. --- agent/pl/read_conf.pl    Mon Apr 25 17:26:49 1994
  974. ***************
  975. *** 1,4 ****
  976. ! ;# $Id: read_conf.pl,v 3.0 1993/11/29 13:49:12 ram Exp $
  977.   ;#
  978.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  979.   ;#  
  980. --- 1,4 ----
  981. ! ;# $Id: read_conf.pl,v 3.0.1.1 1994/04/25 15:21:34 ram Exp $
  982.   ;#
  983.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  984.   ;#  
  985. ***************
  986. *** 9,14 ****
  987. --- 9,17 ----
  988.   ;#  of the source tree for mailagent 3.0.
  989.   ;#
  990.   ;# $Log: read_conf.pl,v $
  991. + ;# Revision 3.0.1.1  1994/04/25  15:21:34  ram
  992. + ;# patch7: made sure new variable 'fromesc' has a meaningful default
  993. + ;#
  994.   ;# Revision 3.0  1993/11/29  13:49:12  ram
  995.   ;# Baseline for mailagent 3.0 netwide release.
  996.   ;#
  997. ***************
  998. *** 104,109 ****
  999. --- 107,115 ----
  1000.       $sendmail = $'mailer if $sendmail eq '';    # No sendmail program specified
  1001.       $sendnews = $'inews if $sendnews eq '';        # No news posting program
  1002.       $mailopt = '-odq' if $mailopt eq '' && $sendmail =~ /sendmail/;
  1003. +     # Backward compatibility -- RAM, 25/04/94
  1004. +     $fromesc = 'ON' unless defined $fromesc;    # If absent from ~/.mailagent
  1005.   
  1006.       # Update @INC perlib search path with the perlib variable. Paths not
  1007.       # starting by a '/' are supposed to be under the mailagent private lib
  1008.  
  1009. Index: agent/files/chkagent.sh
  1010. Prereq: 3.0
  1011. *** agent/files/chkagent.sh.old    Mon Apr 25 17:26:40 1994
  1012. --- agent/files/chkagent.sh    Mon Apr 25 17:26:40 1994
  1013. ***************
  1014. *** 1,6 ****
  1015.   #!/bin/sh
  1016.   #
  1017. ! # $Id: chkagent.sh,v 3.0 1993/11/29 13:47:49 ram Exp $
  1018.   #
  1019.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1020.   #  
  1021. --- 1,6 ----
  1022.   #!/bin/sh
  1023.   #
  1024. ! # $Id: chkagent.sh,v 3.0.1.1 1994/04/25 15:10:32 ram Exp $
  1025.   #
  1026.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1027.   #  
  1028. ***************
  1029. *** 11,22 ****
  1030.   #  of the source tree for mailagent 3.0.
  1031.   #
  1032.   # $Log: chkagent.sh,v $
  1033.   # Revision 3.0  1993/11/29  13:47:49  ram
  1034.   # Baseline for mailagent 3.0 netwide release.
  1035.   #
  1036.   
  1037.   # Make sure the mailagent is working well
  1038. ! lookat='ERROR|FAILED|WARNING|FATAL|DUMPED'
  1039.   
  1040.   trap "rm -f $report $output $todaylog $msg" 1 2 3 15
  1041.   
  1042. --- 11,25 ----
  1043.   #  of the source tree for mailagent 3.0.
  1044.   #
  1045.   # $Log: chkagent.sh,v $
  1046. + # Revision 3.0.1.1  1994/04/25  15:10:32  ram
  1047. + # patch7: also extract system error messages from logfile
  1048. + #
  1049.   # Revision 3.0  1993/11/29  13:47:49  ram
  1050.   # Baseline for mailagent 3.0 netwide release.
  1051.   #
  1052.   
  1053.   # Make sure the mailagent is working well
  1054. ! lookat='ERROR|FAILED|WARNING|FATAL|DUMPED|SYSERR'
  1055.   
  1056.   trap "rm -f $report $output $todaylog $msg" 1 2 3 15
  1057.   
  1058.  
  1059. Index: agent/files/mailagent.cf
  1060. Prereq: 3.0
  1061. *** agent/files/mailagent.cf.old    Mon Apr 25 17:26:40 1994
  1062. --- agent/files/mailagent.cf    Mon Apr 25 17:26:40 1994
  1063. ***************
  1064. *** 2,8 ****
  1065.   # Configuration file for mailagent
  1066.   #
  1067.   
  1068. ! # $Id: mailagent.cf,v 3.0 1993/11/29 13:48:02 ram Exp $
  1069.   #
  1070.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1071.   #  
  1072. --- 2,8 ----
  1073.   # Configuration file for mailagent
  1074.   #
  1075.   
  1076. ! # $Id: mailagent.cf,v 3.0.1.1 1994/04/25 15:11:03 ram Exp $
  1077.   #
  1078.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1079.   #  
  1080. ***************
  1081. *** 13,18 ****
  1082. --- 13,21 ----
  1083.   #  of the source tree for mailagent 3.0.
  1084.   #
  1085.   # $Log: mailagent.cf,v $
  1086. + # Revision 3.0.1.1  1994/04/25  15:11:03  ram
  1087. + # patch7: added new 'fromesc' config variable for From line escapes
  1088. + #
  1089.   # Revision 3.0  1993/11/29  13:48:02  ram
  1090.   # Baseline for mailagent 3.0 netwide release.
  1091.   #
  1092. ***************
  1093. *** 76,81 ****
  1094. --- 79,85 ----
  1095.   mailbox  : $user                # Mailbox file name (optional)
  1096.   mmdf     : OFF                    # Allow MMDF-style mailbox delivery
  1097.   mmdfbox  : OFF                    # Force new folders to MMDF format
  1098. + fromesc  : ON                    # Escape leading From into >From
  1099.   
  1100.   # MH-style folders
  1101.   mhprofile: ~/.mh_profile        # Name of the MH profile file (optional)
  1102.  
  1103. Index: agent/test/basic/config.t
  1104. Prereq: 3.0
  1105. *** agent/test/basic/config.t.old    Mon Apr 25 17:26:52 1994
  1106. --- agent/test/basic/config.t    Mon Apr 25 17:26:52 1994
  1107. ***************
  1108. *** 1,6 ****
  1109.   # This MUST be the first test ever run
  1110.   
  1111. ! # $Id: config.t,v 3.0 1993/11/29 13:49:23 ram Exp $
  1112.   #
  1113.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1114.   #  
  1115. --- 1,6 ----
  1116.   # This MUST be the first test ever run
  1117.   
  1118. ! # $Id: config.t,v 3.0.1.1 1994/04/25 15:24:33 ram Exp $
  1119.   #
  1120.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1121.   #  
  1122. ***************
  1123. *** 11,16 ****
  1124. --- 11,19 ----
  1125.   #  of the source tree for mailagent 3.0.
  1126.   #
  1127.   # $Log: config.t,v $
  1128. + # Revision 3.0.1.1  1994/04/25  15:24:33  ram
  1129. + # patch7: added commented 'fromesc' new variable
  1130. + #
  1131.   # Revision 3.0  1993/11/29  13:49:23  ram
  1132.   # Baseline for mailagent 3.0 netwide release.
  1133.   #
  1134. ***************
  1135. *** 49,54 ****
  1136. --- 52,58 ----
  1137.   rulecache: ~/.cache
  1138.   maildrop : $pwd            # Do not LEAVE messages in /usr/spool/mail
  1139.   mailbox  : \$user        # Use config variable, not current perl $user
  1140. + #fromesc  : ON            # Backward compatibility -- should be ON when absent
  1141.   hash     : dbr
  1142.   cleanlaps: 1M
  1143.   autoclean: OFF
  1144.  
  1145. Index: misc/unkit/unkit.pl
  1146. Prereq: 3.0
  1147. *** misc/unkit/unkit.pl.old    Mon Apr 25 17:26:55 1994
  1148. --- misc/unkit/unkit.pl    Mon Apr 25 17:26:56 1994
  1149. ***************
  1150. *** 1,4 ****
  1151. ! # $Id: unkit.pl,v 3.0 1993/11/29 13:50:34 ram Exp $
  1152.   #
  1153.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1154.   #  
  1155. --- 1,4 ----
  1156. ! # $Id: unkit.pl,v 3.0.1.1 1994/04/25 15:26:37 ram Exp $
  1157.   #
  1158.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1159.   #  
  1160. ***************
  1161. *** 9,14 ****
  1162. --- 9,17 ----
  1163.   #  of the source tree for mailagent 3.0.
  1164.   #
  1165.   # $Log: unkit.pl,v $
  1166. + # Revision 3.0.1.1  1994/04/25  15:26:37  ram
  1167. + # patch7: make sure unkit directory is not hidden by leading dot
  1168. + #
  1169.   # Revision 3.0  1993/11/29  13:50:34  ram
  1170.   # Baseline for mailagent 3.0 netwide release.
  1171.   #
  1172. ***************
  1173. *** 93,98 ****
  1174. --- 96,102 ----
  1175.       $name =~ s/\s+/./g;        # Escape all other spaces
  1176.       $name =~ s|/$||g;        # Remove trailing /
  1177.       $name =~ s|/|_|g;        # And transform all others into _
  1178. +     $name =~ s/^\.+//;        # Avoid hidden directories
  1179.       $name = substr($name, 0, 14) if length($name) > 14;
  1180.   
  1181.       $kitdir .= "/$name";    # Directory where unkit will proceed
  1182.  
  1183. Index: agent/test/actions
  1184. Prereq: 3.0.1.3
  1185. *** agent/test/actions.old    Mon Apr 25 17:26:51 1994
  1186. --- agent/test/actions    Mon Apr 25 17:26:51 1994
  1187. ***************
  1188. *** 2,8 ****
  1189.   # Mailagent rules for action regression tests
  1190.   #
  1191.   
  1192. ! # $Id: actions,v 3.0.1.3 1994/01/26 09:35:08 ram Exp $
  1193.   #
  1194.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1195.   #  
  1196. --- 2,8 ----
  1197.   # Mailagent rules for action regression tests
  1198.   #
  1199.   
  1200. ! # $Id: actions,v 3.0.1.4 1994/04/25 15:24:12 ram Exp $
  1201.   #
  1202.   #  Copyright (c) 1990-1993, Raphael Manfredi
  1203.   #  
  1204. ***************
  1205. *** 13,18 ****
  1206. --- 13,21 ----
  1207.   #  of the source tree for mailagent 3.0.
  1208.   #
  1209.   # $Log: actions,v $
  1210. + # Revision 3.0.1.4  1994/04/25  15:24:12  ram
  1211. + # patch7: check bug reported by Andy Seaborne <afs@hplb.hpl.hp.com>
  1212. + #
  1213.   # Revision 3.0.1.3  1994/01/26  09:35:08  ram
  1214.   # patch5: added new tests for UNIQUE and RECORD tags
  1215.   # patch5: ensure header-added recipients looked for in messages
  1216. ***************
  1217. *** 148,153 ****
  1218. --- 151,157 ----
  1219.   X-Tag: /pass/
  1220.   {
  1221.       PASS grep -v and;
  1222. +     PASS perl -p -e 's/^\>From /From /';
  1223.       SAVE output;
  1224.   }
  1225.   
  1226.  
  1227. Index: Credits
  1228. *** Credits.old    Mon Apr 25 17:26:39 1994
  1229. --- Credits    Mon Apr 25 17:26:39 1994
  1230. ***************
  1231. *** 139,145 ****
  1232.       rsmith@proteus.arc.nasa.gov
  1233.       s090@brems.ii.uib.no
  1234.       sondeen@ISI.EDU
  1235. -     wschmidt@iao.fhg.de
  1236.   
  1237.   If I forgot your name, please let me know, and accept my apologies -- not
  1238.   necessarily in that order ;-).
  1239. --- 139,144 ----
  1240.  
  1241. *** End of Patch 7 ***
  1242.  
  1243. exit 0 # Just in case...
  1244.