home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / ftpmail / patch01 < prev    next >
Encoding:
Text File  |  1993-05-15  |  6.7 KB  |  212 lines

  1. Newsgroups: comp.sources.misc
  2. From: lmjm@doc.ic.ac.uk (Lee M J McLoughlin)
  3. Subject: v37i054:  ftpmail - Automatic Email to FTP Gateway, Patch01
  4. Message-ID: <1993May12.142823.26813@sparky.imd.sterling.com>
  5. X-Md4-Signature: d7161c57b9e3960ede4bfb5e79415c49
  6. Date: Wed, 12 May 1993 14:28:23 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lmjm@doc.ic.ac.uk (Lee M J McLoughlin)
  10. Posting-number: Volume 37, Issue 54
  11. Archive-name: ftpmail/patch01
  12. Environment: UNIX, Perl, Sun, Dec, INET
  13. Patch-To: ftpmail: Volume 37, Issue 51-52
  14.  
  15. Below is a small patch for ftpmail.  This brings ftpmail to version 1.15.
  16.  
  17. The original sources required for patching are available in any of the
  18. comp.sources.misc archives.  ftpmail is archived at:
  19.  
  20.         src.doc.ic.ac.uk:packages/ftpmail/
  21.         grasp1.univ-lyon1.fr:pub/unix/mail/tools/ftpmail/
  22.         ftp.sterling.com:mail/ftpmail/
  23.  
  24. Ftpmail is an email->ftp gateway.  It is all writen in perl and sends 
  25. responses using either mail or by directly calling sendmail.  When using 
  26. sendmail MIME support is available.
  27.  
  28. ------------------------------------------
  29. diff -cr ../ftpmail-1.13/README ./README
  30. *** ../ftpmail-1.13/README    Wed May 12 09:10:07 1993
  31. --- ./README    Wed May 12 09:09:26 1993
  32. ***************
  33. *** 51,57 ****
  34.   to cause any mail delivered to that ftpmail to invoke q.pl. But
  35.   anything that causes q.pl to be run on the input request will do.
  36.   Under sendmail create ~ftpmail/.forward containing:
  37. ! "|/src.doc.ic.ac.uk/public/ic.doc/ftpmail/q.pl"
  38.   (Or similar.)
  39.   
  40.   The file crontab contains a suggested cron entry that should be run as
  41. --- 51,57 ----
  42.   to cause any mail delivered to that ftpmail to invoke q.pl. But
  43.   anything that causes q.pl to be run on the input request will do.
  44.   Under sendmail create ~ftpmail/.forward containing:
  45. ! |"/src.doc.ic.ac.uk/public/ic.doc/ftpmail/q.pl"
  46.   (Or similar.)
  47.   
  48.   The file crontab contains a suggested cron entry that should be run as
  49. diff -cr ../ftpmail-1.13/config.pl ./config.pl
  50. *** ../ftpmail-1.13/config.pl    Wed May 12 09:10:11 1993
  51. --- ./config.pl    Wed May 12 09:09:34 1993
  52. ***************
  53. *** 1,7 ****
  54.   # Local configuration details for ftpmail.
  55.   #
  56. ! # $Header: /a/swan/home/swan/staff/csg/lmjm/src/perl/mirror/ftpmail/RCS/config.pl,v 1.10 1993/04/25 20:27:48 lmjm Exp lmjm $
  57.   # $Log: config.pl,v $
  58.   # Revision 1.10  1993/04/25  20:27:48  lmjm
  59.   # Added mail_overhead.
  60.   #
  61. --- 1,10 ----
  62.   # Local configuration details for ftpmail.
  63.   #
  64. ! # $Header: /a/swan/home/swan/staff/csg/lmjm/src/perl/mirror/ftpmail/RCS/config.pl,v 1.11 1993/05/11 20:07:56 lmjm Exp lmjm $
  65.   # $Log: config.pl,v $
  66. + # Revision 1.11  1993/05/11  20:07:56  lmjm
  67. + # Optionally ban connecting to a.b.c.d
  68. + #
  69.   # Revision 1.10  1993/04/25  20:27:48  lmjm
  70.   # Added mail_overhead.
  71.   #
  72. ***************
  73. *** 92,97 ****
  74. --- 95,104 ----
  75.   
  76.   # If set to 1 limit to just login=anonymous, passwd=-ftpmail/$replyto
  77.   $restricted = 0;
  78. + # If set to 1, only FQDNs are allowed in the open command instead
  79. + # of also IP numbers.
  80. + $fqdn_only = 0;
  81.   
  82.   # TODO:
  83.   # If set is the name of a file containing restrictions on when to
  84. diff -cr ../ftpmail-1.13/dq.pl ./dq.pl
  85. *** ../ftpmail-1.13/dq.pl    Wed May 12 09:10:12 1993
  86. --- ./dq.pl    Wed May 12 09:09:31 1993
  87. ***************
  88. *** 7,14 ****
  89.   #  organisation can be held liable for any problems caused by the use or
  90.   #  storage of this package.
  91.   #
  92. ! # $Header: /a/swan/home/swan/staff/csg/lmjm/src/perl/mirror/ftpmail/RCS/dq.pl,v 1.16 1993/04/28 18:19:19 lmjm Exp lmjm $
  93.   # $Log: dq.pl,v $
  94.   # Revision 1.16  1993/04/28  18:19:19  lmjm
  95.   # From chris, corrected filename in mime message.
  96.   #
  97. --- 7,17 ----
  98.   #  organisation can be held liable for any problems caused by the use or
  99.   #  storage of this package.
  100.   #
  101. ! # $Header: /a/swan/home/swan/staff/csg/lmjm/src/perl/mirror/ftpmail/RCS/dq.pl,v 1.17 1993/05/11 20:07:56 lmjm Exp lmjm $
  102.   # $Log: dq.pl,v $
  103. + # Revision 1.17  1993/05/11  20:07:56  lmjm
  104. + # Init right variable for btoa!
  105. + #
  106.   # Revision 1.16  1993/04/28  18:19:19  lmjm
  107.   # From chris, corrected filename in mime message.
  108.   #
  109. ***************
  110. *** 193,199 ****
  111.       $compress_it = 0;
  112.       $gzip_it = 0;
  113.       $uuencode_it = 0;
  114. !     $atob_it = 0;
  115.       $mime_it = 0;
  116.   
  117.       # Set the max file size from the local config file.
  118. --- 196,202 ----
  119.       $compress_it = 0;
  120.       $gzip_it = 0;
  121.       $uuencode_it = 0;
  122. !     $btoa_it = 0;
  123.       $mime_it = 0;
  124.   
  125.       # Set the max file size from the local config file.
  126. diff -cr ../ftpmail-1.13/q.pl ./q.pl
  127. *** ../ftpmail-1.13/q.pl    Wed May 12 09:10:09 1993
  128. --- ./q.pl    Wed May 12 09:09:35 1993
  129. ***************
  130. *** 7,14 ****
  131.   #  organisation can be held liable for any problems caused by the use or
  132.   #  storage of this package.
  133.   #
  134. ! # $Header: /a/swan/home/swan/staff/csg/lmjm/src/perl/mirror/ftpmail/RCS/q.pl,v 1.13 1993/05/07 19:05:52 lmjm Exp lmjm $
  135.   # $Log: q.pl,v $
  136.   # Revision 1.13  1993/05/07  19:05:52  lmjm
  137.   # Added Chris's fixed not_ok code.
  138.   #
  139. --- 7,20 ----
  140.   #  organisation can be held liable for any problems caused by the use or
  141.   #  storage of this package.
  142.   #
  143. ! # $Header: /a/swan/home/swan/staff/csg/lmjm/src/perl/mirror/ftpmail/RCS/q.pl,v 1.15 1993/05/12 11:14:50 lmjm Exp lmjm $
  144.   # $Log: q.pl,v $
  145. + # Revision 1.15  1993/05/12  11:14:50  lmjm
  146. + # Upgraded support.pl
  147. + #
  148. + # Revision 1.14  1993/05/11  20:07:57  lmjm
  149. + # Optionally ban connection to a.b.c.d type addresses
  150. + #
  151.   # Revision 1.13  1993/05/07  19:05:52  lmjm
  152.   # Added Chris's fixed not_ok code.
  153.   #
  154. ***************
  155. *** 66,72 ****
  156.   
  157.   $ftpmail = 'ftpmail';
  158.   
  159. ! $Revision = '$Revision: 1.13 $';
  160.   
  161.   if( $test ){
  162.       $ftpmail_dir = '/tmp/ftpmail-test';
  163. --- 72,78 ----
  164.   
  165.   $ftpmail = 'ftpmail';
  166.   
  167. ! $Revision = '$Revision: 1.15 $';
  168.   
  169.   if( $test ){
  170.       $ftpmail_dir = '/tmp/ftpmail-test';
  171. ***************
  172. *** 236,241 ****
  173. --- 242,250 ----
  174.           ($site, $user, $pass ) = ($3, $5, $7);
  175.           if( $site eq ''){
  176.               $site = $default_site;
  177. +         }
  178. +         if( $fqdn_only && $site =~ /^\d+\.\d+\.\d+\.\d+$/ ){
  179. +             &mail_back( "Cannot ftp you may only use the NAME for the host to connect to" );
  180.           }
  181.           if( $ftp_permitted && $site !~ /$ftp_permitted/ ){
  182.               &mail_back( "Cannot ftp to that site only sites matching $ftp_permitted are allowed" );
  183. diff -cr ../ftpmail-1.13/sendmail_forward ./sendmail_forward
  184. *** ../ftpmail-1.13/sendmail_forward    Wed May 12 09:10:14 1993
  185. --- ./sendmail_forward    Wed May 12 09:09:36 1993
  186. ***************
  187. *** 1 ****
  188. ! "|/src.doc.ic.ac.uk/public/ic.doc/ftpmail/q.pl"
  189. --- 1 ----
  190. ! |"/src.doc.ic.ac.uk/public/ic.doc/ftpmail/q.pl"
  191. diff -cr ../ftpmail-1.13/support.pl ./support.pl
  192. *** ../ftpmail-1.13/support.pl    Wed May 12 09:10:14 1993
  193. --- ./support.pl    Wed May 12 09:09:35 1993
  194. ***************
  195. *** 94,99 ****
  196. --- 94,106 ----
  197.       }
  198.   }
  199.   
  200. + sub fail
  201. + {
  202. +     local( $fatal_error ) = @_;
  203. +     die( "Fatal error $fatal_error, probably due to config problems" );
  204. + }
  205.   sub fatal
  206.   {
  207.       local( $fatal_error ) = @_;
  208. exit 0 # Just in case...
  209.