Skip to main content

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

sSMTP is alternative to Sendmail.  sSMTP is a send-only sendmail emulator for machines which normally pick their mail up from a centralized mailhub (via pop, imap, nfs mounts or other means). It provides the functionality required for humans and programs to send mail via the standard or /usr/bin/mail user agents. It is used to send mail to external email address after authentication with valid mail account.

Download & Install
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# yum -y install ssmtp
Now we will edit the ssmtp configuration file. 
# cd /etc/ssmtp
# vim /etc/ssmtp/ssmtp.conf
Here is the custom configuration 
MailHub=mail.techgyaan.org:25          # SMTP server hostname and port
UseTLS=NO                              # Secure connection (SSL/TLS)
FromLineOverride=YES                   # Force the From: line
Hostname=mail.techgyaan.org            # The name of this host
RewriteDomain=mail.techgyaan.org       # The host the mail appears to be coming from
Root=Bala                              # Redirect mail for root@ to postmaster@
AuthUser=bala@techgyaan.org            # Your DreamHost mail account
AuthPass=myemailpassword               # The password for the mail account
Now let’s configure the Aliases
# vim /etc/ssmtp/revaliases 
root:alerts@techgyaan.org:mail.techgyaan.org:25
Postmaster:alerts@techgyaan.org:mail.techgyaan.org:25
Bala:bala@techgyaan.org:mail.techgyaan.org:25
If you would like to change the "From" Display Name, edit the /etc/passwd and modify the user alias
# vim /etc/passwd 
alerts:Alerts:507:507::/home/alerts:/bin/bash
bala:BALA:505:506::/home/bala:/bin/bash
postmaster:POSTMASTER:505:506::/home/postmaster:/bin/bash
Before we start using sSMTP lets stop the sendmail which is default installed on all Linux distribution.Stop sendmail service to start after reboot
# service sendmail stop
# sudo chkconfig --levels 2345 sendmail off
Move or replace the sendmail and then create a symbolic link for sSMTP to sendmail with authentication
# mv /usr/sbin/sendmail /usr/sbin/sendmail.orig
# ln -s /usr/sbin/ssmtp /usr/sbin/sendmail
We all done with the installation and configuration let’s send a test mail to internal & external email address using sSMTP. 
echo "Sending Test mail to external & Internal email address"| mail -s "This is the test message using sSMTP" bala@techgyaan.org bala@gmail.com

Feedbacks: We appreciate your feedbacks and suggestions about our website bala@techgyaan.org
Check out . Follow @techgyaan  full-width

Comments

Popular posts from this blog

Download of the Day!

Amarok 2.0.2 has released Amarok is an open source alternative music player for iTunes. Amarok supports Linux, Unix, MacOSX and windows Operating system. It is smiliar to iTunes just drag & drop the songs to play list. Amarok also lets you listen to internet radio ( mp3 streaming ) including music from last.fm . Features Automatic cover Lyrics download Dynamic playlists Visualizations and Podcasting. These are only some of the great new features of Amarok 2. Give it a try! Download here An least but not last - Amarok will also synchronize your music to your iPod. For the more technical users a scripting interface allows you to extend the functionality of Amarok. Print Page Feedbacks: We appreciate feedbacks and suggestions about our website info@techgyaan.org

How to install WebLogic 8 on Solaris 10

Lets start the installation Login to solaris box use sudo command to install the application. $ ./server814_solaris32.bin Extracting 0%……………………………………………………………………………………….100% Unable to instantiate GUI, defaulting to console mode. Welcome: ——– ————— This installer will guide you through the installation of WebLogic Server 8.1 SP4. Type “ Next” or enter to proceed to thenext prompt. If you want to change data entered previously, type “Previous”. You may quit the installer at any time by typing “ Exit”. Enter [Exit][Next]> BEA Systems License Agreement: —————————— BEA SYSTEMS, INC. SOFTWARE LICENSE AGREEMENT USE OF SOFTWARE ORDERED FROM BEA SYSTEMS, INC. (”BEA”) IS PROVIDED ONLY UNDER LICENSE FROM BEA. PLEASE READ THE FOLLOWING LICENSE CAREFULLY AND INDICATE YOUR ACCEPTANCE BY CLICKING THE ACCEPTANCE BOX. CERTAIN CAPITALIZED TERMS ARE DEFINED IN SECTION 11. 1. LICENSE TERMS a. Workshop Free Use. The terms of this Section 1(a) are applicable to you if you h...

Sysadmin Daily Commands

Some of these commands are used by unix/linux administrator in his/her day-to-day activities  cat to concatenate files to standard output chgrp to change file group ownership chmod to change file access permissions chown to change file owner and group cp to copy files and directories date to print or set the system data and time dd to convert and copy a file df to report filesystem disk space usage dmesg to print or control the kernel message buffer echo to display a line of text hostname to show or set the system's host name kill to send signals to processes ln to make links between files login to begin a session on the system ls to list directory contents mkdir to make directories mknod to make block or character special files more to page through text mount to mount a filesystem mv to move/rename files ps to report process status pwd to print na...