summaryrefslogtreecommitdiff
path: root/Mailman/Message.py
diff options
context:
space:
mode:
authorbwarsaw2000-07-27 06:39:41 +0000
committerbwarsaw2000-07-27 06:39:41 +0000
commit041003d937e4d3fee4f3d9b2486e4e4be64a8f52 (patch)
treec702181d8737645c92f7dfe418e22bea4c65220d /Mailman/Message.py
parent68dc55b4fcb2ea130ce3f8ecb5c261857e491e22 (diff)
downloadmailman-041003d937e4d3fee4f3d9b2486e4e4be64a8f52.tar.gz
mailman-041003d937e4d3fee4f3d9b2486e4e4be64a8f52.tar.zst
mailman-041003d937e4d3fee4f3d9b2486e4e4be64a8f52.zip
Enqueue(): Watch for the _dirty flag in the msgdata dictionary. This
forces a write of the message text back to disk, even if it already exists. This is used when the message has been changed (e.g. new or changed header, etc.).
Diffstat (limited to '')
-rw-r--r--Mailman/Message.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Mailman/Message.py b/Mailman/Message.py
index e45c1722d..c973d8859 100644
--- a/Mailman/Message.py
+++ b/Mailman/Message.py
@@ -166,7 +166,9 @@ class Message(rfc822.Message):
msgdata.update(newdata)
msgdata.update(kws)
# Get rid of volatile entries, which have the convention of starting
- # with an underscore (TBD: should we use v_ as a naming convention?)
+ # with an underscore (TBD: should we use v_ as a naming convention?).
+ # Need the _dirty flag for later though.
+ dirty = msgdata.get('_dirty')
for k in msgdata.keys():
if k[0] == '_':
del msgdata[k]
@@ -174,8 +176,9 @@ class Message(rfc822.Message):
dbfp = Utils.open_ex(dbfile, 'w')
marshal.dump(msgdata, dbfp)
dbfp.close()
- # if it doesn't already exist, write the message file
- if not existsp:
+ # If it doesn't already exist, or if the text of the message has
+ # changed, write the message file to disk.
+ if not existsp or dirty:
msgfp = Utils.open_ex(msgfile, 'w')
msgfp.write(text)
msgfp.close()