You can use gmail or any other SMTP server as a smart host to send all messages from your Linux / UNIX desktop systems. You need to use a simple program called ssmtp. It accepts a mail stream on standard input with recipients specified on the command line and synchronously forwards the message to the mail transfer agent of a mailhub for the mailhub MTA to process.
# yum install ssmtp
# vi /etc/ssmtp/ssmtp.conf
Modify the following setting to setup SMTP mail server. Here, we have configured Google SMTP server to send mail.
AuthUseremail@example.com AuthPass=*********** FromLineOverride=YES mailhub=smtp.gmail.com:587 UseSTARTTLS=YES
Note: Before using this method to send mail, you need to disable sendmail.
# service sendmail stop
# chkconfig sendmail off
Now, you can use mail / mailx command to send email messages. You can also write a shell script to backup your files and email to somewhere else (see below). You can test settings using following syntax:
echo “This is a test” | mail -s “Test” firstname.lastname@example.org
Limittation of sSmtp:
sSMTP works well for desktop systems, but it is not a replacement for Sendmail / Postfix / Exim / Qmail for email server environment. This software is perfect for a single user system.For any query or issue, feel free to discuss on http://discuss.eduguru.in