أخطاء Unexplained Email::Receiver::InvalidPost غير مفسرة

Got a few mailing lists mirrored over at https://forum.torproject.org/c/mailing-lists/23

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)

إعجاب واحد (1)

Yes, I can confirm that this setting is enabled.

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)?

Did it come from Exchange?

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_=====--

as the parts don’t decode to valid text.

إعجابَين (2)

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😮‍💨

I was able to extract two mails with the full headers. One MUA is Apple Mail and the other is Claws Mail.

I’d be happy to forward those to someone’s private email for debugging, so we avoid pasting it all over the Internet.

In think in both instances it’s likely Discourse that’s not parsing the email content correctly.