Send mail is one of the old and widely used mail delivery agent/Mail system.
First Please check this link to know more about Mail Server
Configuration Of Sendmail :
1. All the sendmail configuration files are located at /etc/mail
2. Main configuration files are access, sendmail.mc and send mail.cf.
Step1 : Install sendmail packages
#yum install sendmail*
#yum install m4
Step2 : Configure DNS entries in forward look-up zone file
Save the file and exit.
Step3 : Check for configuration errors and reload the DNS server
#named-checkzone example.com /path/to/your/forward/lookup/
#service named reload
Step4 : All the sendmail configuration files are stored in /etc/mail and now configure relay ip address list
Why we require this relay list?
Ans : This is because to secure your sendmail not get spam. So what ever Network/host-names you specified in this access file those networks/host-names only get access to our sendmail.
Entries as follows.
Save and exit the file
Step5 : Now update the file to sendmail database with makemap command
Note : After executing below command you will find access.db, this is the indication that your makemap command worked perfect and database have been updated successfully.
Note : So if you want to relay more networks you have to edit access file.
#makemap hash access < access
Step6 : Configure sendmail.mc file
Step6(a) : Search for "confAUTH_OPTIONS" without quotes open a new line after that and enter below entry in that line define(`confDOMAIN_NAME', 'example.com')dnl
Caution : When using the quotes, "`" opening quote is near to escape key and "'" closing quote is at enter key.
Step6(b) : Search for 127.0.0 line and comment that line if it’s not commented.
Step6(c) : Search for LOCAL_DOMAINN without quotes and modify the line as below from.
Step6(d) : Search for "MASQUERADE_AS" without quotes and modify the line as below from..
Now save the file and exit
Step7 : Now compile sendmail.mc changes to reflect them in sendmail.cf
#m4 sendmail.mc > sendmail.cf
Step8 : Now start/restart the sendmail service
#service sendmail restart
Step9 : Now add the sendmail service to chkconfig list to start automatically at booting times
#chkconfig sendmail on
Dovecot Configuration :
Step1 : Install the dovecot package
#yum install dovecot
Step2 : Search for "protocols" in /etc/dovecot.conf file and replace with below mention line.
#protocols = imap imaps
Replace this with
protocols = pop3 imap imaps
Step3 : Start the dovecot service.
#service dovecot restart
Step4 : Now add the dovecot service to chkconfig list to start automatically at booting times
#chkconfig dovecot on
Testing the mail server
Step1 : Try sending mail using telnet command
#telnet mx.example.com 25