Have attach check pass sendmail options along to sendmail to turn things
[attachcheck] / attachcheck
index c72adbfd92ac452a307e50a266bc169155624404..ebcd6be9a66f7dc75cdf936207423dc9773d107a 100644 (file)
@@ -6,6 +6,9 @@
 # (c) 2005 -- Benjamin Mako Hill <mako@bork.hampshire.edu>
 # Author/Software Homepage at: http://mako.cc
 
+# This software comes with ABSOLUTELY NO WARRANTY.
+# This is free software and is licensed under the GNU GPL.
+
 __copyright__ = "Copyright (c) 2004 Benjamin Mako Hill"
 __author__ = "Benjamin Mako Hill <mako@debian.org>" 
 
@@ -13,7 +16,7 @@ __author__ = "Benjamin Mako Hill <mako@debian.org>"
 ###########################################
 
 # location of the sendmail binary
-sendmail = "/usr/sbin/sendmail"
+sendmail = "/usr/sbin/sendmail -oi"
 
 # list of mimetype which are, for the sake of this program, not
 # attachments
@@ -21,7 +24,8 @@ ignored_types = ( "applica/pgp-signat", "application/pgp-signature" )
 
 # list of regular expressions which we will view as being indicative
 # of an attachment
-attachment_regexes = [ r'\battach(ed|ment|ing)?\b(?im)' ]
+attachment_regexes = [ r'\battach(ed|ment|ing)?\b(?im)',
+                       r'\balleg(o|at[oaie]|ando)' ]
 
 
 ### No Edit Below This Line
@@ -34,7 +38,11 @@ import re
 
 ## SUB: send message
 def send_message(): 
-    mailpipe = os.popen("%s -t" % sendmail, 'w')
+
+    global sendmail
+    sendmail = sendmail + " " + " ".join( sys.argv[1:] )
+   
+    mailpipe = os.popen("%s -t" % sendmail_with_args, 'w')
     mailpipe.write( message_string )
     sys.exit( mailpipe.close() )
 

Benjamin Mako Hill || Want to submit a patch?