Tuesday, 24 January 2012

Install sendmail and dovecot


# yum install sendmail sendmail.cf

# Open /etc/mail/sendmail.mc and look for this line:
change this line to
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
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.

joe@domain1.com  joe
webmaster@domain1.com    joe
sally@domain1.com    sally@otherserver.net
fred@domain2.com   fred
webmaster@domain2.com    fred


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 user@example.net
@domain3.com user@example.net

 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
 to
protocols = pop3 pop3s imap imaps

# /etc/init.d/dovecot start


No comments:

Post a Comment