How to install and configure sSMTP on CentOS / Fedora / Redhat | TechGyaan

Source http://www.techgyaan.org/2011/09/how-to-install-and-configure-ssmtp-on-html/

Is it possible to have that be sent via an external SMTP server, like G-mail ?
Yes, use sSMTP for replace sendmail
 
I have install the ssmtp to CentOS3.9 successfully 
wget http://ftp.riken.jp/Linux/fedora/epel/4/SRPMS/ssmtp-2.61-15.el4.src.rpm
rpm -Uhv krb5-* –oldpackage # install krb5-devel
rpm -ihv ssmtp-2.61-15.el4.src.rpm
cd /usr/src/redhat/SPECS
vi ssmtp.spec
….
%build
#on RHEL3 krb5 is somewhere else
#test -e /usr/include/krb5.h || CPPFLAGS="-I/usr/kerberos/include" 
#CPPFLAGS=$(pkg-config –cflags-only-I openssl)
%define cppflags -I/usr/kerberos/include  
%configure –enable-ssl –enable-md5auth –enable-inet6
make %{?_smp_mflags} CPPFLAGS=%{cppflags}
%install
….
rpmbuild  -bb ssmtp.spec
rpm -Uhv /usr/src/redhat/RPMS/i386/ssmtp-2.61-15.i386.rpm –force
rm -f /etc/alternatives/mta
ln -s /usr/sbin/ssmtp   /etc/alternatives/mta
vi /etc/ssmtp/ssmtp.conf
—————
root=phillips
mailhub=10.1.10.35
Hostname=h141-100.falconstor.com.tw
FromLineOverride=YES
UseTLS=NO