Skip to main content

squirrelmail Configration

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: MailForMe (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    MailForMe   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

Step 8:



Incoming Mail Server Configuration (Dovecot):

Open /etc/dovecot.conf and change the following lines.

From:
#protocols = imap  pop3

To:

protocols = imap imaps pop3 pop3s 

Save and exit and restart dovecot service.

service dovecot restart




Step 9:



Webserver Configuration (Apache):

Apache comes pre-configured, you just have to change the ServerName parameter in /etc/httpd/conf/httpd.conf file and restart the service, that’s all. Open /etc/httpd/conf/httpd.conf and set the ServerName parameter.
ServerName www.abc.com

Save and exit and restart httpd service.

service httpd restart


Installation & Configuration of Squirrelmail



• Check that Squirrelmail is installed on the system.

# rpm –q squirrelmail

• If squirrelmail is not installed on the system then install it through rpm:

# rpm –ivh squirrelmail

• Now go to the squirrelmail directory, located in /usr/share.

# cd /usr/share/squirrelmail

• Then go to the config directory:

# cd config

• Now run one of the following commands to configure squirrelmail.

# ./conf.pl

OR

perl conf.pl

• Now select option 1 (Organization Preferences).

Organization Name : YOUR_ORG_NAME
Organization Title : YOUR_ORG_NAME Webmail
Provider link : http://YOUR_ORG_SITE_ADDRESS
Provider name : YOUR_ORG_NAME

• Now select option 2 (Server Settings).

Domain : abc.com
Sendmail or SMTP : Sendmail
IMAP Server : localhost
IMAP Port : 143
Server software : uw
Delimiter : /

• Now select option 3 (Folder Settings).

Default Folder Prefix : mail/
Show Folder Prefix Option : true

Trash Folder : Trash
Sent Folder : Sent
Drafts Folder : Drafts
By default, move to trash : true
By default, move to sent : true
By default, save as draft : true
List Special Folders First : true
Show Special Folders Color : true
Auto Expunge : true
Default Sub. of INBOX : false
Show 'Contain Sub.' Option : true
Default Unseen Notify : 2
Default Unseen Type : 1
Auto Create Special Folders : true
Folder Delete Bypasses Trash : false
Enable /NoSelect folder fix : false

• Now select option 4 (General Settings).

Data Directory : /var/lib/squirrelmail/prefs/
Attachment Directory : /var/spool/squirrelmail/attach/
Directory Hash Level : 0
Default Left Size : 150
Usernames in Lowercase : false
Allow use of priority : true
Hide SM attributions : false
Allow use of receipts : true
Allow editing of identity : true
Allow editing of name : true
Remove username from header : false
Allow server thread sort : true
Allow server-side sorting : true
Allow server charset search : true
Enable UID support : true
PHP session name : SQMSESSID
Location base :

• Now choose option 8 (Plugins) and select the plugins that you wish to provide to your webmail users.

• Now open the browser with the following link:

http://YOUR_SITE_ADDRESS/webmail

OR

http://192.168.0.14/webmail

Comments

Popular posts from this blog

Docker Container Management from Cockpit

Cockpit can manage containers via docker. This functionality is present in the Cockpit docker package. Cockpit communicates with docker via its API via the /var/run/docker.sock unix socket. The docker API is root equivalent, and on a properly configured system, only root can access the docker API. If the currently logged in user is not root then Cockpit will try to escalate the user’s privileges via Polkit or sudo before connecting to the socket. Alternatively, we can create a docker Unix group. Anyone in that docker group can then access the docker API, and gain root privileges on the system. [root@rhel8 ~] #  yum install cockpit-docker    -y  Once the package installed then "containers" section would be added in the dashboard and we can manage the containers and images from the console. We can search or pull an image from docker hub just by searching with the keyword like nginx centos.   Once the Image downloaded we can start a contai

Remote Systems Management With Cockpit

The cockpit is a Red Hat Enterprise Linux web-based interface designed for managing and monitoring your local system, as well as Linux servers located in your network environment. In RHEL 8 Cockpit is the default installation candidate we can just start the service and then can start the management of machines. For RHEL7 or Fedora based machines we can follow steps to install and configure the cockpit.  Following are the few features of cockpit.  Managing services Managing user accounts Managing and monitoring system services Configuring network interfaces and firewall Reviewing system logs Managing virtual machines Creating diagnostic reports Setting kernel dump configuration Configuring SELinux Updating software Managing system subscriptions Installation of cockpit package.  [root@rhel8 ~] #  dnf   install cockpit cockpit-dashboard  -y  We need to enable the socket.  [root@rhel8 ~] #  systemctl enable --now cockpit.socket If firewall is runnin

Containers Without Docker on RHEL/Fedora

Docker is perfectly doing well with the containerization. Since docker uses the Server/Client architecture to run the containers. So, even if I am a client or developer who just wants to create a docker image from Dockerfile I need to start the docker daemon which of course generates some extra overhead on the machine.  Also, a daemon that needs to run on your system, and it needs to run with root privileges which might have certain security implications. Here now the solution is available where we do not need to start the daemon to create the containers. We can create the images and push them any of the repositories and images are fully compatible to run on any of the environment.  Podman is an open-source Linux tool for working with containers. That includes containers in registries such as docker.io and quay.io. let's start with the podman to manage the containers.  Install the package  [root@rhel8 ~] # dnf install podman -y  OR [root@rhel8 ~] # yum