Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


Sending email on linux using SSMTP.

Edit ~/.muttrc for each user as appropriate (not that $HOSTNAME does not seem to be set with cron sending)

set sendmail="/usr/sbin/ssmtp"
#set from = [email protected]$HOSTNAME
#set from = [email protected]_OR_ALIAS.domain
set realname="[email protected]"

If you get an error like “Cannot open mailhub:25” you need to add the problematic user to the “mail” group. See information on setting permissions here:

Update 26 January 2014:

Gmail stopped sending, found information at

Add this line to /etc/ssmtp/ssmtp.conf


Update 4 April 2015:

Gmail stopped sending, couldn't connect to smtp server per /var/log/maillog errors. It suddenly started working again. Used “swaks” to troubleshoot per and saw this error:

IO::Socket::INET6: connect: Network is unreachable

Test was: $ swaks -tls -f [email protected] -t [email protected] -s -a LOGIN

Seemed to be an IPv6 problem.

Additional info for CentOS6:

4 November 2015

Gmail stopped working.

This did not work:!topic/gmail/2tK2fR7yW-k;context-place=forum/gmail

Try a PHP or Perl solution, but does it require SSMTP or MSMTP?

Final answer was to configure Gmail as a Relay

gmail_on_linux_with_ssmtp.txt · Last modified: 2016/10/22 08:29 by juckins