Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Mar 2006 11:08:08 -0500
From:      "Andy Greenwood" <greenwood.andy@gmail.com>
To:        "FreeBSD Questions" <freebsd-questions@freebsd.org>
Subject:   ssmtp
Message-ID:  <3ee9ca710603290808t641bd090y550bb54216a55cb0@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I'm having some trouble setting up ssmtp. I want to use logrotate to
compress and email my server's logs to my gmail account. I can echo text
directly to ssmtp and have it send the message ok, but when I try to use
/usr/bin/mail, I get logs in my maillog trying to use sendmail, which is se=
t
to none in rc.conf. How do I set this up so that all mail sends out through
ssmtp?

 /usr/local/etc/ssmtp/ssmtp.conf
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#

# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=3Dmyaddress@myisp.net

# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and your mailhub is so
named.
mailhub=3Dmail.myisp.net

# Example for SMTP port number 2525
# mailhub=3Dmail.your.domain:2525
# Example for SMTP port number 25 (Standard/RFC)
# mailhub=3Dmail.your.domain
# Example for SSL encrypted connection
# mailhub=3Dmail.your.domain:465

# Where will the mail seem to come from?
rewriteDomain=3Dmyisp.net

# The full hostname
hostname=3Dbehemoth.mydomain.com

# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
#FromLineOverride=3DYES

# Use SSL/TLS to send secure messages to server.
#UseTLS=3DYES

# Use SSL/TLS certificate to authenticate against smtp host.
#UseTLSCert=3DYES

# Use this RSA certificate.
#TLSCert=3D/usr/local/etc/ssmtp/ssmtp.pem


Here's an example:
#mail -s test message address@domain.com < Some_File
#tail /var/log/maillog
Mar 29 10:58:47 behemoth sendmail[41971]: k2TFwkuV041971: from=3Droot,
size=3D3948, class=3D0, nrcpts=3D2, msgid=3D<
200603291558.k2TFwkuV041971@mydomain.com>, relay=3Droot@localhost
Mar 29 10:58:47 behemoth sendmail[41971]: k2TFwkuV041971: to=3Dmessage,
address@domain.com, ctladdr=3Droot (0/0), delay=3D00:00:01, xdelay=3D00:00:=
00,
mailer=3Drelay, pri=3D63948, relay=3D[127.0.0.1] [127.0.0.1], dsn=3D4.0.0,
stat=3DDeferred: Connection refused by [127.0.0.1]
Obviously I don't get anything coming through with this example

but
#echo test | ssmtp address@domain.com
#tail /var/log/maillog
Mar 29 11:03:24 behemoth sSMTP[42000]: Sent mail for myaddress@myisp.net(22=
1
ibm58aec.myisp.net ESMTP server closing connection)
I do recieve this message

I'd be happy to provide any other information to anyone who can help me set
this up.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3ee9ca710603290808t641bd090y550bb54216a55cb0>