Kaydet (Commit) ee248110 authored tarafından Guido van Rossum's avatar Guido van Rossum

Invent Message-ID header if none is present

üst 7f49b7a1
...@@ -76,6 +76,8 @@ def mmdf(f): ...@@ -76,6 +76,8 @@ def mmdf(f):
'Bad line in MMFD mailbox: %s\n' % `line`) 'Bad line in MMFD mailbox: %s\n' % `line`)
return sts return sts
counter = 0 # for generating unique Message-ID headers
def message(f, delimiter = ''): def message(f, delimiter = ''):
sts = 0 sts = 0
# Parse RFC822 header # Parse RFC822 header
...@@ -93,6 +95,14 @@ def message(f, delimiter = ''): ...@@ -93,6 +95,14 @@ def message(f, delimiter = ''):
# Copy RFC822 header # Copy RFC822 header
for line in m.headers: for line in m.headers:
print line, print line,
# Invent Message-ID header if none is present
if not m.has_key('message-id'):
global counter
counter = counter + 1
msgid = "<%s.%d>" % (hex(t), counter)
sys.stderr.write("Adding Message-ID %s (From %s)\n" %
(msgid, email))
print "Message-ID:", msgid
print print
# Copy body # Copy body
while 1: while 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment