Jun 29 23:28:45 caduceus postfix/pipe[36446]: 9FC4F1F4409:
to=<listname-confirm+blahblahblah@lists.wingfoot.org>, relay=mailman,
delay=0, status=bounced (Command died with status 1:
"/usr/local/mailman/postfix-to-mailman-2.1.py". Command output: File
"/usr/local/mailman/scripts/confirm", line 64
sys.exit(MailExits.mailexits.EX_NOUSER.)
^ SyntaxError: invalid syntax )
(The SyntaxError is pointing at the exit in "sys.exit(MailExits..)" error...)
I'm running Mailman 2.1.5 on FreeBSD 4.11-RELEASE, with Python 2.4.1. The list in question does actually exist. I sent the user an invite to join. In the meantime I told her to just go ahead and confirm via the web-link.
Thanks in advance..
Best, --Glenn
-- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." ~Benjamin Franklin, Historical Review of Pennsylvania, 1759
Glenn Sieb wrote:
Jun 29 23:28:45 caduceus postfix/pipe[36446]: 9FC4F1F4409: to=<listname-confirm+blahblahblah@lists.wingfoot.org>, relay=mailman, delay=0, status=bounced (Command died with status 1: "/usr/local/mailman/postfix-to-mailman-2.1.py". Command output: File "/usr/local/mailman/scripts/confirm", line 64
sys.exit(MailExits.mailexits.EX_NOUSER.) ^ SyntaxError: invalid syntax )(The SyntaxError is pointing at the exit in "sys.exit(MailExits..)" error...)
I'm running Mailman 2.1.5 on FreeBSD 4.11-RELEASE, with Python 2.4.1.
Something's strange here. The 2.1.5 distribution scripts/confirm only has 62 lines and there are only 2 sys.exit() calls and they are both "sys.exit(1)".
In fact, "grep -ir mailexits *" doesn't find anything anywhere in the Mailman 2.1.5 distribution.
If this Mailman is somebody's package, I think you need to contact the packager.
That said, I think the actual syntax error is the final period in 'MailExits.mailexits.EX_NOUSER.'.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro said the following on 6/30/2005 1:29 AM:
Something's strange here. The 2.1.5 distribution scripts/confirm only has 62 lines and there are only 2 sys.exit() calls and they are both "sys.exit(1)".
In fact, "grep -ir mailexits *" doesn't find anything anywhere in the Mailman 2.1.5 distribution.
If this Mailman is somebody's package, I think you need to contact the packager.
Nope. I install from source, with the htdig/archiver patches. My confirm script is 89 lines long (with comments).
That said, I think the actual syntax error is the final period in 'MailExits.mailexits.EX_NOUSER.'.
Thanks--removing that period just after "NOUSER" fixes the problem. :)
Below is the confirm script, for perusal.
Thanks! Best, --Glenn
$ cat /usr/local/mailman/scripts/confirm # -*- python -*- # # Copyright (C) 2002 by the Free Software Foundation, Inc. # # 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 2 # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Simple confirm via VERP-ish sender.
Called by the wrapper, stdin is the mail message, and argv[1] is the name of the target mailing list.
Errors are redirected to logs/errors. """
# Set the default exit status to be used with the following # variable. This is the value which will be used in the event of # our not even being able to import modules and do things in a # controlled way. # The installed default is 75 = MailExits.mailexits.EX_TEMPFAIL # This should tell Sendmail to keep keep the mail locally and # try again. This should give us time to try and fix the gross # installation problem without losing or rejecting all the mail # which is arriving. DEFAULT_EXIT_STATUS = 75 # If we cannot import sys then we aren't going to control what # sendmail does with the mail import sys try: import paths from Mailman import MailExits from Mailman import mm_cfg DEFAULT_EXIT_STATUS = mm_cfg.DEFAULT_MAILER_EXIT_STATUS from Mailman.Logging.Utils import LogStdErr LogStdErr('error', 'confirm', tee_to_real_stderr=0) import traceback
try:
from Mailman import Utils
from Mailman.i18n import _
from Mailman.Queue.sbcache import get_switchboard
def main():
try:
listname = sys.argv[1]
except IndexError:
print >> sys.stderr, _('got no listname.')
sys.exit(MailExits.mailexits.EX_TEMPFAIL)
# Make sure the list exists
if not Utils.list_exists(listname):
print >> sys.stderr, _('list not found: %(listname)s')
sys.exit(MailExits.mailexits.EX_NOUSER)
# Immediately queue the message for the bounce/cmd qrunner
to process. # The advantage to this approach is that messages should never get lost -- # some MTAs have a hard limit to the time a filter prog can run. Postfix # is a good example; if the limit is hit, the proc is SIGKILL'd giving us # no chance to save the message. cmdq = get_switchboard(mm_cfg.CMDQUEUE_DIR) cmdq.enqueue(sys.stdin.read(), listname=listname, toconfirm=1, _plaintext=1)
if __name__ == '__main__':
main()
except SystemExit:
raise
except StandardError:
sys.stderr.write("unexpected error handling: %s" % str(sys.argv))
traceback.print_exc(None, sys.stderr)
sys.exit(DEFAULT_EXIT_STATUS)
except SystemExit: # we do not want to catch SystemExits raise except StandardError: # But for all others take the default exit status sys.exit(DEFAULT_EXIT_STATUS)
-- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." ~Benjamin Franklin, Historical Review of Pennsylvania, 1759
Glenn Sieb wrote:
Nope. I install from source, with the htdig/archiver patches. My confirm script is 89 lines long (with comments).
The fact remains that your confirm script is not the one from the 2.1.5 source distribution. The diff is as follows and it is not from either htdig-2.1.5-0.1.patch or indexing-2.1.5-0.1.patch. --- mailman-2.1.5/scripts/confirm 2002-03-13 22:04:08.000000000 -0800 +++ confirm 2005-06-30 07:28:04.875000000 -0700 @@ -24,29 +24,44 @@ Errors are redirected to logs/errors. """ +# Set the default exit status to be used with the following +# variable. This is the value which will be used in the event of +# our not even being able to import modules and do things in a +# controlled way. +# The installed default is 75 = MailExits.mailexits.EX_TEMPFAIL +# This should tell Sendmail to keep keep the mail locally and +# try again. This should give us time to try and fix the gross +# installation problem without losing or rejecting all the mail +# which is arriving. +DEFAULT_EXIT_STATUS = 75 +# If we cannot import sys then we aren't going to control what +# sendmail does with the mail import sys +try: + import paths + from Mailman import MailExits + from Mailman import mm_cfg + DEFAULT_EXIT_STATUS = mm_cfg.DEFAULT_MAILER_EXIT_STATUS + from Mailman.Logging.Utils import LogStdErr + LogStdErr('error', 'confirm', tee_to_real_stderr=0) + import traceback -import paths -from Mailman import mm_cfg -from Mailman import Utils -from Mailman.i18n import _ -from Mailman.Queue.sbcache import get_switchboard -from Mailman.Logging.Utils import LogStdErr - -LogStdErr('error', 'confirm') - + try: + from Mailman import Utils + from Mailman.i18n import _ + from Mailman.Queue.sbcache import get_switchboard ? -def main(): + def main(): try: listname = sys.argv[1] except IndexError: - print >> sys.stderr, _('confirm script got no listname.') - sys.exit(1) + print >> sys.stderr, _('got no listname.') + sys.exit(MailExits.mailexits.EX_TEMPFAIL) # Make sure the list exists if not Utils.list_exists(listname): - print >> sys.stderr, _('confirm script, list not found: %(listname)s') - sys.exit(1) + print >> sys.stderr, _('list not found: %(listname)s') + sys.exit(MailExits.mailexits.EX_NOUSER) # Immediately queue the message for the bounce/cmd qrunner to process. # The advantage to this approach is that messages should never get lost -- # some MTAs have a hard limit to the time a filter prog can run. Postfix @@ -57,6 +72,18 @@ _plaintext=1) -? -if __name__ == '__main__': + if __name__ == '__main__': main() + + except SystemExit: + raise + except StandardError: + sys.stderr.write("unexpected error handling: %s" % str(sys.argv)) + traceback.print_exc(None, sys.stderr) + sys.exit(DEFAULT_EXIT_STATUS) +except SystemExit: + # we do not want to catch SystemExits + raise +except StandardError: + # But for all others take the default exit status + sys.exit(DEFAULT_EXIT_STATUS) -- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro said the following on 6/30/2005 10:41 AM:
Glenn Sieb wrote:
Nope. I install from source, with the htdig/archiver patches. My confirm script is 89 lines long (with comments).
The fact remains that your confirm script is not the one from the 2.1.5 source distribution. The diff is as follows and it is not from either htdig-2.1.5-0.1.patch or indexing-2.1.5-0.1.patch.
Oops. I forgot two other patches.
exitstatus-2.1.5-0.1.patch indexing-2.1.5-0.1.patch htdig-2.1.5-0.1.patch modinc-2.1.5-0.1.patch
Those are the patches on my system. It appears that the exitstatus patch changes the confirm script.
Either way, I've put the change in you recommended, and it works fine now. Thank you for your help.
Best, --Glenn
-- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." ~Benjamin Franklin, Historical Review of Pennsylvania, 1759
participants (2)
-
Glenn Sieb
-
Mark Sapiro