Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h1>Howto set up ssmtp to send through a Gmail account</h1> <p>Some of the steps here might seem strange at first, but the rationale is put in footnotes that should hopefully explain why.</p> <p>First create a spare account on gmail which you will only use for sending email. For instance, if your normal account is <code>user@gmail.com</code>, create an account <code>user.noreply@gmail.com</code> with a newly created password which you only will use for this account [1].</p> <p>Set up the new account to forward all email to the normal account [2] and under account settings you should add all other email adresses you use [3].</p> <p>Then install ssmtp (On Debian: <code>aptitude install ssmtp</code>) and edit ssmtp's configuration file <code>/etc/ssmtp/ssmtp.conf</code>:</p> <pre> root=user@gmail.com mailhub=smtp.gmail.com:587 UseSTARTTLS=YES AuthUser=user.noreply AuthPass=passwdusedonlyforthisaccount FromLineOverride=YES </pre> <p>and configure the local mail delivery by editing <code>/etc/ssmtp/revaliases</code> assuming that your local login is <code>localuser</code>:</p> <pre> root:user@gmail.com:smtp.gmail.com:587 localuser:user@gmail.com:smtp.gmail.com:587 </pre> <p>Make sure the two configuration files are readable to all users who should be able to send email [4].</p> <p>Test the setup by e.g. <code>mailx</code> (On Debian: <code>aptitude install bsd-mailx</code>):</p> <pre> echo 'testing, one, two' | mailx -s 'test 1' user@gmail.com </pre> <p>Hope this helps.</p> <hr> <p>[1] The new gmail user name and password will be visible to everyone who can log onto your machine, so you do not want this account to be critical in any way, meaning you can close it down immediately if someone should get access to it.</p> <p>[2] If some email you sent bounces back to you, you might want to know about it, and there actually exists people who will happily reply to an email from <code>johnsmith.noreply</code>.</p> <p>[3] Gmail will rewrite the <code>From</code> header on the email if it does not recognise the address.</p> <p>[4] Ssmtp runs as the local user who sends the email, so that user needs read access to the configuration files.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload