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.37k forks source link

TLS padlock for received emails #1564

Open ridem opened 8 years ago

ridem commented 8 years ago

A few weeks ago, Gmail introduced a new padlock next to received e-mails to tell if TLS has been used by the sender. If not, a red padlock appears. More info: http://mashable.com/2016/02/13/gmail-encryption/

In the Raw source, it's a line in the "Received" Header that goes like this: (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);

They also have that feature for emails you're about to send, but they're caching domains and previous email exchanges with them to give the information, it would require way more work.

I guess this could be in a core plugin (inside phishing detector, renamed?) If it's in line with the project I could give it a try with a PR.

emorikawa commented 8 years ago

That sounds like a great plugin idea & definitely in line with what we want. You can probably make that a stand alone plugin easily. The Phishing one would be a great piece of code to copy to get started. Happy to help out as well.

mbilker commented 8 years ago

@emorikawa Is the necessary information for the Header information available through the local Database? Would the plugin need to make an API request to receive the raw message and parse it to check each step used TLS to send the message?

mbilker commented 8 years ago

This sounds like an interesting plugin I could develop.

ridem commented 8 years ago

Cool! I can have a look at it when I have time then, the phishing plugin seems perfect to start off with.

NB @emorikawa : I think it would be a great improvement to the Nylas infrastructure to gather per-domain TLS stats out of sent messages raw data, you guys would get a huge and very valuable database. It would be useful for N1 users to know in advance if TLS will be used, but I guess there would even more service potential than that.

ridem commented 8 years ago

@mbilker : We could join forces if you want! ;)

ridem commented 8 years ago

@mbilker : It's possible through the API (https://www.nylas.com/docs/#raw_message_contents) but I guess it's not part of the local database, because the only place it's used in the code is at: https://github.com/nylas/N1/blob/master/internal_packages/message-list/lib/message-controls.cjsx#L116

I now understand why the phishing plugin does so little (no DKIM / SPF checks on the source) because reply_to & co. is the only thing it can use from the local database.

mbilker commented 8 years ago

@ridem I knew about that because that feature is available if you click on the space the left of the reply button. I prefer to not do an API request and have N1 handle it or store all of the information locally.

mbilker commented 8 years ago

Good to know though!

ridem commented 8 years ago

@mbilker yeah I actually found that feature by looking at the code, nice one.

And I agree that grabbing the whole raw source again and doing the parsing from the client is not clean at all. Getting an API feature to request a few additional headers would be awesome, there are so many things you could do with it for suspicious messages detection (DKIM, SPF, etc.), or unsubscribe to newsletters with "List-Unsubscribe".