We recently noticed a few messages were not being mirrored from the Mailman3 mailing list to the forum.
The email rejection logs show these emails having encountered a Email::Receiver::InvalidPost error.
The error message logged is either of those two:
We’re sorry, but your email message to [“tor-relays@lists.torproject.org”] (titled [tor-relays] authority bandwidth measurements and latency) didn’t work.
Reason:
Access Denied
If you can correct the problem, please try again.
or:
We’re sorry, but your email message to [“tor-relays@lists.torproject.org”] (titled [tor-relays] Re: webtunnel bridges for the telegram distributor) didn’t work.
Reason:
Something has gone wrong. Perhaps this topic was closed or deleted while you were looking at it?
If you can correct the problem, please try again.
I can’t find anything wrong with these messages from looking at the headers, although in some instances, the extracted body as logged only contains the mailing list footer, or in another instance, it’s a bunch of gibberish characters like there was some decoding glitch.
I’ve tried to reproduce this issue using a test mailing list and test category but was unsuccessful. Any help debugging this would be appreciated.
is “accept email from anonymous accounts” enabled in each category settings, and please could you send Discourse email log (slightly redacted if possible)
and please could you send Discourse email log (slightly redacted if possible)
Is things something I need to extract from the container or the host? We also process mail via the mail-receiver container. Or do you want the logs that are exposed in the Web UI (eg. /admin/email-logs/rejected)?
Sometimes Microsoft Exchange will send out garbage if it’s misconfigured to think it’s talking to… I’m not sure - another Exchange server? Something else within its own infrastructure?
You can look at the raw mail from the Discourse console with e.g.:
mid = 'message-id from the log'
puts IncomingEmail.find_by(message_id: mid).raw
This shows the raw email that Discourse received. For example, this message body I just pulled out of our incoming rejection list really is garbage:
This is a multi-part message in MIME format.
--=====003_Dragon855807841081_=====
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: base64
7bgir+m+vzzIDCLE0mDmZrfIXvvmXjY=
--=====003_Dragon855807841081_=====
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: base64
LP/0L4tqmfZizO0DCDDE10uOzMZqzSHDjq04SLPaBjibLVHz+V94m1M45NDN
55aM8SMIf9XY4EFjP9CCFz+ojfmJqmubaz+bjrzmubw+bjWTiGSuLg==
--=====003_Dragon855807841081_=====--
both would be grand. If you use PuTTy SSH you can extract the container logs, and you could snippet the Discourse UI. You can’t search for words in the photo easily though, to redact them😮💨