Tuesday, September 14, 2010

How to install and configure a mail server using Sendmail + Dovecot + squirrelmail in linux

Sponsored Links
This document helps to configure a mail server with sendmail as MTA[ (Mail Transfer agent), Dovecot as MDA (Mail Delivery Agent) and Squirrel-mail as MUA (Mail User
Agent). This is a simple basic configuration without much advanced configurations. This is tested in Redhat linux and will also work in other redhat disrtos like
fedora, centos etc.

Steps:

#yum -y install sendmail* dovecot* squirrelmail* bind*      #Bind for DNS
#yum -y install caching-*                                    #for DNS

Remove the hostname conflicts from /etc/hosts /etc/sysconfig/network
You must set a Fully Quallified Domain name [FQDN]

#sysctl -p

#rm -rf /etc/mail             #if necessary
#rm -rf /var/named              #If necessary. If DNS already exists, dont do this.

#service network restart

Now configure the DNS. If already existing add the entries to it.

Configure the dns as example.com
Check the following command returns the correct IP.

#nslookup example.com

Now Configuring MTA (sendmail)

#vi /etc/mail/sendmail.mc

Comment the lines 116 and 155. I.e add 'dnl' to the begining of those lines
eg:

dnl DAEMON_OPTIONS

Uncomment the line 160. I.e remove 'dnl' from the begining of the line.
eg:

MASQURAD_AS (example.com)

#cd /etc/mail
#make restart
#chkconfig sendmail on

Now installing the MUA (squirrel mail)
#vi /etc/mail/local-host-names

example.com

save it

Now installing the MDA (dovecot)
#vi /etc/dovecot.conf

protocols = imap

save it and restart the service.

#service dovecot restart
#chkconfig dovecot on

now

#cd /usr/share/squirrelmail/config/

run the perl file
#./conf.pl

Give
1.Domail name
2.host name
3.protocol

Configuring DNS

IN NS 
IN MX 

Save it and reload the named service.

add the nameserver ip to
/etc/resolv.conf

You can access the webmail through
http://example.com/webmail
Sponsored Links

No comments:

Post a Comment

Be nice. That's all.