@@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272an exception, the original message is bounced back to the sender with the
7373explanatory message given in the exception.
7474
75- $Id: mailgw.py,v 1.144 2004-03-25 19:27:15 eparker Exp $
75+ $Id: mailgw.py,v 1.145 2004-03-25 22:52:12 richard Exp $
7676"""
7777__docformat__ = 'restructuredtext'
7878
@@ -430,25 +430,14 @@ def handle_Message(self, message):
430430 # in some rare cases, a particularly stuffed-up e-mail will make
431431 # its way into here... try to handle it gracefully
432432
433- # Setting the dispatcher e-mail here, so as not to clutter things. Defaulting to ADMIN_EMAIL, if not set.
434- dispatcherEmail = getattr (self .instance .config , "DISPATCHER_EMAIL" , getattr (self .instance .config , "ADMIN_EMAIL" ))
435- errorMessagesTo = getattr (self .instance .config , "ERROR_MESSAGES_TO" , "user" )
436-
437433 sendto = message .getaddrlist ('resent-from' )
438434 if not sendto :
439435 sendto = message .getaddrlist ('from' )
440436 if not sendto :
441437 # very bad-looking message - we don't even know who sent it
442438 # XXX we should use a log file here...
443439
444- # [EP] This section was originally only to admin.. Not sure if this should ever go to the user?
445-
446- if (errorMessagesTo == "dispatcher" ):
447- sendto = [dispatcherEmail ]
448- elif (errorMessagesTo == "both" ):
449- sendto = [dispatcherEmail , self .instance .config .ADMIN_EMAIL ]
450- else :
451- sendto = [self .instance .config .ADMIN_EMAIL ]
440+ sendto = [self .instance .config .ADMIN_EMAIL ]
452441
453442 m = ['Subject: badly formed message from mail gateway' ]
454443 m .append ('' )
@@ -468,45 +457,24 @@ def handle_Message(self, message):
468457 except MailUsageHelp :
469458 # bounce the message back to the sender with the usage message
470459 fulldoc = '\n ' .join (string .split (__doc__ , '\n ' )[2 :])
471- if (errorMessagesTo == "dispatcher" ):
472- sendto = [dispatcherEmail ]
473- elif (errorMessagesTo == "both" ):
474- sendto = [dispatcherEmail , sendto [0 ][1 ]]
475- else :
476- sendto = [sendto [0 ][1 ]]
477-
478460 m = ['' ]
479461 m .append ('\n \n Mail Gateway Help\n =================' )
480462 m .append (fulldoc )
481- self .mailer .bounce_message (message , sendto , m ,
463+ self .mailer .bounce_message (message , [ sendto [ 0 ][ 1 ]] , m ,
482464 subject = "Mail Gateway Help" )
483465 except MailUsageError , value :
484466 # bounce the message back to the sender with the usage message
485467 fulldoc = '\n ' .join (string .split (__doc__ , '\n ' )[2 :])
486-
487- if (errorMessagesTo == "dispatcher" ):
488- sendto = [dispatcherEmail ]
489- elif (errorMessagesTo == "both" ):
490- sendto = [dispatcherEmail , sendto [0 ][1 ]]
491- else :
492- sendto = [sendto [0 ][1 ]]
493468 m = ['' ]
494469 m .append (str (value ))
495470 m .append ('\n \n Mail Gateway Help\n =================' )
496471 m .append (fulldoc )
497- self .mailer .bounce_message (message , sendto , m )
472+ self .mailer .bounce_message (message , [ sendto [ 0 ][ 1 ]] , m )
498473 except Unauthorized , value :
499474 # just inform the user that he is not authorized
500-
501- if (errorMessagesTo == "dispatcher" ):
502- sendto = [dispatcherEmail ]
503- elif (errorMessagesTo == "both" ):
504- sendto = [dispatcherEmail , sendto [0 ][1 ]]
505- else :
506- sendto = [sendto [0 ][1 ]]
507475 m = ['' ]
508476 m .append (str (value ))
509- self .mailer .bounce_message (message , sendto , m )
477+ self .mailer .bounce_message (message , [ sendto [ 0 ][ 1 ]] , m )
510478 except IgnoreMessage :
511479 # XXX we should use a log file here...
512480 # do not take any action
@@ -515,14 +483,8 @@ def handle_Message(self, message):
515483 except :
516484 # bounce the message back to the sender with the error message
517485 # XXX we should use a log file here...
518-
519- if (errorMessagesTo == "dispatcher" ):
520- sendto = [dispatcherEmail ]
521- elif (errorMessagesTo == "both" ):
522- sendto = [dispatcherEmail , sendto [0 ][1 ], self .instance .config .ADMIN_EMAIL ]
523- else :
524- sendto = [sendto [0 ][1 ], self .instance .config .ADMIN_EMAIL ]
525-
486+ # let the admin know that something very bad is happening
487+ sendto = [sendto [0 ][1 ], self .instance .config .ADMIN_EMAIL ]
526488 m = ['' ]
527489 m .append ('An unexpected error occurred during the processing' )
528490 m .append ('of your message. The tracker administrator is being' )
0 commit comments