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 set
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=myaddress@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=mail.myisp.net

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

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

# The full hostname
hostname=behemoth.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=YES

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

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

# Use this RSA certificate.
#TLSCert=/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=root,
size=3948, class=0, nrcpts=2, msgid=<
200603291558.k2TFwkuV041971@mydomain.com>, relay=root@localhost
Mar 29 10:58:47 behemoth sendmail[41971]: k2TFwkuV041971: to=message,
address@domain.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00,
mailer=relay, pri=63948, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0,
stat=Deferred: 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(221
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>