Email with correct incoming email address in bcc is being rejected

AI-generated summary

The discussion revolves around the rejection of emails with a correct incoming email address in the Bcc field. k4rtik referenced a previous discussion stating that Discourse should process emails with addresses in the To, Cc, and Bcc fields. However, when k4rtik sent an email with an unrelated address in the To field and a category incoming email address in the Bcc field, it was rejected with an error message indicating no matching destination address.

k4rtik found that using the Cc field instead of Bcc works. Dannii explained that this is likely due to Bcc addresses not being included in the actual message headers, only in the SMTP envelope.

The error message was updated by tshenry to reflect that only To/Cc addresses are considered. k4rtik is seeking support for the Bcc field, referencing investigation notes from a previous discussion.

At Do we still want to reject CC or Bcc emails in?, it says:

When I send an email To someone (unrelated to my Discourse instance) and BCC a category incoming email address on my instance, I see the following error:

Incoming Email Details

Error

Email::Receiver::BadDestinationAddress

Happens when none of the email addresses in To/Cc/Bcc fields matched a configured incoming email address.

The rejection email that is sent only includes the address used in the To field:

We’re sorry, but your email message to [“xyz@gmail.com”] (titled Test event email) didn’t work.

None of the destination email addresses are recognized, or the Message-ID header in the email has been modified. Please make sure that you are sending to the correct email address provided by staff.

Is this expected behavior? If so, how do I use an incoming email address for a use case where I am sending an email to someone or some list and also want to create a topic in a category on my Discourse instance?

PS: I tested with Cc field and that works. So perhaps, the logic to process emails is only looking at message headers that do not include the Bcc field (for obvious reasons). It will be great if we could use Bcc, however, to prevent people from replying all to Discourse instance (if we do not want them to by bcc’ing).

2 Likes

I think that by convention for BCC emails your address will be on the SMTP envelope, but not in the actual message headers, even though the standards do define a BCC header. The error message should probably be changed to just say To/Cc.

3 Likes

Sure can you make that copy change please @tshenry

2 Likes

Done!

https://github.com/discourse/discourse/commit/5d1b34e1b93469333100a78851614caf2d3d59c8

2 Likes

Thanks for getting the copy fixed. But I’d still prefer to have the BCC field supported. Are there any plans to bring it back? (I also left some code investigation notes at the original topic earlier.)

1 Like