Cryptic email error mail


(Michael Downey) #1

So this morning I got two messages from the system user, both of which read as follows:

This is an automated message.
Parsing an incoming email failed. Please review the following Error:
Email::Receiver::UserNotFoundError

There is nothing with that error message in /logs and I’m not sure if there’s anywhere else I should look. Is there anywhere where I can find details?

Also, is it safe to assume that the “black hole” problem has been fixed and the users were notified that their incoming e-mail failed?


Replacing Mailing lists: Email-In
(Michael Downey) #2

Also, does this error message mean that the “From” address of the e-mail didn’t match a valid user, or the “To” address didn’t match something configured in the system? (e.g. For us, we have things like categoryname@example.com.)


(Michael Downey) #3

Here’s an update.

  • One of the two errors happened when a user sent an email to categoryname@example.com from the same email address that matched his user record. This failed and generated the message seen above. The user was not notified of the failure.
  • Another user sent an e-mail to categoryname@example.com from the different email address that did not match his user record. This failed and generated the message seen above. The user was not notified of the failure.
  • This second user then forwarded the original (failed) message to categoryname@example.com from his email address that did match his user record. That seemed (I can’t say for sure) to generate the following new error from the system user:

This is an automated message.
Parsing an incoming email failed. Please review the following Error:
ActiveRecord::Rollback


(Jeff Atwood) #4

@riking is working on changing this. Can you update here please @riking?


(Kane York) #5

I recently added code to always generate one of those messages whenever a mail fails, because it really isn’t acceptable to be dropping them.

I’ll add code and localization templates for all the cases right now.


Email in fails silently when it doesn't work for whatever reason
(Jeff Atwood) #6

No, but this is also something that @riking is working on. What would you say your ETA is on this crucial bit?


(Michael Downey) #7

This is good, but the sender of the unprocessed e-mail (whether or not a valid user) should probably get some kind of “bounce” message as well.


(Kane York) #8

Yep, that’s the next change, and I think it’s ready:

https://github.com/discourse/discourse/pull/2465

  • When a PM is sent to admins, the full text of the email is included - this makes manual recovery of failed emails possible
  • More errors result in a reply email instead of a message to admins

Email in fails silently when it doesn't work for whatever reason
(Michael Downey) #9

Getting close! :smile:

From: unregistered-address@example.net
Sender: discourse-owner@example.com
Subject: translation missing: en.email_reject_no_account.subject_template
Reply-To: unregistered-address@example.net
To: unregistered-address@example.net

translation missing: en.email_reject_no_account.subject_template

The above is what the user sees as a bounce-back when sending to discourse from an un-registered email address. Seems like (a) it needs some human-readable message translation, in both the body of the e-mail and in the subject, and (b) the From/Sender/Reply-To are messed up.


(Jeff Atwood) #10

@riking any progress on this front?


(Kane York) #11

I pushed some changes that should fix that.

I really need to get my own testing server set up for this.


(Michael Downey) #12

The changes look very good! :thumbsup:

I think this will be enough for me to start pushing additional mailing list traffic to Discourse in earnest now.

The only other thing I could think of would be making it a reply to the failed message (“RE: Foo Bar Baz”) or at least maybe a reference to the subject line along with the address which received the bounced mail.


(Jeff Atwood) #13

Good idea. Can we get the subject line worked in there somewhere @riking?


(Jeff Atwood) #14