I have an application that would send sensitive data through email to specific users. I have setup a google business account which provides email addresses on my business domain. I will be sending email through Nodejs nodemailer over smtp protocol with TSL. The way I understand it, the data being transferred between my server and gmail server and the data then delivered to the user's email address will be sent through secure encrypted channel. I am mainly worried about the security of data being sent from my server to the gmail server. Will this be secure or should I set up my own email server?
If you are worried about the confidentiality of the data you're sending:
Use end to end encryption and make it mandatory.
The two (more or less popular) alternatives that will both serve the purpose are
If you are only worried about the transfer to the google servers, as long as you are making sure using SMTP with TLS, the transport way is secure.
While the end-to-end encryption only encrypts the message body, the message headers (as well as the message, if you are not using end-to-end encryption) are transmitted over the secure connection between the SMTP server and your server, thus only accessable for those parties, as far as your question goes.
Keep in mind that this is only true as long as the user does check his/her mails over a secure connection, which you have no control over.
At a minimum, if you soley rely on SMTP with TLS, all hops of your email must be trusted by you to exclusively use TLS and to respect the privacy of the user.
Those are, at least:
- Your server,
- The user's email provider,
- Potentially many of those, depending on the forwarding the user has configured,
- The user.
Bottom line being, as you cannot establish that trust:
Make either S/MIME or PGP/GPG mandatory to protect the sensitive user data on transit.
You should use end-to-end encryption, if you send sensitive data. And do not use gmail, it is not secure (they don't respect privacy).
I'm currently using an e-mail service from https://www.autistici.org, which is a volunteer organization. You may want to check.
Keep in mind, even if you use end-to-end encryption, you can't encrypt e-mail headers (title, from, to etc.)
And actually there is a new mailing protocol under development, called DarkMail, to create a secure e-mailing protocol. But, not ready yet.