From 97967ae4b24fee20f9727d0f71a488343918b93e Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 6 Jul 2001 05:37:04 +0000 Subject: process(): Call syslog.write_ex() directly (instead of syslog.write() implied by syslog.__call__()), passing in the MsgSafeDict instance to the kws argument. This works around the Python limitation that **kws in extended calls must be concrete dictionary objects. --- Mailman/Handlers/SMTPDirect.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Mailman/Handlers/SMTPDirect.py b/Mailman/Handlers/SMTPDirect.py index 08b8e26e3..96433f2a6 100644 --- a/Mailman/Handlers/SMTPDirect.py +++ b/Mailman/Handlers/SMTPDirect.py @@ -85,13 +85,13 @@ def process(mlist, msg, msgdata): # still worthwhile doing the interpolation in syslog() because it'll catch # any catastrophic exceptions due to bogus format strings. if mm_cfg.SMTP_LOG_EVERY_MESSAGE: - syslog(mm_cfg.SMTP_LOG_EVERY_MESSAGE[0], - mm_cfg.SMTP_LOG_EVERY_MESSAGE[1], **d.copy()) + syslog.write_ex(mm_cfg.SMTP_LOG_EVERY_MESSAGE[0], + mm_cfg.SMTP_LOG_EVERY_MESSAGE[1], kws=d) if refused: if mm_cfg.SMTP_LOG_REFUSED: - syslog(mm_cfg.SMTP_LOG_REFUSED[0], - mm_cfg.SMTP_LOG_REFUSED[1], **d.copy()) + syslog.write_ex(mm_cfg.SMTP_LOG_REFUSED[0], + mm_cfg.SMTP_LOG_REFUSED[1], kws=d) elif msgdata.get('tolist'): # Log the successful post, but only if it really was a post to the @@ -100,8 +100,8 @@ def process(mlist, msg, msgdata): # the other messages, but in that case, we should probably have a # separate configuration variable to control that. if mm_cfg.SMTP_LOG_SUCCESS: - syslog(mm_cfg.SMTP_LOG_SUCCESS[0], - mm_cfg.SMTP_LOG_SUCCESS[1], **d.copy()) + syslog.write_ex(mm_cfg.SMTP_LOG_SUCCESS[0], + mm_cfg.SMTP_LOG_SUCCESS[1], kws=d) # Process any failed deliveries. tempfailures = [] @@ -127,8 +127,8 @@ def process(mlist, msg, msgdata): d.update({'recipient': recip, 'failcode' : code, 'failmsg' : smtpmsg}) - syslog(mm_cfg.SMTP_LOG_EACH_FAILURE[0], - mm_cfg.SMTP_LOG_EACH_FAILURE[1], **d.copy()) + syslog.write_ex(mm_cfg.SMTP_LOG_EACH_FAILURE[0], + mm_cfg.SMTP_LOG_EACH_FAILURE[1], kws=d) # Return the results if tempfailures or permfailures: raise Errors.SomeRecipientsFailed(tempfailures, permfailures) -- cgit v1.3.1