PDA

View Full Version : ssmtp config on FreeBSD 6.2 to use BlueHost mail server


isaacgrover
03-13-2007, 09:34 PM
Good evening from Wisconsin,

I was going to ask how to configure ssmtp on a FreeBSD 6.2 box so it would send mail using the BlueHost mail servers, but now that I have it working correctly, I'm going to share instead. =)

Here's what I did:
# cd /usr/ports/mail/ssmtp
# make install replace clean
# cd /usr/local/etc/ssmtp
# cp revaliases.sample revaliases
# cp ssmtp.conf.sample ssmtp.conf
# vi revaliases
# vi ssmtp.conf
# vi testfile.txt
# /usr/local/sbin/ssmtp OTHERUSER@MYDOMAIN.com < testfile.txt
# /usr/local/sbin/ssmtp OTHERUSER@OTHERDOMAIN.com < testfile.txt

contents of revaliases:
# ---
root:USERNAME@MYDOMAIN.com:mail.MYDOMAIN.com
# ---

contents of ssmtp.conf:
# ---
root=
mailhub=mail.MYDOMAIN.com:25
authuser=USERNAME@MYDOMAIN.com
authpass=PASSWORD
rewriteDomain=MYDOMAIN.com
hostname=_HOSTNAME_
FromLineOverride=YES
# ---

contents of testfile.txt:
# ---
From: USERNAME@MYDOMAIN.com
Subject: this is a test message...

... using ssmtp.

END OF MESSAGE
# ---

If you receive the contents of testfile.txt at OTHERUSER@MYDOMAIN.com and OTHERUSER@OTHERDOMAIN.com, then all is well.

Note: using the ssmtp binary to send a message takes about five seconds, and using the mail binary to send a message takes less than a second on my system. I'm not sure why, but if you find out - post back to this thread.

Hope that helps someone.

Isaac Grover