summaryrefslogtreecommitdiff
path: root/mailman/queue/__init__.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-03-30 19:38:18 -0400
committerBarry Warsaw2008-03-30 19:38:18 -0400
commit0e1c2be3e6110ccece3cbd0ebc5bfd0eb76c3aad (patch)
treec0432554f9bb4068b6bae6e3a83ddde925c0cd4f /mailman/queue/__init__.py
parent7f440dc39489b32257c35f15ee6f27d90a197cf5 (diff)
downloadmailman-0e1c2be3e6110ccece3cbd0ebc5bfd0eb76c3aad.tar.gz
mailman-0e1c2be3e6110ccece3cbd0ebc5bfd0eb76c3aad.tar.zst
mailman-0e1c2be3e6110ccece3cbd0ebc5bfd0eb76c3aad.zip
More fixes to get end-to-end delivery basically working.
- Add a VirginPipeline for the virgin queue, which is mostly the same as the BuiltInPipeline, so refactor the commonality into a BasePipeline. - Simplify and update bin/dumpdb. - Rename inject() to inject_text() and add inject_message(). Both interfaces will be useful. - When enqueuing and not using _plaintext, use the highest pickle protocol supported. - Fix the archive runner's calculation of whether to clobber the message's Date: header. - Fix the outgoing queue's deliver_after calculation. - Update the virgin queue runner. It doesn't need to inherit from IncomingRunner any more; it can just execute the 'virgin' pipeline.
Diffstat (limited to 'mailman/queue/__init__.py')
-rw-r--r--mailman/queue/__init__.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mailman/queue/__init__.py b/mailman/queue/__init__.py
index 4175babaa..17386cda6 100644
--- a/mailman/queue/__init__.py
+++ b/mailman/queue/__init__.py
@@ -38,6 +38,7 @@ import sha
import time
import email
import errno
+import pickle
import cPickle
import logging
import marshal
@@ -95,12 +96,12 @@ class Switchboard:
listname = data.get('listname', '--nolist--')
# Get some data for the input to the sha hash.
now = time.time()
- if not data.get('_plaintext'):
- protocol = 1
- msgsave = cPickle.dumps(_msg, protocol)
- else:
+ if data.get('_plaintext'):
protocol = 0
msgsave = cPickle.dumps(str(_msg), protocol)
+ else:
+ protocol = pickle.HIGHEST_PROTOCOL
+ msgsave = cPickle.dumps(_msg, protocol)
# listname is unicode but the input to the hash function must be an
# 8-bit string (eventually, a bytes object).
hashfood = msgsave + listname.encode('utf-8') + repr(now)