Skip to content
Snippets Groups Projects
Commit d50215d0 authored by Stuart Gathman's avatar Stuart Gathman
Browse files

Include header fields in DSN template.

parent c5b21695
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,9 @@
# Send DSNs, do call back verification,
# and generate DSN messages from a template
# $Log$
# Revision 1.10 2006/05/24 20:56:35 customdesigned
# Remove default templates. Scrub test.
#
import smtplib
import spf
......@@ -91,7 +94,7 @@ def create_msg(q,rcptlist,origmsg=None,template=None):
template = softfail_msg
else:
template = nospf_msg
hdrs,body = template.split('\n',1)
hdrs,body = template.split('\n\n',1)
for ln in hdrs.splitlines():
name,val = ln.split(':',1)
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)
if 'auto-submitted' not in msg:
msg.add_header('Auto-Submitted','auto-generated')
return msg
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment