A simple alternative is to install ssmtp. On ubuntu:
$ sudo aptitude install ssmtpand then edit /etc/ssmtp/ssmtp.conf. Here is an example configuration that uses a Gmail account for relaying:
#
# Config file for sSMTP sendmail
mailhub=smtp.gmail.com:587
AuthUser=youraccount@example.com
AuthPass=yourpassword
UseSTARTTLS=YES
# The full hostname of this machine
hostname=yourhost.example.com
# Allow users to set their own From: address?
FromLineOverride=YES
You send mail using /usr/sbin/ssmtp just as you would with sendmail, but without any of the sendmail.cf configuration business.
As a bonus, ssmtp sets up symlinks for /usr/lib/sendmail and /usr/sbin/sendmail such that if you have an existing script that calls sendmail it will probably work as is one a system with ssmtp installed.
Here is a ssmtp man page.
1 comment:
Post a Comment