How to configure sSMTP to send emails to more than one email address?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












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:



root=MY_GMAIL_ADDRESS@gmail.com
mailhub=smtp.gmail.com:587
UseTLS=YES
UseSTARTTLS=YES

AuthUser=MY_GMAIL_ADDRESS@gmail.com
AuthPass=___MY_GMAIL_PASSWORD___

rewriteDomain=gmail.com
hostname=alien
FromLineOverride=YES


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?



Update



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?...










share|improve this question























  • @SebastianStark I expect to be able to use a single sSMTP conf for 2 apps or more, instead just one. When I read the above configuration I say to myself "The root, AuthUser and AuthPass all fit for 1 account, but what if I have multiple accounts to send mail to?".
    – JohnDoea
    Mar 14 at 20:16











  • Don't forget to change the hostname from alien to whatever echo $HOSTNAME reveals. Expanding on Sebastian's point about root, if someone types the sudo password wrong root will get an email. If a cron job fails root will get an email, etc.
    – WinEunuuchs2Unix
    Mar 14 at 22:41














up vote
1
down vote

favorite












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:



root=MY_GMAIL_ADDRESS@gmail.com
mailhub=smtp.gmail.com:587
UseTLS=YES
UseSTARTTLS=YES

AuthUser=MY_GMAIL_ADDRESS@gmail.com
AuthPass=___MY_GMAIL_PASSWORD___

rewriteDomain=gmail.com
hostname=alien
FromLineOverride=YES


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?



Update



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?...










share|improve this question























  • @SebastianStark I expect to be able to use a single sSMTP conf for 2 apps or more, instead just one. When I read the above configuration I say to myself "The root, AuthUser and AuthPass all fit for 1 account, but what if I have multiple accounts to send mail to?".
    – JohnDoea
    Mar 14 at 20:16











  • Don't forget to change the hostname from alien to whatever echo $HOSTNAME reveals. Expanding on Sebastian's point about root, if someone types the sudo password wrong root will get an email. If a cron job fails root will get an email, etc.
    – WinEunuuchs2Unix
    Mar 14 at 22:41












up vote
1
down vote

favorite









up vote
1
down vote

favorite











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:



root=MY_GMAIL_ADDRESS@gmail.com
mailhub=smtp.gmail.com:587
UseTLS=YES
UseSTARTTLS=YES

AuthUser=MY_GMAIL_ADDRESS@gmail.com
AuthPass=___MY_GMAIL_PASSWORD___

rewriteDomain=gmail.com
hostname=alien
FromLineOverride=YES


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?



Update



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?...










share|improve this question















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:



root=MY_GMAIL_ADDRESS@gmail.com
mailhub=smtp.gmail.com:587
UseTLS=YES
UseSTARTTLS=YES

AuthUser=MY_GMAIL_ADDRESS@gmail.com
AuthPass=___MY_GMAIL_PASSWORD___

rewriteDomain=gmail.com
hostname=alien
FromLineOverride=YES


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?



Update



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?...







email postfix nginx wordpress gmail






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 15 at 6:03

























asked Mar 14 at 17:04









JohnDoea

28391852




28391852











  • @SebastianStark I expect to be able to use a single sSMTP conf for 2 apps or more, instead just one. When I read the above configuration I say to myself "The root, AuthUser and AuthPass all fit for 1 account, but what if I have multiple accounts to send mail to?".
    – JohnDoea
    Mar 14 at 20:16











  • Don't forget to change the hostname from alien to whatever echo $HOSTNAME reveals. Expanding on Sebastian's point about root, if someone types the sudo password wrong root will get an email. If a cron job fails root will get an email, etc.
    – WinEunuuchs2Unix
    Mar 14 at 22:41
















  • @SebastianStark I expect to be able to use a single sSMTP conf for 2 apps or more, instead just one. When I read the above configuration I say to myself "The root, AuthUser and AuthPass all fit for 1 account, but what if I have multiple accounts to send mail to?".
    – JohnDoea
    Mar 14 at 20:16











  • Don't forget to change the hostname from alien to whatever echo $HOSTNAME reveals. Expanding on Sebastian's point about root, if someone types the sudo password wrong root will get an email. If a cron job fails root will get an email, etc.
    – WinEunuuchs2Unix
    Mar 14 at 22:41















@SebastianStark I expect to be able to use a single sSMTP conf for 2 apps or more, instead just one. When I read the above configuration I say to myself "The root, AuthUser and AuthPass all fit for 1 account, but what if I have multiple accounts to send mail to?".
– JohnDoea
Mar 14 at 20:16





@SebastianStark I expect to be able to use a single sSMTP conf for 2 apps or more, instead just one. When I read the above configuration I say to myself "The root, AuthUser and AuthPass all fit for 1 account, but what if I have multiple accounts to send mail to?".
– JohnDoea
Mar 14 at 20:16













Don't forget to change the hostname from alien to whatever echo $HOSTNAME reveals. Expanding on Sebastian's point about root, if someone types the sudo password wrong root will get an email. If a cron job fails root will get an email, etc.
– WinEunuuchs2Unix
Mar 14 at 22:41




Don't forget to change the hostname from alien to whatever echo $HOSTNAME reveals. Expanding on Sebastian's point about root, if someone types the sudo password wrong root will get an email. If a cron job fails root will get an email, etc.
– WinEunuuchs2Unix
Mar 14 at 22:41










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










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.



Security



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.






share|improve this answer






















  • Typically I use Carbon Copy (yes they had those in Grade 2!) aka CC: to send to more than one address. I've always been weak on networking but I think ssmtp can be considered the topology or network layer and wordpress (or whatever) can be considered the application layer that inserts the CC: address.
    – WinEunuuchs2Unix
    Mar 15 at 1:30










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1014937%2fhow-to-configure-ssmtp-to-send-emails-to-more-than-one-email-address%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










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.



Security



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.






share|improve this answer






















  • Typically I use Carbon Copy (yes they had those in Grade 2!) aka CC: to send to more than one address. I've always been weak on networking but I think ssmtp can be considered the topology or network layer and wordpress (or whatever) can be considered the application layer that inserts the CC: address.
    – WinEunuuchs2Unix
    Mar 15 at 1:30














up vote
3
down vote



accepted










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.



Security



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.






share|improve this answer






















  • Typically I use Carbon Copy (yes they had those in Grade 2!) aka CC: to send to more than one address. I've always been weak on networking but I think ssmtp can be considered the topology or network layer and wordpress (or whatever) can be considered the application layer that inserts the CC: address.
    – WinEunuuchs2Unix
    Mar 15 at 1:30












up vote
3
down vote



accepted







up vote
3
down vote



accepted






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.



Security



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.






share|improve this 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.



Security



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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 27 at 8:13

























answered Mar 14 at 23:35









Sebastian Stark

4,723938




4,723938











  • Typically I use Carbon Copy (yes they had those in Grade 2!) aka CC: to send to more than one address. I've always been weak on networking but I think ssmtp can be considered the topology or network layer and wordpress (or whatever) can be considered the application layer that inserts the CC: address.
    – WinEunuuchs2Unix
    Mar 15 at 1:30
















  • Typically I use Carbon Copy (yes they had those in Grade 2!) aka CC: to send to more than one address. I've always been weak on networking but I think ssmtp can be considered the topology or network layer and wordpress (or whatever) can be considered the application layer that inserts the CC: address.
    – WinEunuuchs2Unix
    Mar 15 at 1:30















Typically I use Carbon Copy (yes they had those in Grade 2!) aka CC: to send to more than one address. I've always been weak on networking but I think ssmtp can be considered the topology or network layer and wordpress (or whatever) can be considered the application layer that inserts the CC: address.
– WinEunuuchs2Unix
Mar 15 at 1:30




Typically I use Carbon Copy (yes they had those in Grade 2!) aka CC: to send to more than one address. I've always been weak on networking but I think ssmtp can be considered the topology or network layer and wordpress (or whatever) can be considered the application layer that inserts the CC: address.
– WinEunuuchs2Unix
Mar 15 at 1:30

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1014937%2fhow-to-configure-ssmtp-to-send-emails-to-more-than-one-email-address%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491