#! /usr/local/bin/python """Send a message to the maillist owner. This script gets called by the wrapper. Stdin is the mail message, and argv[1] is the name of the mailing list whose owner(s) to send mail to.""" __version__ = "$Revision: 417 $" import sys sys.path.append('/home/mailman/mailman/modules') import maillist, mm_message, mm_utils try: sys.stderr = mm_utils.StampedLogger("error", label = 'post', manual_reprime=1, nofail=0) except IOError: pass # Oh well - SOL on redirect, errors show thru. # Only let one program run at once per list. # TODO: This *can* fail, and should send back an error message when it does. current_list = maillist.MailList(sys.argv[1]) try: msg = mm_message.IncomingMessage() if not current_list.bounce_processing or not current_list.ScanMessage(msg): current_list.DeliverToList(msg, current_list.owner, '', '') # Let another process run. finally: current_list.Unlock()