summaryrefslogtreecommitdiff
path: root/Mailman/docs/requests.txt
diff options
context:
space:
mode:
authorBarry Warsaw2007-12-10 23:00:14 -0500
committerBarry Warsaw2007-12-10 23:00:14 -0500
commit7923b90f0349f9e2dc891082e2e1c3bf23b4d79c (patch)
tree35ce2b0d149f8f806d84e0b8e991213d073df193 /Mailman/docs/requests.txt
parent5495accf05d77e1c4ff2855f5e42c2e56f51e45d (diff)
downloadmailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.tar.gz
mailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.tar.zst
mailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.zip
Add .get() to our Message subclass, which ensures that returned
values are unicodes if they come from the base class as a string. Get rid of the 'global id'. Now use just Message-ID. Rename X-List-ID-Hash to X-Message-ID-Hash. Do not take Date header into account when calculating this hash. Because of the above change, the assumption is that there will be no Message-ID collisions. Therefore, get rid of IMessageStore .get_message(), .get_messages_by_message_id() and .get_messages_by_hash(). Instead, it's now .get_message_by_id() and .get_message_by_hash() both of which return the message object or None. Message.hash -> Message.message_id_hash When storing a message in the message store, the final path component has the entire hash, not just the leftover parts after directory prefix splitting. MessageStore.delete_message() deletes the file too. Doctests clean up message store messages though the message store instead of directly off the filesystem.
Diffstat (limited to 'Mailman/docs/requests.txt')
-rw-r--r--Mailman/docs/requests.txt30
1 files changed, 15 insertions, 15 deletions
diff --git a/Mailman/docs/requests.txt b/Mailman/docs/requests.txt
index 7a395ce94..ea4dcc75d 100644
--- a/Mailman/docs/requests.txt
+++ b/Mailman/docs/requests.txt
@@ -231,6 +231,9 @@ this case, we won't include any additional metadata.
We can also hold a message with some additional metadata.
+ # Delete the Message-ID from the previous hold so we don't try to store
+ # collisions in the message storage.
+ >>> del msg['message-id']
>>> msgdata = dict(sender='aperson@example.com',
... approved=True,
... received_time=123.45)
@@ -308,8 +311,7 @@ indicates that the message has been approved.
To: alist@example.com
Subject: Something important
Message-ID: ...
- X-List-ID-Hash: ...
- X-List-Sequence-Number: ...
+ X-Message-ID-Hash: ...
X-Mailman-Approved-At: ...
<BLANKLINE>
Here's something important about our mailing list.
@@ -338,26 +340,21 @@ is deleted.
... """)
>>> id_4 = moderator.hold_message(mlist, msg, {}, 'Needs approval')
>>> moderator.handle_message(mlist, id_4, Action.discard)
- >>> msgs = config.db.message_store.get_messages_by_message_id(u'<12345>')
- >>> list(msgs)
- []
+ >>> print config.db.message_store.get_message_by_id(u'<12345>')
+ None
But if we ask to preserve the message when we discard it, it will be held in
the message store after disposition.
>>> id_4 = moderator.hold_message(mlist, msg, {}, 'Needs approval')
>>> moderator.handle_message(mlist, id_4, Action.discard, preserve=True)
- >>> msgs = config.db.message_store.get_messages_by_message_id(u'<12345>')
- >>> msgs = list(msgs)
- >>> len(msgs)
- 1
- >>> print msgs[0].as_string()
+ >>> stored_msg = config.db.message_store.get_message_by_id(u'<12345>')
+ >>> print stored_msg.as_string()
From: aperson@example.org
To: alist@example.com
Subject: Something important
Message-ID: <12345>
- X-List-ID-Hash: 4CF7EAU3SIXBPXBB5S6PEUMO62MWGQN6
- X-List-Sequence-Number: 1
+ X-Message-ID-Hash: 4CF7EAU3SIXBPXBB5S6PEUMO62MWGQN6
<BLANKLINE>
Here's something important about our mailing list.
<BLANKLINE>
@@ -366,6 +363,10 @@ Orthogonal to preservation, the message can also be forwarded to another
address. This is helpful for getting the message into the inbox of one of the
moderators.
+ # Set a new Message-ID from the previous hold so we don't try to store
+ # collisions in the message storage.
+ >>> del msg['message-id']
+ >>> msg['Message-ID'] = u'<abcde>'
>>> id_4 = moderator.hold_message(mlist, msg, {}, 'Needs approval')
>>> moderator.handle_message(mlist, id_4, Action.discard,
... forward=[u'zperson@example.com'])
@@ -383,9 +384,8 @@ moderators.
From: aperson@example.org
To: alist@example.com
Subject: Something important
- Message-ID: <12345>
- X-List-ID-Hash: 4CF7EAU3SIXBPXBB5S6PEUMO62MWGQN6
- X-List-Sequence-Number: ...
+ Message-ID: <abcde>
+ X-Message-ID-Hash: EN2R5UQFMOUTCL44FLNNPLSXBIZW62ER
<BLANKLINE>
Here's something important about our mailing list.
<BLANKLINE>