summaryrefslogtreecommitdiff
path: root/src/mailman/testing/helpers.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-13 21:03:01 -0700
committerBarry Warsaw2012-03-13 21:03:01 -0700
commit80ac803cb2816dde0503671fd117ed134680de53 (patch)
treeed2d40855f6b45dedf421a7a98bd83d95b6e3b40 /src/mailman/testing/helpers.py
parent07685642934fe934098927a9a9d20c17080f3dab (diff)
downloadmailman-80ac803cb2816dde0503671fd117ed134680de53.tar.gz
mailman-80ac803cb2816dde0503671fd117ed134680de53.tar.zst
mailman-80ac803cb2816dde0503671fd117ed134680de53.zip
* The LMTP server now requires that the incoming message have a `Message-ID`,
otherwise it rejects the message with a 550 error. Also, the LMTP server adds the `X-Message-ID-Hash` header automatically. The `inject` cli command will also add the `X-Message-ID-Hash` header, but it will craft a `Message-ID` header first if one is missing from the injected text. Also, `inject` will always set the correct value for the `original_size` attribute on the message object, instead of trusting a possibly incorrect value if it's already set. The individual `IArchiver` implementations no longer set the `X-Message-ID-Hash` header.
Diffstat (limited to 'src/mailman/testing/helpers.py')
-rw-r--r--src/mailman/testing/helpers.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py
index e61aca605..58c72d6d9 100644
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -223,7 +223,7 @@ class LMTP(smtplib.SMTP):
return code, msg
-def get_lmtp_client():
+def get_lmtp_client(quiet=False):
"""Return a connected LMTP client."""
# It's possible the process has started but is not yet accepting
# connections. Wait a little while.
@@ -233,7 +233,8 @@ def get_lmtp_client():
try:
response = lmtp.connect(
config.mta.lmtp_host, int(config.mta.lmtp_port))
- print response
+ if not quiet:
+ print response
return lmtp
except socket.error as error:
if error[0] == errno.ECONNREFUSED: