SquirrelMail Configuration Easy Steps (SquirrelMail + Sendmail + Apache On RedHat/CentOS/Fedora)

This tutorial explains how you can install and configure SquirrelMail on a RedHat/CentOS/Fedora based mail server which uses Sendmail and Apache.

Scenario:

Primary Mail Server:  linuxbox4 (192.168.0.14)
Domain Name:     abc.com
Trusted IP Pool:     192.168.0.0/24

Note:  Replace domain name and system name and IP according to your scenario.

 

Prerequisites:

1.  DNS is configured with proper MX record.
2.  All necessary packages/ softwares are installed.

 

Step 1:

Configure all service to start at boot time.

chkconfig sendmail on
chkconfig httpd  on
chkconfig dovecot on

 

Step 2:

Configure /etc/hosts file. In this scenario /etc/hosts file should look like this:

192.168.0.14    linuxbox4   www.abc.com 

 

Step 3:

Outgoing Mail Server Configuration (Sendmail):

Open /etc/mail/sendmail.mc file and change the following two lines.

From:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl 
FEATURE(`accept_unresolvable_domains')dnl 

To:

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl 
dnl FEATURE(`accept_unresolvable_domains')dnl 

Save and exit.

- First line here enables sendmail to receive incoming emails on all installed the NICs. Otherwise mail server would only be able to receive mails from it.

- Second line here tells sendmail, do not receive emails from mail servers whose PTR record is not configured in DNS server. This is a basic level SPAM control settings in sendmail.

Generate sendmail.cf file from sendmail.mc file.

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

 

Step 4:

Allow RELAY for trusts (organization's) IP addresses that you want to permit sending emails using this mail server. Open /etc/mail/access in this file we specify all those addresses that will be sending emails through this mail server. At the end of this file add the following line:

192.168.0 RELAY 

Save and exit and convert this text database into DB format by following command.

makemap hash access.db < access

 

Step 5:

Tell sendmail that it will be acting as a primary mail server for "abc.com" domain. We do this by adding domain name in /etc/mail/local-host-names. If this server is acting as a mail server for more then one domains then add names of all of the domains in this file on separate line. Open /etc/mail/local-host-names and add "abc.com" at the end of this file.

Note: A mail server can act as a primary mail server for more then one domains at the same time and as well as can act as a primary and secondary mail server for more than one domain at the same time.

 

Step 6:

All system users are mail users as well. Now create mail only users.

useradd -s /usr/sbin/smrsh mailuser1
useradd -s /usr/s2n/smrsh mailuser1

Also set their passwords:

passwd mailuser1
passwd mailuser2

 

Step 7:

Finally restart sendmail service.

service sendmail restart

Share this page:

5 Comment(s)

Add comment

Comments

From: irado at: 2009-10-17 01:20:31

sendmail nowadays? ridiculous.

sendmail is very cumbersome to play with.

 

From: hhh123 at: 2010-12-04 08:02:57

@irado :- i agree with u,  i switch to postfix now

From: Anonymous at: 2010-07-01 07:17:37

hi.....

In the documentation the final instruction is to write

http://192.168.0.14/webmail  or  http://your_site_address/webmail

But I wish to write following to see the same webmail page

http://192.168.0.14   or   http://your_site_address

 So what change is needed in my "/etc/httpd/conf/httpd.conf"  file

 

Please help me. I will be very greatfull

JOHA

From: Mike Orton at: 2011-01-21 20:04:19

According to your requirement use the below configuration in your  "/etc/httpd/conf/httpd.conf"

<VirtualHost 192.168.0.14:80>

     ServerAdmin  root@yourdomain.com

     DocumentRoot  /usr/share/squirrelmail

     ServerName    yourdomain.com

     ErrorLog      logs/yourdomain.com-error_log

     CustomLog    logs/yourdomain.com-access_log  common

</VirtualHost>

From: Anonymous at: 2011-02-17 10:36:50

hi.

just want to know. i already installed the squirrelmail and using this link (http://192.168.2.165/squirrelmail.) to the login page and problem is i dont know the default username & password for admin to login.