[Mailman-Users] Error on email confirmations on 2.1.5
Glenn Sieb
ges+lists at wingfoot.org
Thu Jun 30 07:39:08 CEST 2005
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
More information about the Mailman-Users
mailing list