Ubuntu – How to configure sSMTP to send emails to more than one email address


I use Ubuntu 16.04 with Bash, Nginx, and sSMTP. On this environment I have 2 or more WordPress apps.

The basic configuration of sSMTP allows it to route WordPress contact form emails from one app, into my personal email account (Gmail).

sudo cat /etc/ssmtp/ssmtp.conf:




My question

In case I have 2 or more apps, how should the sSMTP conf be reconstructed when the Ubuntu user has 2 or more apps?


In your answer, please also refer to the issue of security. Putting my personal Gmail password exposed in a config file seems like a security risk, not something I want to do. On the other hand, I don't want to create a second Gmail account, or I must and should shut up and do so?…

Best Answer

  • Generally, there is no need to change your ssmtp configuration. If you want to stick to your single gmail account you could maybe use the + extension feature, where you can extend your gmail address by adding +something to the part before @gmail.com.

    This way you get all the emails in your gmail account but you can tell them apart by the bit you added after the +. (more information here).

    But you could also just choose to configure any other email address in wordpress.


    As for the security aspect of this: If you can avoid putting your very personal email account password in a system file in cleartext, especially on a system running wordpress (has quite a history of being hacked), it would be much better. You have several choices here (most of which would deviate too much from the original topic of this question):

    1. Simply create another Gmail account that you use only for this purpose: authenticating an smtp session for ssmtp. You will still be able to send emails to your regular gmail account, but not have to put its valuable password in the config file.

    2. Setup and configure an smtp server on your machine.

    3. Another option would be to check if your provider (the one where your wordpress server is located) offers an smtp server. Normally this does not even need smtp authentication to be set up. That would be the preferred option in my opinion.

  • Related Question