Linux – Encrypting all outgoing email

emailencryptionlinuxsendmail

I have a client requirement to encrypt all outgoing email from a linux server. This can be done using any software, sendmail/postfix etc. They have given me the key they want to use, and want all forms (using php) to be encrpyted. Can I set sendmail/etc to encrypt all emails? This could be done with the same key for all mail.

Thanks

Best Answer

If you want to encrypt your outgoing mail using GnuPG, without involving your PHP code, then GNU Anubis might be what you are looking for. It can sit in-front of your SMTP server and (among other things) apply GnuPG encryption to your mails.

The potential issue here is that Anubis both accepts and submits mail using SMTP. While there obviously isn't any problem with using SMTP to pass the mails along to Postfix, PHP tend to use the local sendmail binary. One possible solution, which I haven't tried myself, is to point PHP:s sendmail_path= toward the Anubis helper script msg2smtp.pl

Of course, if there's multiple Postfixes involved, one on your web server as well as one on your companies designated mail server, then there really isn't any problem. In that case all you have to do is simply plug Anubis in between.