Install SMTP client on Ubuntu server

Posted on 26.09.17   Linux SSMTP Ubuntu

  1. Install the light-weight SMTP client “ssmtp”
    sudo apt-get update && sudo apt-get install ssmtp

  2. Configure ssmtp (sudo nano /etc/ssmtp/ssmtp.conf) [1] and set correct info for the following lines:
    1. root=
    2. mailhub=
    3. AuthUser=
    4. AuthPass=
    5. hostname=
    6. rewriteDomain=

  3. Make aliases for the local user to correct email address [2]
    sudo nano /etc/ssmtp/revaliases

  4. ssmtp uses the local users Full name from the OS as the email sender, so make sure your name is correct. Change by using command
    sudo chfn -f "John Doe" yourUser

  5. Verify ssmtp works by sending a test mail with command [3]


[1]: Example config

# Config file for sSMTP sendmail
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named


# Where will the mail seem to come from?

# The full hostname

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address


[2]: Example aliases

# sSMTP aliases
# Format: local_account:outgoing_address:mailhub
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.


[3]: Example ssmtp test

Subject: Testing ssmtp
enter your body text here
via SMTP server.


More on ITDB

Managing WiFi profiles in Windows 10

Telnet alternative to check if port is open on host

Turn off CTRL + ALT + DEL at login prompt Windows 10

How to debug a non starting application with ProcMon

Create a cmd alias/shortcut for issuing commands on remote computer