Solved ssmtp not sending emails

Hi,
I have installed /ports/mail/ssmtp to replace sendmail on my FreeBSD 10.2 jail but I cannot receive any email from the server.
To clarify, the mail server is also in a jail on the same host but is using a dedicated plublic IP on EXTIF where my jails run on lo1 10.8.xx.xx

When I run the following commands, I get the exact same error message:
mail -s "test email" myemail@gmail.com
Code:
Feb 18 14:51:25 jailhostname sSMTP[53680]: Creating SSL connection to host
Feb 18 14:51:25 jailhostname sSMTP[53680]: SSL connection using ECDHE-RSA-AES256-GCM-SHA384
Feb 18 14:51:25 jailhostname sSMTP[53680]: RCPT TO:<myemail@gmail.com> (554 5.7.1 <unknown[10.8.20.14]>: Client host rejected: Access denied)
mail -s "test email" root
Code:
Feb 18 14:51:25 jailhostname sSMTP[53680]: Creating SSL connection to host
Feb 18 14:51:25 jailhostname sSMTP[53680]: SSL connection using ECDHE-RSA-AES256-GCM-SHA384
Feb 18 14:51:25 jailhostname sSMTP[53680]: RCPT TO:<alerts@mydomain.co.uk> (554 5.7.1 <unknown[10.8.20.14]>: Client host rejected: Access denied)
Here are my config files:
/etc/ssmtp/ssmtp.conf
Code:
root=alerts@mydomain.co.uk
mailhub=mail.mydomain.co.uk:465
rewriteDomain=mydomain.co.uk
hostname=FQDN
UseTLS=YES
etc/ssmtp/revaliases
Code:
root:alerts@mydomain.co.uk:mail.mydomain.co.uk
alerts@mydomain.co.uk is an alias and not a proper mailbox, so this is why I haven't got a password in the file above.

Hope someone can help
 
Last edited:
SOLUTION: use one of the following 3 options
1. use a real mailbox instead of aliases
2. Add in the following directive:
Code:
# Alternatively, you can specify the mynetworks list by hand, in
# which case Postfix ignores the mynetworks_style setting.
#
# Specify an explicit list of network/netmask patterns, where the
# mask specifies the number of bits in the network part of a host
# address.
#
# You can also specify the absolute pathname of a pattern file instead
# of listing the patterns here. Specify type:table for table-based lookups
# (the value on the table right-hand side is not used).
#

mynetworks = xxx.xxx.xxx
3. comment
Code:
-o smtpd_client_restrictions=permit_sasl_authenticated,reject

As I had no reply, I hope this could help someone else here :)
 
Back
Top