X-Git-Url: https://projects.mako.cc/source/attachcheck/blobdiff_plain/a448f42f5fc2c3a63465e32edb1ccf99aed72fa6..9b80ec9c6149b61bb3a5e1af459288e5657926c8:/attachcheck diff --git a/attachcheck b/attachcheck old mode 100644 new mode 100755 index c72adbf..20e16c8 --- a/attachcheck +++ b/attachcheck @@ -3,11 +3,24 @@ # AttachCheck -- A MTA wrapper to help check outgoing email for # forgotten attachments. -# (c) 2005 -- Benjamin Mako Hill -# Author/Software Homepage at: http://mako.cc +# (c) 2004-2009 -- Benjamin Mako Hill +# Software Homepage at: http://mako.cc/projects/attachcheck -__copyright__ = "Copyright (c) 2004 Benjamin Mako Hill" -__author__ = "Benjamin Mako Hill " +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or (at +# your option) any later version. + +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +__copyright__ = "Copyright (c) 2004-2009 Benjamin Mako Hill" +__author__ = "Benjamin Mako Hill " ### Configuration Options ########################################### @@ -21,7 +34,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 +48,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" % sendmail, 'w') mailpipe.write( message_string ) sys.exit( mailpipe.close() ) @@ -107,7 +125,7 @@ if attachment_expected: # check for the confirmation if re.search( r'Subject: CONFIRM', message_string ): - message_string = re.sub( r'(Subject: )(CONFIRM )(.*?)\n', + message_string = re.sub( r'(Subject: )(CONFIRM)(.*?)\n', r'\1\3\n', message_string ) send_message()