summaryrefslogtreecommitdiff
path: root/Mailman/Message.py
diff options
context:
space:
mode:
authorbwarsaw2000-07-26 05:05:43 +0000
committerbwarsaw2000-07-26 05:05:43 +0000
commitfde6d0d5e2118c2a3c3f283cbd529a5ad45d8457 (patch)
tree2af00b58af34a552853d418c6402ae7ddca2157d /Mailman/Message.py
parent7f46d3332c15a7ebba80192057a7bef9c50553ca (diff)
downloadmailman-fde6d0d5e2118c2a3c3f283cbd529a5ad45d8457.tar.gz
mailman-fde6d0d5e2118c2a3c3f283cbd529a5ad45d8457.tar.zst
mailman-fde6d0d5e2118c2a3c3f283cbd529a5ad45d8457.zip
Enqueue(): Elaborate on the text fed to the SHA hashing function for
calculating the file name. If a message is sent to two lists simultaneously and the receiving MTA doesn't distinguish them with something like a Delivered-To: header (as Postfix does), the hashes could be the same, prevent one or the other list from receiving the message. Now the hash is composed of the message's text, the destination list's name, and a string representation of the current floating point time. That ought to be unique enough for every message.
Diffstat (limited to '')
-rw-r--r--Mailman/Message.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Mailman/Message.py b/Mailman/Message.py
index afcae81c5..2a0f96e73 100644
--- a/Mailman/Message.py
+++ b/Mailman/Message.py
@@ -120,7 +120,8 @@ class Message(rfc822.Message):
For each enqueued message, a .msg and a .db file is written. The .msg
contains the plain text of the message (TBD: should this be called
.txt?). The .db contains a marshaled dictionary of message metadata.
- The base name of the file is the SHA hexdigest of the message text.
+ The base name of the file is the SHA hexdigest of some unique data,
+ currently the message text + the list's name + the current time.
The message metadata is a dictionary calculated as follows:
@@ -141,7 +142,8 @@ class Message(rfc822.Message):
"""
# Calculate a unique name for the queue file
text = repr(self)
- filebase = sha.new(text).hexdigest()
+ hashfood = text + mlist.internal_name() + `time.time()`
+ filebase = sha.new(hashfood).hexdigest()
msgfile = os.path.join(mm_cfg.QUEUE_DIR, filebase + '.msg')
dbfile = os.path.join(mm_cfg.QUEUE_DIR, filebase + '.db')
# Initialize the information about this message delivery. It's