Debian Tutorials

Debian Tutorials


Step by step tutorials showing you how to install and configure various applications and services on Debian based Linux distros.

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories


Installing sSMTP MTA (Mail Transfer Agent)

Ástþór IPÁstþór IP

sSMTP is an extremely simple MTA to get mail off the system to a mail hub. It contains no suid-binaries or other dangerous things – no mail spool to poke around in, and no daemons running in the background. Mail is simply forwarded to the configured mailhost. Extremely easy configuration.

This is ideal for web servers to avoid running MTA daemons like sendmail, Exim and Postfix which use up resources on the server.

1. Install sSMTP (Note: Any previously installed MTA will be removed)

apt-get install ssmtp

2. Configure the server (pico /etc/ssmtp/ssmtp.conf)

mailhub=mail.example.org
FromLineOverride=YES

Replace mail.example.org with the external mail server that you want to relay all mail to.

If you would like to relay through Google Mail servers, change these configuration values:

mailhub=smtp.gmail.com:587
UseSTARTTLS=Yes
AuthUser={username}
AuthPass={password}
FromLineOverride=YES

Replace {username} with your Gmail username and {password} with your Gmail password.

That’s all! sSMTP doesn’t run as service so there’s no restart required. sSMTP creates a link to /usr/sbin/sendmail which most programs use by default to send mail including PHP.

Comments 3
  • drakun
    Posted on

    drakun drakun

    Author

    Can’t send mail: sendmail process failed with error code 1


  • Keratina
    Posted on

    Keratina Keratina

    Author

    Works excellent!


  • Android
    Posted on

    Android Android

    Author

    I recommend installing mailutils before then creating a symbolic link after. That way ssmtp is your default mta for the system.