nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.81k stars 1.38k forks source link

Nylas Pro: Sending from alias uses default email address in SMTP envelope headers #3224

Open nanoamp opened 7 years ago

nanoamp commented 7 years ago

tl;dr Emails for a custom IMAP/SMTP account which are sent from an alias always use the default address in the SMTP envelope headers. If the default address is invalid on the SMTP server, then sending will fail, even if the alias is valid. If I'm using an alias, I'd expect the alias to be in the envelope headers, and not some other address that I might not want to be made public.

I have a custom IMAP/SMTP account which supports multiple aliases. It's set up with SSL authentication and uses a default email address which is invalid on the SMTP server. In other email clients, I have done this so that if I post using that address, then it fails, to force me to pick the right alias and re-send.

In Nylas N1/Pro, when I try to send an email from an alias (or reply to an email sent to that alias), then I get an error that sending has failed and it may not have been received:

Error sheet

If I check the activity queue, I can see:

MultiSendToIndividualTask (ID: 7d02) FAILED (PROCESSING REMOTE) APIError 402 Sending to all recipients failed

If I expand the details in the queue log, then the recipient and sender are correct, as set in the client. There is nothing else interesting in N1's detailed logs at this time. There's nothing obvious to explain a 402 error.

If I check my SMTP server's logs, then I see authenticated submission attempts. However, they report coming from the default address for the sending account (ie. not the alias). As the default address is blocked on the server, the email is not sent to the recipients.

If I update the connection settings in Nylas Pro to use a valid default address, then the email is sent. The X-Envelope-From and Return-Path headers contain the default address; only the From header contains the alias. If I'm using an alias, I'd expect that to be in the envelope headers, and not some other address that I might not want to be made public.

Are there any related issues?

I can't find any reports citing the 402 error code or relevant issues with alias handling.

What operating system are you using?

OS X El Capitan.

What version of N1 are you using?

1.5.0

Bug?

Do you have any third-party plugins installed? If so, which ones?

No, only built-ins

Is the issue related to a specific email provider (Gmail, Exchange, etc.)?

Custom IMAP/SMTP

jstejada commented 7 years ago

thanks for the report @nanoamp ! We are going to look into it