# yum install sendmail sendmail.cf
# Open /etc/mail/sendmail.mc and look for this line:
change this line to
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Sendmail doesn't actually read this file. It reads a file called sendmail.cf. To create this file, you need to use the m4 compiler. Issue this command:
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# /etc/init.d/sendmail start
There should be a file called /etc/mail/local-host-names. This is a plain text file with a list of all the domains that are hosted by your mail server. Edit this file as needed.
Next you need to create the user database. The virtual user table uses two configuration files. The first, /etc/virtusertable, is a text file containing the alias definitions. The second file, /etc/virtusertable.db, is generated by this procedure and is the actual alias database used by Sendmail.
Notice that Joe and Fred have linux accounts on the system while Sally gets here mail sent to an external email address. You will also notice that both Joe and Fred have a webmaster email address. As long as there is only one per domain, there is no problem. However, the real name and/or address must be unique.
To forward all mail addressed to any user in the domain3.com to email@example.com
After creating or modifying /etc/virtusertable, you must execute the following command to make Sendmail aware of the new aliases:
# makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable
# /etc/init.d/sendmail restart
# yum install dovecot
Open the file /etc/dovecot.conf and uncomment the below line. Add imaps and pop3s to protocol.
#protocols = imap pop3
protocols = pop3 pop3s imap imaps
# /etc/init.d/dovecot start