home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume44 / mailagent / patch16 < prev    next >
Encoding:
Internet Message Format  |  1994-09-22  |  28.5 KB

  1. From: Raphael Manfredi <ram@acri.fr>
  2. Newsgroups: comp.sources.misc
  3. Subject: v44i090:  mailagent - Flexible mail filtering and processing package, v3.0, Patch16
  4. Date: 22 Sep 1994 12:13:45 -0500
  5. Organization: Advanced Computer Research Institute, Lyon, France
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <35se09$r6d@sparky.sterling.com>
  9. X-Md4-Signature: 2975c8785801f98459d2b74b3bcff527
  10.  
  11. Submitted-by: Raphael Manfredi <ram@acri.fr>
  12. Posting-number: Volume 44, Issue 90
  13. Archive-name: mailagent/patch16
  14. Environment: UNIX, Perl
  15. Patch-To: mailagent: Volume 41, Issue 1-26
  16.  
  17. [The latest patch for mailagent version 3.0 is #16.]
  18.  
  19. System: mailagent version 3.0
  20. Patch #: 16
  21. Priority: MEDIUM
  22. Subject: patch #12, continued
  23. Date: Thu Sep 22 17:04:40 MET DST 1994
  24. From: Raphael Manfredi <ram@acri.fr>
  25.  
  26. Description:
  27.     See patch #12.
  28.  
  29.  
  30. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your mailagent source
  31.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  32.     If you don't have the patch program, apply the following by hand,
  33.     or get patch (version 2.0, latest patchlevel).
  34.  
  35.     After patching:
  36.         Configure -ders
  37.         make depend
  38.         make
  39.         make install
  40.         make install.man
  41.  
  42.     If patch indicates that patchlevel is the wrong version, you may need
  43.     to apply one or more previous patches, or the patch may already
  44.     have been applied.  See the patchlevel.h file to find out what has or
  45.     has not been applied.  In any event, don't continue with the patch.
  46.  
  47.     If you are missing previous patches they can be obtained from me:
  48.  
  49.         Raphael Manfredi <ram@acri.fr>
  50.  
  51.     If you send a mail message of the following form it will greatly speed
  52.     processing:
  53.  
  54.         Subject: Command
  55.         @SH mailpatch PATH mailagent 3.0 LIST
  56.                ^ note the c
  57.  
  58.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  59.     or in bang notation from some well-known host, and LIST is the number
  60.     of one or more patches you need, separated by spaces, commas, and/or
  61.     hyphens.  Saying 35- says everything from 35 to the end.
  62.  
  63.     To get some more detailed instructions, send me the following mail:
  64.  
  65.         Subject: Command
  66.         @SH mailhelp PATH
  67.  
  68.  
  69. Index: patchlevel.h
  70. Prereq: 15
  71. 4c4
  72. < #define PATCHLEVEL 15
  73. ---
  74. > #define PATCHLEVEL 16
  75.  
  76. Index: agent/pl/once.pl
  77. Prereq: 3.0
  78. *** agent/pl/once.pl.old    Thu Sep 22 16:43:18 1994
  79. --- agent/pl/once.pl    Thu Sep 22 16:43:18 1994
  80. ***************
  81. *** 1,4 ****
  82. ! ;# $Id: once.pl,v 3.0 1993/11/29 13:49:04 ram Exp $
  83.   ;#
  84.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  85.   ;#  
  86. --- 1,4 ----
  87. ! ;# $Id: once.pl,v 3.0.1.1 1994/09/22 14:28:42 ram Exp $
  88.   ;#
  89.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  90.   ;#  
  91. ***************
  92. *** 9,14 ****
  93. --- 9,17 ----
  94.   ;#  of the source tree for mailagent 3.0.
  95.   ;#
  96.   ;# $Log: once.pl,v $
  97. + ;# Revision 3.0.1.1  1994/09/22  14:28:42  ram
  98. + ;# patch12: removed useless test which prevented correct processing
  99. + ;#
  100.   ;# Revision 3.0  1993/11/29  13:49:04  ram
  101.   ;# Baseline for mailagent 3.0 netwide release.
  102.   ;#
  103. ***************
  104. *** 26,35 ****
  105.       local($ok) = 1;                        # Is once ok ?
  106.       local($timestamp) = 0;                # Time stamp attached to entry
  107.       local($linenum) = 0;                # Line where entry was found
  108. !     if (-f $file) {
  109. !         ($timestamp, $linenum) = &dbr'info($hname, 'ONCE', $tag);
  110. !         return 0 if $timestamp == -1;    # An error occurred
  111. !     }
  112.       local($now) = time;                    # Number of seconds since The Epoch
  113.       if (($timestamp + $period) > $now) {
  114.           &'add_log("we have to wait for ($hname, $tag)") if $'loglvl > 18;
  115. --- 29,36 ----
  116.       local($ok) = 1;                        # Is once ok ?
  117.       local($timestamp) = 0;                # Time stamp attached to entry
  118.       local($linenum) = 0;                # Line where entry was found
  119. !     ($timestamp, $linenum) = &dbr'info($hname, 'ONCE', $tag);
  120. !     return 0 if $timestamp == -1;        # An error occurred
  121.       local($now) = time;                    # Number of seconds since The Epoch
  122.       if (($timestamp + $period) > $now) {
  123.           &'add_log("we have to wait for ($hname, $tag)") if $'loglvl > 18;
  124.  
  125. Index: agent/files/mailagent.cf
  126. Prereq: 3.0.1.2
  127. *** agent/files/mailagent.cf.old    Thu Sep 22 16:42:49 1994
  128. --- agent/files/mailagent.cf    Thu Sep 22 16:42:50 1994
  129. ***************
  130. *** 2,8 ****
  131.   # Configuration file for mailagent
  132.   #
  133.   
  134. ! # $Id: mailagent.cf,v 3.0.1.2 1994/07/01 14:51:36 ram Exp $
  135.   #
  136.   #  Copyright (c) 1990-1993, Raphael Manfredi
  137.   #  
  138. --- 2,8 ----
  139.   # Configuration file for mailagent
  140.   #
  141.   
  142. ! # $Id: mailagent.cf,v 3.0.1.3 1994/09/22 13:44:11 ram Exp $
  143.   #
  144.   #  Copyright (c) 1990-1993, Raphael Manfredi
  145.   #  
  146. ***************
  147. *** 13,18 ****
  148. --- 13,21 ----
  149.   #  of the source tree for mailagent 3.0.
  150.   #
  151.   # $Log: mailagent.cf,v $
  152. + # Revision 3.0.1.3  1994/09/22  13:44:11  ram
  153. + # patch12: new config parameters callout and linkdirs
  154. + #
  155.   # Revision 3.0.1.2  1994/07/01  14:51:36  ram
  156.   # patch8: eleven new config variables for better tuning
  157.   #
  158. ***************
  159. *** 69,74 ****
  160. --- 72,78 ----
  161.   queue    : $spool/queue            # Queue directory (must exist)
  162.   logdir   : ~/var/log            # Where logfile is stored
  163.   context  : $spool/context        # Mailagent's context file
  164. + callout  : $spool/callout        # Callout queue
  165.   log      : agentlog                # Log file is in $logdir
  166.   seq      : .seq                    # Seq file is in $spool
  167.   timezone : PST8PDT                # Time zone location
  168. ***************
  169. *** 77,82 ****
  170. --- 81,87 ----
  171.   rulecache: $spool/rulecache        # Cache for compiled rules (optional)
  172.   nfslock  : OFF                    # NFS-secure locking (optional)
  173.   secure   : ON                    # Make extended checks on sensitive files
  174. + linkdirs : ON                    # Also carefully check symlinks to dirs
  175.   
  176.   # Mailbox parameters
  177.   maildrop : /usr/mail            # System mail drop directory (optional)
  178.  
  179. Index: agent/test/cmd/do.t
  180. *** agent/test/cmd/do.t.old    Thu Sep 22 16:43:29 1994
  181. --- agent/test/cmd/do.t    Thu Sep 22 16:43:29 1994
  182. ***************
  183. *** 0 ****
  184. --- 1,61 ----
  185. + # Test DO command
  186. + # $Id: do.t,v 3.0.1.1 1994/09/22 14:41:01 ram Exp $
  187. + #
  188. + #  Copyright (c) 1990-1993, Raphael Manfredi
  189. + #  
  190. + #  You may redistribute only under the terms of the Artistic License,
  191. + #  as specified in the README file that comes with the distribution.
  192. + #  You may reuse parts of this distribution only within the terms of
  193. + #  that same Artistic License; a copy of which may be found at the root
  194. + #  of the source tree for mailagent 3.0.
  195. + #
  196. + # $Log: do.t,v $
  197. + # Revision 3.0.1.1  1994/09/22  14:41:01  ram
  198. + # patch12: created
  199. + #
  200. + do '../pl/cmd.pl';
  201. + sub cleanup {
  202. +     unlink 'perl.1', 'perl.2', 'never', 'always', 'always.2';
  203. + }
  204. + &cleanup;
  205. + open(PERL, ">perl.1") || print "1\n";
  206. + print PERL <<'EOP';
  207. + sub perl_1 {
  208. +     local($name) = @_;
  209. +     &mailhook'save($name);
  210. + }
  211. + EOP
  212. + close PERL;
  213. + open(PERL, ">perl.2") || print "2\n";
  214. + print PERL <<'EOP';
  215. + sub perl_2 {
  216. +     return if defined &main'perl_1;
  217. +     return unless defined &__test__'perl_1;
  218. +     local($mode) = @_;
  219. +     &mailhook'reject($mode);
  220. + }
  221. + sub __foo__'perl_3 {
  222. +     local($name) = @_;
  223. +     return unless defined &perl_2;
  224. +     return if defined $name;
  225. +     &mailhook'abort;
  226. + }
  227. + EOP
  228. + close PERL;
  229. + &add_header('X-Tag: do');
  230. + `$cmd`;
  231. + $? == 0 || print "3\n";
  232. + -f "$user" && print "4\n";
  233. + -f 'never' && print "5\n";
  234. + -f 'always' || print "6\n";
  235. + -f 'always.2' || print "7\n";
  236. + unlink 'mail';
  237. + &cleanup;
  238. + print "0\n";
  239.  
  240. Index: agent/pl/checklock.pl
  241. Prereq: 3.0.1.1
  242. *** agent/pl/checklock.pl.old    Thu Sep 22 16:43:07 1994
  243. --- agent/pl/checklock.pl    Thu Sep 22 16:43:07 1994
  244. ***************
  245. *** 1,4 ****
  246. ! ;# $Id: checklock.pl,v 3.0.1.1 1994/07/01 15:00:20 ram Exp $
  247.   ;#
  248.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  249.   ;#  
  250. --- 1,4 ----
  251. ! ;# $Id: checklock.pl,v 3.0.1.2 1994/09/22 14:15:13 ram Exp $
  252.   ;#
  253.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  254.   ;#  
  255. ***************
  256. *** 9,14 ****
  257. --- 9,17 ----
  258.   ;#  of the source tree for mailagent 3.0.
  259.   ;#
  260.   ;# $Log: checklock.pl,v $
  261. + ;# Revision 3.0.1.2  1994/09/22  14:15:13  ram
  262. + ;# patch12: localized variables used by stat()
  263. + ;#
  264.   ;# Revision 3.0.1.1  1994/07/01  15:00:20  ram
  265.   ;# patch8: now honours new lockhold config variable for lock breaking
  266.   ;#
  267. ***************
  268. *** 24,30 ****
  269.       local($lockfile) = $file . $lockext;    # Add lock extension
  270.       if (-f $lockfile) {
  271.           # There is a lock file -- look for how long it's been there
  272. !         ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  273.               $atime,$mtime,$ctime,$blksize,$blocks) = stat($lockfile);
  274.           if ((time - $mtime) > $cf'lockhold) {
  275.               # More than outdating time!! Something must have gone wrong
  276. --- 27,33 ----
  277.       local($lockfile) = $file . $lockext;    # Add lock extension
  278.       if (-f $lockfile) {
  279.           # There is a lock file -- look for how long it's been there
  280. !         local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  281.               $atime,$mtime,$ctime,$blksize,$blocks) = stat($lockfile);
  282.           if ((time - $mtime) > $cf'lockhold) {
  283.               # More than outdating time!! Something must have gone wrong
  284.  
  285. Index: agent/pl/package.pl
  286. *** agent/pl/package.pl.old    Thu Sep 22 16:43:18 1994
  287. --- agent/pl/package.pl    Thu Sep 22 16:43:18 1994
  288. ***************
  289. *** 0 ****
  290. --- 1,44 ----
  291. + ;# $Id: package.pl,v 3.0.1.1 1994/09/22 14:29:07 ram Exp $
  292. + ;#
  293. + ;#  Copyright (c) 1990-1993, Raphael Manfredi
  294. + ;#  
  295. + ;#  You may redistribute only under the terms of the Artistic License,
  296. + ;#  as specified in the README file that comes with the distribution.
  297. + ;#  You may reuse parts of this distribution only within the terms of
  298. + ;#  that same Artistic License; a copy of which may be found at the root
  299. + ;#  of the source tree for mailagent 3.0.
  300. + ;#
  301. + ;# $Log: package.pl,v $
  302. + ;# Revision 3.0.1.1  1994/09/22  14:29:07  ram
  303. + ;# patch12: created
  304. + ;#
  305. + ;#
  306. + # Get at the .package file, created by the dist program packinit.
  307. + # Returns true if package file was read and sourced correctly within
  308. + # the pkg package, false otherwise (in which case we are likely not to
  309. + # be within a package source tree).
  310. + sub read_package {
  311. +     local($pack) = '.package';
  312. +     unless (-f $pack) {
  313. +         local(@path) = ( '..', '../..', '../../..', '../../../..');
  314. +         foreach $dir (@path) {
  315. +             if (-f "$dir/$pack") {
  316. +                 $pack = "$dir/$pack";
  317. +                 last;
  318. +             }
  319. +         }
  320. +     }
  321. +     return 0 unless -f $pack;
  322. +     open(PACKAGE, $pack) || return 0;
  323. +     while (<PACKAGE>) {
  324. +         next if /^:/;
  325. +         next if /^#/;
  326. +         if (($var,$val) = /^\s*(\w+)=(.*)/) {
  327. +             $val = "\"$val\"" unless $val =~ /^['"]/;
  328. +             eval "\$pkg'$var = $val;";
  329. +         }
  330. +     }
  331. +     close PACKAGE;
  332. +     return 1;
  333. + }
  334.  
  335. Index: agent/pl/history.pl
  336. Prereq: 3.0.1.1
  337. *** agent/pl/history.pl.old    Thu Sep 22 16:43:13 1994
  338. --- agent/pl/history.pl    Thu Sep 22 16:43:13 1994
  339. ***************
  340. *** 1,4 ****
  341. ! ;# $Id: history.pl,v 3.0.1.1 1994/01/26 09:32:54 ram Exp $
  342.   ;#
  343.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  344.   ;#  
  345. --- 1,4 ----
  346. ! ;# $Id: history.pl,v 3.0.1.2 1994/09/22 14:22:10 ram Exp $
  347.   ;#
  348.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  349.   ;#  
  350. ***************
  351. *** 9,14 ****
  352. --- 9,17 ----
  353.   ;#  of the source tree for mailagent 3.0.
  354.   ;#
  355.   ;# $Log: history.pl,v $
  356. + ;# Revision 3.0.1.2  1994/09/22  14:22:10  ram
  357. + ;# patch12: added escapes in regexp for perl5 support
  358. + ;#
  359.   ;# Revision 3.0.1.1  1994/01/26  09:32:54  ram
  360.   ;# patch5: history can now handle distinct tags on messages
  361.   ;#
  362. ***************
  363. *** 39,45 ****
  364.           # message id, which is the case unless the address is in uucp form.
  365.           $msg_id = $Header{'Date'};
  366.           local($from, $comment) = &parse_address($Header{'From'});
  367. !         $from =~ s/^([\w-.]+)!([\w-.]+)/@$1:$2/;    # host!user -> @host:user
  368.           $msg_id .= '.' . $from if $msg_id;
  369.       }
  370.       $msg_id =~ s/\s+/./g;            # Suppress all spaces
  371. --- 42,48 ----
  372.           # message id, which is the case unless the address is in uucp form.
  373.           $msg_id = $Header{'Date'};
  374.           local($from, $comment) = &parse_address($Header{'From'});
  375. !         $from =~ s/^([\w-.]+)!([\w-.]+)/\@$1:$2/;    # host!user -> @host:user
  376.           $msg_id .= '.' . $from if $msg_id;
  377.       }
  378.       $msg_id =~ s/\s+/./g;            # Suppress all spaces
  379.  
  380. Index: agent/pl/add_log.pl
  381. Prereq: 3.0
  382. *** agent/pl/add_log.pl.old    Thu Sep 22 16:43:04 1994
  383. --- agent/pl/add_log.pl    Thu Sep 22 16:43:04 1994
  384. ***************
  385. *** 1,4 ****
  386. ! ;# $Id: add_log.pl,v 3.0 1993/11/29 13:48:34 ram Exp $
  387.   ;#
  388.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  389.   ;#  
  390. --- 1,4 ----
  391. ! ;# $Id: add_log.pl,v 3.0.1.1 1994/09/22 14:08:11 ram Exp $
  392.   ;#
  393.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  394.   ;#  
  395. ***************
  396. *** 9,14 ****
  397. --- 9,17 ----
  398.   ;#  of the source tree for mailagent 3.0.
  399.   ;#
  400.   ;# $Log: add_log.pl,v $
  401. + ;# Revision 3.0.1.1  1994/09/22  14:08:11  ram
  402. + ;# patch12: now escapes square brackets in strings for perl5
  403. + ;#
  404.   ;# Revision 3.0  1993/11/29  13:48:34  ram
  405.   ;# Baseline for mailagent 3.0 netwide release.
  406.   ;#
  407. ***************
  408. *** 106,112 ****
  409.           localtime(time);
  410.       $date = sprintf("%.2d/%.2d/%.2d %.2d:%.2d:%.2d",
  411.           $year,++$mon,$mday,$hour,$min,$sec);
  412. !     $log = $date . " $'prog_name[$'jobnum]: $msg\n";
  413.   
  414.       # If we cannot append to the logfile, first check whether it is the default
  415.       # logfile or not. If it is not, then add a log entry to state the error in
  416. --- 109,115 ----
  417.           localtime(time);
  418.       $date = sprintf("%.2d/%.2d/%.2d %.2d:%.2d:%.2d",
  419.           $year,++$mon,$mday,$hour,$min,$sec);
  420. !     $log = $date . " $'prog_name\[$'jobnum\]: $msg\n";
  421.   
  422.       # If we cannot append to the logfile, first check whether it is the default
  423.       # logfile or not. If it is not, then add a log entry to state the error in
  424.  
  425. Index: bin/perload
  426. Prereq: 3.0
  427. *** bin/perload.old    Thu Sep 22 16:43:30 1994
  428. --- bin/perload    Thu Sep 22 16:43:30 1994
  429. ***************
  430. *** 8,14 ****
  431.   # This perl script is its own manual page [generated by wrapman]
  432.   #
  433.   
  434. ! # $Id: perload,v 3.0 1993/11/29 13:50:28 ram Exp $
  435.   #
  436.   #  Copyright (c) 1990-1993, Raphael Manfredi
  437.   #  
  438. --- 8,14 ----
  439.   # This perl script is its own manual page [generated by wrapman]
  440.   #
  441.   
  442. ! # $Id: perload,v 3.0.1.1 1994/09/22 14:41:41 ram Exp $
  443.   #
  444.   #  Copyright (c) 1990-1993, Raphael Manfredi
  445.   #  
  446. ***************
  447. *** 19,24 ****
  448. --- 19,27 ----
  449.   #  of the source tree for mailagent 3.0.
  450.   #
  451.   # $Log: perload,v $
  452. + # Revision 3.0.1.1  1994/09/22  14:41:41  ram
  453. + # patch12: added minimal support for perl5 dataloading
  454. + #
  455.   # Revision 3.0  1993/11/29  13:50:28  ram
  456.   # Baseline for mailagent 3.0 netwide release.
  457.   #
  458. ***************
  459. *** 162,167 ****
  460. --- 165,171 ----
  461.   :sub main'autoload {
  462.   :    local($__file__) = shift(@_);
  463.   :    local($__packname__) = (caller(1))[3];
  464. + :    $__packname__ =~ s/::/'/;
  465.   :    local($__rpackname__) = $__packname__;
  466.   :    local($__saved__) = $@;
  467.   :    $__rpackname__ =~ s/^auto_//;
  468. ***************
  469. *** 243,248 ****
  470. --- 247,253 ----
  471.   :# called only once per routine to be loaded.
  472.   :sub main'dataload {
  473.   :    local($__packname__) = (caller(1))[3];
  474. + :    $__packname__ =~ s/::/'/;
  475.   :    local($__rpackname__) = $__packname__;
  476.   :    local($__at__) = $@;
  477.   :    $__rpackname__ =~ s/^auto_//;
  478.  
  479. Index: agent/filter/msg.c
  480. Prereq: 3.0
  481. *** agent/filter/msg.c.old    Thu Sep 22 16:42:52 1994
  482. --- agent/filter/msg.c    Thu Sep 22 16:42:52 1994
  483. ***************
  484. *** 11,17 ****
  485.   */
  486.   
  487.   /*
  488. !  * $Id: msg.c,v 3.0 1993/11/29 13:48:17 ram Exp $
  489.    *
  490.    *  Copyright (c) 1990-1993, Raphael Manfredi
  491.    *  
  492. --- 11,17 ----
  493.   */
  494.   
  495.   /*
  496. !  * $Id: msg.c,v 3.0.1.1 1994/09/22 13:46:01 ram Exp $
  497.    *
  498.    *  Copyright (c) 1990-1993, Raphael Manfredi
  499.    *  
  500. ***************
  501. *** 22,27 ****
  502. --- 22,30 ----
  503.    *  of the source tree for mailagent 3.0.
  504.    *
  505.    * $Log: msg.c,v $
  506. +  * Revision 3.0.1.1  1994/09/22  13:46:01  ram
  507. +  * patch12: made fatal() arguments long rather than int for 64-bit machines
  508. +  *
  509.    * Revision 3.0  1993/11/29  13:48:17  ram
  510.    * Baseline for mailagent 3.0 netwide release.
  511.    *
  512. ***************
  513. *** 42,48 ****
  514.   /* VARARGS2 */
  515.   public void fatal(reason, arg1, arg2, arg3, arg4, arg5)
  516.   char *reason;
  517. ! int arg1, arg2, arg3, arg4, arg5;
  518.   {
  519.       /* Fatal error -- die with a meaningful error status for sendmail. If the
  520.        * logfile has been opened, the reason will also be logged there.
  521. --- 45,51 ----
  522.   /* VARARGS2 */
  523.   public void fatal(reason, arg1, arg2, arg3, arg4, arg5)
  524.   char *reason;
  525. ! long arg1, arg2, arg3, arg4, arg5;    /* Use longs, hope (char *) fits in it! */
  526.   {
  527.       /* Fatal error -- die with a meaningful error status for sendmail. If the
  528.        * logfile has been opened, the reason will also be logged there.
  529.  
  530. Index: agent/pl/makedir.pl
  531. Prereq: 3.0.1.1
  532. *** agent/pl/makedir.pl.old    Thu Sep 22 16:43:16 1994
  533. --- agent/pl/makedir.pl    Thu Sep 22 16:43:16 1994
  534. ***************
  535. *** 1,4 ****
  536. ! ;# $Id: makedir.pl,v 3.0.1.1 1994/07/01 15:02:07 ram Exp $
  537.   ;#
  538.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  539.   ;#  
  540. --- 1,4 ----
  541. ! ;# $Id: makedir.pl,v 3.0.1.2 1994/09/22 14:26:47 ram Exp $
  542.   ;#
  543.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  544.   ;#  
  545. ***************
  546. *** 9,14 ****
  547. --- 9,17 ----
  548.   ;#  of the source tree for mailagent 3.0.
  549.   ;#
  550.   ;# $Log: makedir.pl,v $
  551. + ;# Revision 3.0.1.2  1994/09/22  14:26:47  ram
  552. + ;# patch12: fixed regexp for perl5 support
  553. + ;#
  554.   ;# Revision 3.0.1.1  1994/07/01  15:02:07  ram
  555.   ;# patch8: default mode is now 0777, relies on umask for proper setting
  556.   ;#
  557. ***************
  558. *** 27,33 ****
  559.       $dir =~ s|/$||;                # no trailing / or we'll try to make dir twice
  560.       if (!-d $dir && $dir ne '') {
  561.           # Make parent dir first
  562. !         &makedir($parent, $mode) if ($parent = $dir) =~ s|(.*)/.*|\1|;
  563.           if (mkdir($dir, $mode)) {
  564.               &add_log("creating directory $dir") if $loglvl > 19;
  565.           } else {
  566. --- 30,36 ----
  567.       $dir =~ s|/$||;                # no trailing / or we'll try to make dir twice
  568.       if (!-d $dir && $dir ne '') {
  569.           # Make parent dir first
  570. !         &makedir($parent, $mode) if ($parent = $dir) =~ s|(.*)/.*|$1|;
  571.           if (mkdir($dir, $mode)) {
  572.               &add_log("creating directory $dir") if $loglvl > 19;
  573.           } else {
  574.  
  575. Index: agent/pl/getdate.pl
  576. Prereq: 3.0
  577. *** agent/pl/getdate.pl.old    Thu Sep 22 16:43:12 1994
  578. --- agent/pl/getdate.pl    Thu Sep 22 16:43:12 1994
  579. ***************
  580. *** 47,53 ****
  581.   ;# Below are logging information for this package as included in the
  582.   ;# mailagent program.
  583.   ;#
  584. ! ;# $Id: getdate.pl,v 3.0 1993/11/29 13:48:48 ram Exp $
  585.   ;#
  586.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  587.   ;#  
  588. --- 47,53 ----
  589.   ;# Below are logging information for this package as included in the
  590.   ;# mailagent program.
  591.   ;#
  592. ! ;# $Id: getdate.pl,v 3.0.1.1 1994/09/22 14:21:31 ram Exp $
  593.   ;#
  594.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  595.   ;#  
  596. ***************
  597. *** 58,63 ****
  598. --- 58,66 ----
  599.   ;#  of the source tree for mailagent 3.0.
  600.   ;#
  601.   ;# $Log: getdate.pl,v $
  602. + ;# Revision 3.0.1.1  1994/09/22  14:21:31  ram
  603. + ;# patch12: local() statement was missing in &getdate parameters fetch
  604. + ;#
  605.   ;# Revision 3.0  1993/11/29  13:48:48  ram
  606.   ;# Baseline for mailagent 3.0 netwide release.
  607.   ;#
  608. ***************
  609. *** 911,918 ****
  610.   }
  611.   
  612.   sub main'getdate {
  613. !     ($dtstr, $now, $timezone) = @_;
  614. !     local($now, $timezone);
  615.       local(@lt);
  616.       local($sdate);
  617.       local($TZ);
  618. --- 914,920 ----
  619.   }
  620.   
  621.   sub main'getdate {
  622. !     local($dtstr, $now, $timezone) = @_;
  623.       local(@lt);
  624.       local($sdate);
  625.       local($TZ);
  626.  
  627. Index: agent/pl/file_edit.pl
  628. Prereq: 3.0
  629. *** agent/pl/file_edit.pl.old    Thu Sep 22 16:43:10 1994
  630. --- agent/pl/file_edit.pl    Thu Sep 22 16:43:10 1994
  631. ***************
  632. *** 1,4 ****
  633. ! ;# $Id: file_edit.pl,v 3.0 1993/11/29 13:48:46 ram Exp $
  634.   ;#
  635.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  636.   ;#  
  637. --- 1,4 ----
  638. ! ;# $Id: file_edit.pl,v 3.0.1.1 1994/09/22 14:19:09 ram Exp $
  639.   ;#
  640.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  641.   ;#  
  642. ***************
  643. *** 9,14 ****
  644. --- 9,17 ----
  645.   ;#  of the source tree for mailagent 3.0.
  646.   ;#
  647.   ;# $Log: file_edit.pl,v $
  648. + ;# Revision 3.0.1.1  1994/09/22  14:19:09  ram
  649. + ;# patch12: typo prevented correct indexing in the @insert array
  650. + ;#
  651.   ;# Revision 3.0  1993/11/29  13:48:46  ram
  652.   ;# Baseline for mailagent 3.0 netwide release.
  653.   ;#
  654. ***************
  655. *** 190,196 ****
  656.                   $found++;
  657.               } elsif ($type == $PATTERN) {
  658.                   study unless $studied++;    # Optimize pattern matching
  659. !                 ($found++, @insert[$i] = 0) if /$val/;
  660.               } elsif ($type == $SUB && &$val($_, $.)) {
  661.                   $found++;
  662.               }
  663. --- 193,199 ----
  664.                   $found++;
  665.               } elsif ($type == $PATTERN) {
  666.                   study unless $studied++;    # Optimize pattern matching
  667. !                 ($found++, $insert[$i] = 0) if /$val/;
  668.               } elsif ($type == $SUB && &$val($_, $.)) {
  669.                   $found++;
  670.               }
  671.  
  672. Index: agent/pl/mh.pl
  673. Prereq: 3.0.1.1
  674. *** agent/pl/mh.pl.old    Thu Sep 22 16:43:16 1994
  675. --- agent/pl/mh.pl    Thu Sep 22 16:43:16 1994
  676. ***************
  677. *** 1,4 ****
  678. ! ;# $Id: mh.pl,v 3.0.1.1 1993/12/15 09:04:12 ram Exp $
  679.   ;#
  680.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  681.   ;#  
  682. --- 1,4 ----
  683. ! ;# $Id: mh.pl,v 3.0.1.2 1994/09/22 14:27:16 ram Exp $
  684.   ;#
  685.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  686.   ;#  
  687. ***************
  688. *** 9,14 ****
  689. --- 9,17 ----
  690.   ;#  of the source tree for mailagent 3.0.
  691.   ;#
  692.   ;# $Log: mh.pl,v $
  693. + ;# Revision 3.0.1.2  1994/09/22  14:27:16  ram
  694. + ;# patch12: now updates folder_saved variable with file pathname
  695. + ;#
  696.   ;# Revision 3.0.1.1  1993/12/15  09:04:12  ram
  697.   ;# patch3: log mesages were not emitted correctly
  698.   ;#
  699. ***************
  700. *** 90,96 ****
  701.           if $mh eq 'MH' && $Profile{'Unseen-Sequence'} ne '' && !$failed;
  702.   
  703.       &'add_log("UNSEEN $name") if $'loglvl > 6;    # Mark clearly in log
  704. !     return $failed;        # Return failure status
  705.   }
  706.   
  707.   #
  708. --- 93,100 ----
  709.           if $mh eq 'MH' && $Profile{'Unseen-Sequence'} ne '' && !$failed;
  710.   
  711.       &'add_log("UNSEEN $name") if $'loglvl > 6;    # Mark clearly in log
  712. !     $'folder_saved = $name;        # Keep track of last folder we save into
  713. !     return $failed;                # Return failure status
  714.   }
  715.   
  716.   #
  717.  
  718. Index: agent/test/actions
  719. Prereq: 3.0.1.5
  720. *** agent/test/actions.old    Thu Sep 22 16:43:26 1994
  721. --- agent/test/actions    Thu Sep 22 16:43:27 1994
  722. ***************
  723. *** 2,8 ****
  724.   # Mailagent rules for action regression tests
  725.   #
  726.   
  727. ! # $Id: actions,v 3.0.1.5 1994/07/01 15:06:56 ram Exp $
  728.   #
  729.   #  Copyright (c) 1990-1993, Raphael Manfredi
  730.   #  
  731. --- 2,8 ----
  732.   # Mailagent rules for action regression tests
  733.   #
  734.   
  735. ! # $Id: actions,v 3.0.1.6 1994/09/22 14:40:32 ram Exp $
  736.   #
  737.   #  Copyright (c) 1990-1993, Raphael Manfredi
  738.   #  
  739. ***************
  740. *** 13,18 ****
  741. --- 13,21 ----
  742.   #  of the source tree for mailagent 3.0.
  743.   #
  744.   # $Log: actions,v $
  745. + # Revision 3.0.1.6  1994/09/22  14:40:32  ram
  746. + # patch12: added regression tests for DO
  747. + #
  748.   # Revision 3.0.1.5  1994/07/01  15:06:56  ram
  749.   # patch8: added exit status test for PERL command
  750.   # patch8: added new test for vacation message with tome config variable
  751. ***************
  752. *** 97,102 ****
  753. --- 100,114 ----
  754.   X-Tag: /bounce 2/            { BOUNCE "list" };
  755.   
  756.   X-Tag: /delete/                { DELETE };
  757. + X-Tag: /do\b/
  758. + {
  759. +     REQUIRE perl.1 __test__;
  760. +     DO __test__'perl_1('always');
  761. +     DO perl.2:__test__'perl_2("DO");
  762. +     SAVE never;
  763. + };
  764. + <DO>    { SAVE always.2; DO __foo__'perl_3; SAVE never; };
  765.   
  766.   X-Tag: /feed/
  767.   {
  768.  
  769. Index: agent/pl/signals.pl
  770. *** agent/pl/signals.pl.old    Thu Sep 22 16:43:24 1994
  771. --- agent/pl/signals.pl    Thu Sep 22 16:43:24 1994
  772. ***************
  773. *** 0 ****
  774. --- 1,33 ----
  775. + ;# $Id: signals.pl,v 3.0.1.1 1994/09/22 14:39:13 ram Exp $
  776. + ;#
  777. + ;#  Copyright (c) 1990-1993, Raphael Manfredi
  778. + ;#  
  779. + ;#  You may redistribute only under the terms of the Artistic License,
  780. + ;#  as specified in the README file that comes with the distribution.
  781. + ;#  You may reuse parts of this distribution only within the terms of
  782. + ;#  that same Artistic License; a copy of which may be found at the root
  783. + ;#  of the source tree for mailagent 3.0.
  784. + ;#
  785. + ;# $Log: signals.pl,v $
  786. + ;# Revision 3.0.1.1  1994/09/22  14:39:13  ram
  787. + ;# patch12: created
  788. + ;#
  789. + ;#
  790. + # Catch all common signals
  791. + sub catch_signals {
  792. +     unless (defined &emergency) {
  793. +         &add_log("WARNING no emergency routine to trap signals") if $loglvl > 4;
  794. +         return;
  795. +     }
  796. +     $SIG{'HUP'} = 'emergency';
  797. +     $SIG{'INT'} = 'emergency';
  798. +     $SIG{'QUIT'} = 'emergency';
  799. +     $SIG{'PIPE'} = 'emergency';
  800. +     $SIG{'IO'} = 'emergency';
  801. +     $SIG{'BUS'} = 'emergency';
  802. +     $SIG{'ILL'} = 'emergency';
  803. +     $SIG{'SEGV'} = 'emergency';
  804. +     $SIG{'ALRM'} = 'emergency';
  805. +     $SIG{'TERM'} = 'emergency';
  806. + }
  807.  
  808. Index: agent/filter/lock.c
  809. Prereq: 3.0.1.1
  810. *** agent/filter/lock.c.old    Thu Sep 22 16:42:51 1994
  811. --- agent/filter/lock.c    Thu Sep 22 16:42:51 1994
  812. ***************
  813. *** 11,17 ****
  814.   */
  815.   
  816.   /*
  817. !  * $Id: lock.c,v 3.0.1.1 1994/07/01 14:52:28 ram Exp $
  818.    *
  819.    *  Copyright (c) 1990-1993, Raphael Manfredi
  820.    *  
  821. --- 11,17 ----
  822.   */
  823.   
  824.   /*
  825. !  * $Id: lock.c,v 3.0.1.2 1994/09/22 13:44:52 ram Exp $
  826.    *
  827.    *  Copyright (c) 1990-1993, Raphael Manfredi
  828.    *  
  829. ***************
  830. *** 22,27 ****
  831. --- 22,30 ----
  832.    *  of the source tree for mailagent 3.0.
  833.    *
  834.    * $Log: lock.c,v $
  835. +  * Revision 3.0.1.2  1994/09/22  13:44:52  ram
  836. +  * patch12: typo fix to enable correct lockfile timeout printing
  837. +  *
  838.    * Revision 3.0.1.1  1994/07/01  14:52:28  ram
  839.    * patch8: now honours the lockhold config variable if present
  840.    *
  841. ***************
  842. *** 131,136 ****
  843.           } else
  844.               add_log(6, "UNLOCKED filter (lock older than %d seconds)", hold);
  845.       } else
  846. !         add_log(16, "lockfile for filter is recent (%d seconds or less), hold");
  847.   }
  848.   
  849. --- 134,139 ----
  850.           } else
  851.               add_log(6, "UNLOCKED filter (lock older than %d seconds)", hold);
  852.       } else
  853. !         add_log(16, "lockfile for filter is recent (%d seconds or less)", hold);
  854.   }
  855.   
  856.  
  857. Index: agent/pl/read_conf.pl
  858. Prereq: 3.0.1.2
  859. *** agent/pl/read_conf.pl.old    Thu Sep 22 16:43:21 1994
  860. --- agent/pl/read_conf.pl    Thu Sep 22 16:43:21 1994
  861. ***************
  862. *** 1,4 ****
  863. ! ;# $Id: read_conf.pl,v 3.0.1.2 1994/07/01 15:04:50 ram Exp $
  864.   ;#
  865.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  866.   ;#  
  867. --- 1,4 ----
  868. ! ;# $Id: read_conf.pl,v 3.0.1.3 1994/09/22 14:34:51 ram Exp $
  869.   ;#
  870.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  871.   ;#  
  872. ***************
  873. *** 9,14 ****
  874. --- 9,17 ----
  875.   ;#  of the source tree for mailagent 3.0.
  876.   ;#
  877.   ;# $Log: read_conf.pl,v $
  878. + ;# Revision 3.0.1.3  1994/09/22  14:34:51  ram
  879. + ;# patch12: do not attempt parsing of config if variable is undefined
  880. + ;#
  881.   ;# Revision 3.0.1.2  1994/07/01  15:04:50  ram
  882.   ;# patch8: set proper default values for new optional config variables
  883.   ;#
  884. ***************
  885. *** 62,67 ****
  886. --- 65,71 ----
  887.   # Parse config file held in variable and return 1 if ok, 0 for errors
  888.   sub parse {
  889.       local($config) = @_;
  890. +     return 1 unless defined $config;
  891.       local($eval) = ' ' x 1000;        # Pre-extend
  892.       local($myhome) = $ENV{'HOME'};    # must be correctly set by filter
  893.       local($var, $value);
  894.  
  895. Index: agent/pl/mailhook.pl
  896. Prereq: 3.0
  897. *** agent/pl/mailhook.pl.old    Thu Sep 22 16:43:15 1994
  898. --- agent/pl/mailhook.pl    Thu Sep 22 16:43:15 1994
  899. ***************
  900. *** 1,4 ****
  901. ! ;# $Id: mailhook.pl,v 3.0 1993/11/29 13:48:58 ram Exp $
  902.   ;#
  903.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  904.   ;#  
  905. --- 1,4 ----
  906. ! ;# $Id: mailhook.pl,v 3.0.1.1 1994/09/22 14:26:22 ram Exp $
  907.   ;#
  908.   ;#  Copyright (c) 1990-1993, Raphael Manfredi
  909.   ;#  
  910. ***************
  911. *** 9,14 ****
  912. --- 9,17 ----
  913.   ;#  of the source tree for mailagent 3.0.
  914.   ;#
  915.   ;# $Log: mailhook.pl,v $
  916. + ;# Revision 3.0.1.1  1994/09/22  14:26:22  ram
  917. + ;# patch12: propagates folder_saved as msgpath in PERL escapes
  918. + ;#
  919.   ;# Revision 3.0  1993/11/29  13:48:58  ram
  920.   ;# Baseline for mailagent 3.0 netwide release.
  921.   ;#
  922. ***************
  923. *** 28,33 ****
  924. --- 31,37 ----
  925.       local($package) = @_;        # Package into which variables should be set
  926.       local($init) = &'q(<<'EOP');
  927.   :    *header = *main'Header;        # User may fetch headers via %header
  928. + :    $msgpath = $main'folder_saved;
  929.   :    $sender = $header{'Sender'};
  930.   :    $subject = $header{'Subject'};
  931.   :    $precedence = $header{'Precedence'};
  932.  
  933. Index: agent/test/basic/config.t
  934. Prereq: 3.0.1.1
  935. *** agent/test/basic/config.t.old    Thu Sep 22 16:43:28 1994
  936. --- agent/test/basic/config.t    Thu Sep 22 16:43:28 1994
  937. ***************
  938. *** 1,6 ****
  939.   # This MUST be the first test ever run
  940.   
  941. ! # $Id: config.t,v 3.0.1.1 1994/04/25 15:24:33 ram Exp $
  942.   #
  943.   #  Copyright (c) 1990-1993, Raphael Manfredi
  944.   #  
  945. --- 1,6 ----
  946.   # This MUST be the first test ever run
  947.   
  948. ! # $Id: config.t,v 3.0.1.2 1994/09/22 14:40:52 ram Exp $
  949.   #
  950.   #  Copyright (c) 1990-1993, Raphael Manfredi
  951.   #  
  952. ***************
  953. *** 11,16 ****
  954. --- 11,19 ----
  955.   #  of the source tree for mailagent 3.0.
  956.   #
  957.   # $Log: config.t,v $
  958. + # Revision 3.0.1.2  1994/09/22  14:40:52  ram
  959. + # patch12: added callout queue file definition
  960. + #
  961.   # Revision 3.0.1.1  1994/04/25  15:24:33  ram
  962.   # patch7: added commented 'fromesc' new variable
  963.   #
  964. ***************
  965. *** 44,49 ****
  966. --- 47,53 ----
  967.   queue    : ~/queue        # This is a good test for comments
  968.   logdir   : ~
  969.   context  : \$spool/context
  970. + callout  : \$spool/callout
  971.   log      : agentlog
  972.   seq      : .seq
  973.   timezone : PST8PDT
  974.  
  975. Index: agent/test/README
  976. *** agent/test/README.old    Thu Sep 22 16:43:25 1994
  977. --- agent/test/README    Thu Sep 22 16:43:25 1994
  978. ***************
  979. *** 30,35 ****
  980. --- 30,39 ----
  981.   with eval() which cause the dataloaded version to dump core via a segmentation
  982.   violation).
  983.   
  984. + The -m option is for desperate cases. It launches the atail process in the
  985. + background (a real CPU hog) to monitor all changes to the out/agentlog file.
  986. + This may be really convenient when debugging a test suite failure...
  987.   I don't know why I spent some time documenting all this, as I don't expect
  988.   anybody to have any chance working on this suite. Anyway, it might be nice
  989.   knowing that all the successful tests are recorded in an OK file, along
  990.  
  991. *** End of Patch 16 ***
  992.  
  993. exit 0 # Just in case...
  994.