Include header fields in DSN template.
This commit is contained in:
+4
-2
@@ -5,6 +5,9 @@
|
|||||||
# Send DSNs, do call back verification,
|
# Send DSNs, do call back verification,
|
||||||
# and generate DSN messages from a template
|
# and generate DSN messages from a template
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.10 2006/05/24 20:56:35 customdesigned
|
||||||
|
# Remove default templates. Scrub test.
|
||||||
|
#
|
||||||
|
|
||||||
import smtplib
|
import smtplib
|
||||||
import spf
|
import spf
|
||||||
@@ -91,7 +94,7 @@ def create_msg(q,rcptlist,origmsg=None,template=None):
|
|||||||
template = softfail_msg
|
template = softfail_msg
|
||||||
else:
|
else:
|
||||||
template = nospf_msg
|
template = nospf_msg
|
||||||
hdrs,body = template.split('\n',1)
|
hdrs,body = template.split('\n\n',1)
|
||||||
for ln in hdrs.splitlines():
|
for ln in hdrs.splitlines():
|
||||||
name,val = ln.split(':',1)
|
name,val = ln.split(':',1)
|
||||||
msg.add_header(name,(val % locals()).strip())
|
msg.add_header(name,(val % locals()).strip())
|
||||||
@@ -103,7 +106,6 @@ def create_msg(q,rcptlist,origmsg=None,template=None):
|
|||||||
msg.add_header('From','postmaster@%s'%receiver)
|
msg.add_header('From','postmaster@%s'%receiver)
|
||||||
if 'auto-submitted' not in msg:
|
if 'auto-submitted' not in msg:
|
||||||
msg.add_header('Auto-Submitted','auto-generated')
|
msg.add_header('Auto-Submitted','auto-generated')
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user