Configure Squirrelmail Server with POP3/IMAP on Linux/CentOS
Package Requirements:
* Linux Server with Centos 5/6
* Apache 2 with PHP4 or later
* Postfix (SMTP server or MTA)
* Dovecot ( IMAP/POP3 server)
* Squirrelmail (A free Webmail)
* Apache 2 with PHP4 or later
* Postfix (SMTP server or MTA)
* Dovecot ( IMAP/POP3 server)
* Squirrelmail (A free Webmail)
We will be setting up the email server for local users where they can use
webmail or outlook express to access their email. We will be setting up a simple
and most basic mail server for local users.
webmail or outlook express to access their email. We will be setting up a simple
and most basic mail server for local users.
Before we proceed to setup a mail server, the following 3 are most important
for delivering email to destination.
for delivering email to destination.
1. DNS Entry for your mail server with MX record
2. Setup an SPF record
3. Setup Domain Name Keys
4. Reverse IP for your Mail Server
2. Setup an SPF record
3. Setup Domain Name Keys
4. Reverse IP for your Mail Server
The most important of it setting up reverse IP for your mail server. You have
to ask your hosting provider to setup a reverse IP for your mail server.
to ask your hosting provider to setup a reverse IP for your mail server.
Install Postfix (SMTP Server/MTA)
Postfix is fast and popular SMTP server and widely used. Its main job is to
relay mail locally or to intended destination outside the network.
By default Sendmail comes Pre-installed with Centos. We will need need to remove
it and install Postfix:
#yum remove sendmail
#yum install postfix
Postfix is fast and popular SMTP server and widely used. Its main job is to
relay mail locally or to intended destination outside the network.
By default Sendmail comes Pre-installed with Centos. We will need need to remove
it and install Postfix:
#yum remove sendmail
#yum install postfix
The configuration file is located at /etc/postfix/main.cf.
Edit the file and make sure you change the following lines with your domain name:
myhost = mail.sumit.com
mydomain = sumit.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, $mydomain
Setting up SASL + TLS
To enable SASL authentication open /etc/postfix/main.cf and
Install Dovecot (POP3/IMAP Server)
Look for the line auth default and make these changes. Becareful with the lines as they are heavily commented out:
Install Squirrelmail
Before you access Squirrelmail or Mail restart all the services:
To access squirrelmail point your browser to
emails by the server pertaining to domains.
We have to also setup SASL with our postfix to authenticate our users who want
to send email outside of the permitted network:
#yum install cyrus-sasl
add the following lines:
smtpd_sasl_auth_enable = yes
smtpd_reciptient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
Dovecot is a very popular POP3/IMAP server. The main difference between POP3
and IMAP is while accessing the your email with outlook if you use POP3 the
mail is downloaded to your computer and deleted from the server. With IMAP the
mail is retained in the server.
The configuration file is located at /etc/dovecot.conf
#yum install dovecot
Open the dovecot config file /etc/dovecot.conf and make the following changes.
You may need to comment or uncomment certain lines:
protocols = imap imaps pop3 pop3s
auth default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
clinet {
path = /var/spool/postfix/private/auth/
mode = 0660
user = postfix
group = postfix
}
}
}
Squirrelmail is a free webbased email can be very handy for your users to login
while they are mobile.
#yum install squirrelmail
To setup the squirrelmail under apache, open /etc/httpd/conf/httpd.conf:
and insert the following lines:
Alias /squirrelmail /usr/local/squirrelmail/www
<Directory /usr/local/squirrelmail/www>
Options Indexes
AllowOverride none
DirectoryIndexes index.php
Order allow,deny
allow from all
</Directory>
The squirrelmail configuration utility is located in /usr/share/squirrelmail/config/conf.pl:
Run the configuration utility and set the server settings to SMTP and change your domain name to sumit.com
/usr/share/squirrelmail/config/conf.pl
/etc/init.d/postfix start
/etc/init.d/dovecot start
/etc/init.d/saslauthd start
service httpd restart
http://www.sumit.com/webmail
and the squirrelmail test page is located at http://domain.com/webmail/src/configtest.php
Before we login to squirrelmail, you will need to create users:
Just create a localuser with adduser:
#adduser sumit
and update the password of sumit
# passwd sumit
For any query please feel free to contact me my email ID is sashwatkatore@gmail.com.