How do I encrypt outgoing system emails via GPG on ubuntu 14.04?

April 8, 2015 1.1k views
Security Nginx PHP System Tools Email Ubuntu

I'm running a simple HTML website on Ubuntu 14.04 managed by Serverpilot (NGINX).
The form on my (forced SSL) website uses a simple PHP mailer to send visitor messages to my external email account.
Is there a way to encrypt all form entries via GPG (or PGP) before sending it to my external email account?

P.S.: I don't mind if your method makes all system mails encrypted by default.

1 Answer

I was able to locate a couple options for you to do this:

  • An answer here suggests using GNU Anubis to encrypt emails but this may require using SMTP for your sending rather than the php mail() function.
  • The answer to this question demonstrates how to encrypt the content of your message in PHP before sending it using GnuPG.
  • Thank you very much for your swift response!
    I will read into this - since I have no idea which solution is easier to integrate in my existing form template.

Have another answer? Share your knowledge.