This was initially changed, but these error messages are not good enough
for what postfix offers. We'll need a more robust solution.
This reverts commit 7e400a2665.
This may have caused issues before, but I'm unable to reproduce them
locally. I'm not certain that we correctly identified the cause.
Re-introducing these changes for a closer examination.
This reverts commit 3a789352fc.
This reverts commit 99886477c7.
This was not adequately tested, and causes errors in
lists.sr.ht-process:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/listssrht/process.py", line 43, in wrapper
return func(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/listssrht/process.py", line 547, in dispatch_message
msgid = mail.get("Message-ID").strip()
AttributeError: 'NoneType' object has no attribute 'strip'
This reverts commit e3966d260c.
This patch allows 8bit messages to be forwarded as-is by lists.sr.ht.
We've been using str(mail) to convert a parsed message to a string.
However Python will convert any 8bit Content-Transfer-Encoding to
quoted-printable or base64 when formatting the string.
To prevent this, directly use the bytes coming from envelope.content.
However, Celery uses JSON to dispatch tasks data, and Python's stdlib
can't encode bytes.
To workaround this limitation, convert to base64.
We previously used "sock" parameter to determine if protocol should be
lmtp (unix socket) or smtp (tcp).
Since it make sense to serve both protocols on tcp or unix socket, introduce a
new "protocol" parameter to switch between lmtp and smtp.
Keep backward compat when protocol is not set by using lmtp over unix
socket and smtp over tcp socket.
Also evaluate "sock-group" option only when using unix socket, so the
option is no longer mandatory for tcp where it's unused.
The default Python policy violates the RFC by formatting messages with lone LF
characters instead of CRLF. I believe this breaks DKIM verification on some
servers.
This patch makes it so the SMTP policy is used, which formats messages with
CRLF.