SlideShare a Scribd company logo
In this tutorial we are going to setup a local mail server with Postfix, Dovecot & SquirrelMail.
But before we begin installation, let’s learn in brief about mail server.
Postfix is free & open source mail transfer agent (MTA) that routes & delivers Email. It is fast,
secure & easy to administer and is a great alternative to SendMail MTA.
Dovecot is an IMAP and POP3 mail server for Linux. It provides a way for Mail User Agent
(MUAs) to access their mail. Its created to be fast, secure , requires very less administration &
uses very less memory to work.
Squirrelmail provides a graphical interface for sending mail. As you can understand sending &
receiving mail via command line can be bit of a hassle. With the help of Squirrelmail we can
open a console in our web browser for sending & receiving mail.
Pre-requisites
 Remove SendMail (if installed),
To remove previous installation of sendmail, run
$ yum remove sendmail
This is required to remove any conflicts between sendmail & postfix.
 Setup a static IP
A DHCP assigned IP will not work at all, we require a static IP. So make sure we have one, if
using DHCP server, make sure to reserve an IP address for the mail server. Refer to our tutorial
on DHCP server to learn how to reserve IP address.
 Setup a hostname
We will also need a permanent hostname for our server. To change hostname, run
$ hostnamectl set-hostname mail.ltechlab.com
You can also read out tutorial which details 5 ways you can change your system hostname.
 A working DNS server
To use our mail server, we need a working DNS server with mx record entry for our mail server.
To create a new DNS server & adding mx records for mail server, refer our tutorial on DNS
server
 An entry in /etc/host
Open /etc/hosts file & create an entry for our hostname
$ vi /etc/hosts
192.168.1.120 mail.ltechlab.com
 Enable epel-repository
We will need to install epel-repository for installing SquirrelMail on our server. To install epel-
repository
RHEL/CentOS 7
$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
RHEL/CentOS 6 (64 Bit)
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-
8.noarch.rpm
RHEL/CentOS 6 (32 Bit)
$ rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Step 1 – Installing Postfix
We will install Postfix using yum,
$ yum install postfix
Postfix is now installed & we will now configure it,
Step 2 – Configuring Postfix
Main configuration file for Postfix is ‘/etc/postfix/main.cf’. open the file to make changes to it,
$ vi /etc/postfix/main.cf
myhostname = mail.ltechlab.com # Line 77
mydomain = ltechlab.com # Line 85
myorigin = $mydomain # Line 101
inet_interfaces = all # Line 115
inet_protocols = all # Line 121
#mydestination = $myhostname, localhost.$mydomain, localhost, # Line
166 (comment it)
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain # Line
167 (uncomment)
ynetworks = 192.168.1.0/24, 127.0.0.0/8 # Line 266
home_mailbox = Maildir/ # Line 421
Make sure you make changes as per your domain. Save the file & exit and restart the postfix
service to implement the changes,
$ systemctl restart postfix
$ systemctl enable postfix
Configurations for postfix are complete, next we will test postfix .
Step 3 – Testing Postfix
To test our Postfix setup, we will need a user. So firstly we will add a new user in our machine &
assign it a password,
$ useradd mailuser
$ passwd mailuser
& enter the password of your choosing. Next we will telnet into our our localhost smtp
$ telnet localhost smtp
& you will see a screen with following,
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
220 mail.ltechlab.com ESMTP Postfix
Now to connect to you mail server, type
ehlo localhost
250-mail.ltechlab.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
To send a mail, type your user name with the following command
mail from:<mailuser>
250 2.1.0 Ok
Then enter recipient mail address
rcpt to:<mailuser>
250 2.1.5 Ok
& enter the mail you want to type
data # will put text in mail body
354 End data with <CR><LF>.<CR><LF>
This is a test mail .
.
After you mail body is complete, type . (dot)
250 2.0.0 Ok: queued as E2B522032F93
To exit from the session, type
quit
221 2.0.0 Bye
Connection closed by foreign host.
Now, let’s check if the user has received any mail or not,
Goto user’s default mail directory for new mails which is /home/dan/Maildir/new. Next list the
directory items in the folder
$ ls
& you should see an item something like
‘2456127891.Grd71I393g3e8I235126.mail.ltechlab.com’, that’s the mail that was sent by user
‘mail user’. To read it, you can use ‘cat’ command.
So, our Postfix is working fine & we will move to configuring Dovecot.
Step 4 Installing & configuring Dovecot
To install Dovecot, use the following command
$ yum install dovecot
Once Dovecot is installed, open its configuration file i.e. ‘/etc/dovecot/dovecot.conf’,
$ vi /etc/dovecot/dovecot.conf
& uncomment the line 24, which is
protocols = imap pop3 lmtp
next open the file ‘/etc/dovecot/conf.d/10-mail.conf’ & again uncomment line 24,
$ vi /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir
then, open the file ‘/etc/dovecot/conf.d/10-auth.conf’ & make changes as following
$ vi /etc/dovecot/conf.d/10-auth.conf
# line 10 – Uncomment it
disable_plaintext_auth = yes
# line 100—edit it
auth_mechanisms = plain login
& last file to edit is ‘/etc/dovecot/conf.d/10-master.conf’, open it & uncomment then add
‘postfix’ to it,
$ vi /etc/dovecot/conf.d/10-master.conf
mode = 0600
user = postfix
group = postfix
[…]
Now restart dovecot service to implement all the changes we made,
$ systemctl restart dovecot
$ systemctl enable dovecot
Step 5 Testing Dovecot
We will now test dovecot by again logging into our telnet session with POP3
$ telnet localhost POP3
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
+OK Dovecot ready.
Enter user & password,
user mailuser
+OK
pass *****
+OK Logged in.
To view mail, type
retr 1
+OK 415 octets
Return‐Path: <mailuser@ltechlab.com>
X‐Original‐To: mailuser
Delivered‐To: mailuser@ltechlab.com
Received: from localhost (localhost [IPv6:::1])
by mail.ltechlab.com (Postfix) with ESMTP id D34567837Z13
for <sk>; Fri, 17 Mar 2017 2:41:26 +0530 (IST)
Message‐Id: 2456127891.Grd71I393g3e8I235126.mail.ltechlab.com’
Date: Fri, 17 Mar 2017 2:41:26 +0530 (IST)
From: mailuser@ltechlab.com
This is a test mail .
To quit,
Quit
+OK Logging out.
Connection closed by foreign host.
Our Dovecot is also working fine but as you can see it does not feel right reading mail without
GUI, so let’s install GUI for our mail server using Squirrelmail.
Step 6 Installing & configuring Squirrelmail,
Install Squirrelmail using yum,
$ yum install squirrelmail
To configure squirrelmail , we need to run a script named ‘conf.pl’ located at
‘/usr/share/squirrelmail/config/’
$ cd /usr/share/squirrelmail/config/
$ ./conf.pl
It will then open a configuration wizard with the following options,
SquirrelMail Configuration : Read: config.php (1.4.0)
———————————————————
Main Menu —
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
1. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit
Select ‘1’ Organisation Preferences & then changes your organization name, again by
selecting ‘1’,
SquirrelMail Configuration : Read: config.php (1.4.0)
———————————————————
Organization Preferences
Organization Name : SquirrelMail
Organization Logo : ../images/sm_logo.png
Org. Logo Width/Height : (308/111)
Organization Title : SquirrelMail $version
Signout Page :
Top Frame : _top
Provider link : http://squirrelmail.org/
Provider name : SquirrelMail
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Set your organization name & press ‘enter’.
Similarly change other settings as well, once done save all the settings by pressing ‘s’. You will
now return first menu on the configuration wizard, we will now change our ‘Server settings ’ by
pressing ‘2’,
SquirrelMail Configuration : Read: config.php (1.4.0)
———————————————————
Server Settings
General
——-
Domain : localhost
Invert Time : false
Sendmail or SMTP : Sendmail
Update IMAP Settings : localhost:143 (uw)
Change Sendmail Config : /usr/sbin/sendmail
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Change your domain name & save it.
SquirrelMail Configuration : Read: config.php (1.4.0)
———————————————————
Server Settings
General
——-
Domain : ltechlab.com
Invert Time : false
Sendmail or SMTP : SMTP
Update IMAP Settings : localhost:143 (uw)
Change Sendmail Config : /usr/sbin/sendmail
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Our configuration for this wizard are now complete, so exit the wizard by typing ‘Q’. Next we
need to create a apache host settings for Squirrelmail in ‘/etc/httpd/conf/httpd.conf’ & enter the
following to the end of the file,
$ vi /etc/httpd/conf/httpd.conf
Alias /webmail /usr/share/squirrelmail
<Directory /usr/share/squirrelmail>
Options Indexes FollowSymLinks
RewriteEngine On
AllowOverride All
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>
Save file & restart apache service to implement the changes.
$ systemctl restart httpd
Step 7 Accessing the Webmail
We can now access our webmail by entering the following URL in our web-browser,
http://IPaddress OR domain name/webmail
Then enter your username password & you can now access your webmail. You can read your
mail, compose new mails through webmail. If needed more users, create them as we created our
mailuser.
That’s it guys, you now have a fully functional local mail server. But if you want to send mail
over internet then you need to configure your mail server with a PUBLIC IP & make sure
to ask your ISP to create MX record for your mail server.
If having any issues or questions, please feel free to mention them in the comment box below

More Related Content

PPT
Linux corporate-training-in-mumbai
PDF
Modul server debian 5
PDF
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
DOCX
DNS windows server(2008R2) & linux(SLES 11)
PPT
PDF
mail server
PDF
Lamp Server With Drupal Installation
DOCX
Document Management: Opendocman and LAMP installation on Cent OS
Linux corporate-training-in-mumbai
Modul server debian 5
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
DNS windows server(2008R2) & linux(SLES 11)
mail server
Lamp Server With Drupal Installation
Document Management: Opendocman and LAMP installation on Cent OS

What's hot (20)

PDF
Basic security &amp; info
DOCX
Definitive guide to setting up a lamp server using open source software
TXT
Powershell direct
PDF
Membangun web server,_e-mail_server_dan_ftp_server
PDF
Configuration of BIND DNS Server On CentOS 8
PDF
Tutorial CentOS 5 untuk Webhosting
PPTX
SquirrelMail for webmail
PDF
Configure Proxy and Firewall (Iptables)
PPTX
Modul mengamankan jaringan dhcp server menggunakan arp reply only menggunakan...
DOC
Modul quick debserver
DOCX
Installing lemp with ssl and varnish on Debian 9
PPTX
Modul dhcp server menggunakan mikrotik os
PDF
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
PDF
Sharing your-internet-connection-on-linux
PPT
Apache1.ppt
PDF
Open vpn server_linux
PPT
How to set up and Configure Kannel, A quick start
DOCX
How to install and configure LEMP stack
PDF
Implementing DNS in Samba PDC
PDF
Kannel configuration step by step with Motorolla Razer
Basic security &amp; info
Definitive guide to setting up a lamp server using open source software
Powershell direct
Membangun web server,_e-mail_server_dan_ftp_server
Configuration of BIND DNS Server On CentOS 8
Tutorial CentOS 5 untuk Webhosting
SquirrelMail for webmail
Configure Proxy and Firewall (Iptables)
Modul mengamankan jaringan dhcp server menggunakan arp reply only menggunakan...
Modul quick debserver
Installing lemp with ssl and varnish on Debian 9
Modul dhcp server menggunakan mikrotik os
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Sharing your-internet-connection-on-linux
Apache1.ppt
Open vpn server_linux
How to set up and Configure Kannel, A quick start
How to install and configure LEMP stack
Implementing DNS in Samba PDC
Kannel configuration step by step with Motorolla Razer
Ad

Similar to Mail (20)

DOCX
Build your own secure mail server on the cloud using Amazon Web Services
PPTX
Mail server configuration
PDF
Step by step_linux_guide
PPT
Mail server setup
PDF
Install iRedMail on Red Hat Enterprise Linux, CentOS
PDF
Install iRedMail on Red Hat Enterprise Linux, CentOS
PPTX
Migrating to Exchange 2010 and ad 2080 r2
PPT
Capistrano Overview
PDF
Lab08Email
PDF
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
PDF
TrinityCore server install guide
PPT
pop3-imap.ppt
PPT
pop3-imap.ppt
PPT
Capistrano
PPTX
DNS,SMTP and POP3
PPS
Linux10 sendmail
DOCX
How to simplify Email oriented workflow with - Visendo SMTP Extender
PPTX
A Docker-based Development Environment Even I Can Understand
Build your own secure mail server on the cloud using Amazon Web Services
Mail server configuration
Step by step_linux_guide
Mail server setup
Install iRedMail on Red Hat Enterprise Linux, CentOS
Install iRedMail on Red Hat Enterprise Linux, CentOS
Migrating to Exchange 2010 and ad 2080 r2
Capistrano Overview
Lab08Email
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
TrinityCore server install guide
pop3-imap.ppt
pop3-imap.ppt
Capistrano
DNS,SMTP and POP3
Linux10 sendmail
How to simplify Email oriented workflow with - Visendo SMTP Extender
A Docker-based Development Environment Even I Can Understand
Ad

More from Md Shihab (13)

PDF
Samba
PDF
PDF
Maria db
PDF
Iscsi
PDF
PDF
Dhcp
PDF
Boot
DOCX
Rhel 7 root password reset
DOCX
Easy vlsm
DOCX
RedHat/CentOs Commands for administrative works
PPTX
How to transfer core mode into gui in RedHat/centOs
PPTX
Assignment on windows firewall
PPTX
Assignment on high availability(clustering)
Samba
Maria db
Iscsi
Dhcp
Boot
Rhel 7 root password reset
Easy vlsm
RedHat/CentOs Commands for administrative works
How to transfer core mode into gui in RedHat/centOs
Assignment on windows firewall
Assignment on high availability(clustering)

Recently uploaded (20)

PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPT
Teaching material agriculture food technology
PDF
Electronic commerce courselecture one. Pdf
PDF
KodekX | Application Modernization Development
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Machine learning based COVID-19 study performance prediction
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Teaching material agriculture food technology
Electronic commerce courselecture one. Pdf
KodekX | Application Modernization Development
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Monthly Chronicles - July 2025
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
Machine learning based COVID-19 study performance prediction
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf

Mail

  • 1. In this tutorial we are going to setup a local mail server with Postfix, Dovecot & SquirrelMail. But before we begin installation, let’s learn in brief about mail server. Postfix is free & open source mail transfer agent (MTA) that routes & delivers Email. It is fast, secure & easy to administer and is a great alternative to SendMail MTA. Dovecot is an IMAP and POP3 mail server for Linux. It provides a way for Mail User Agent (MUAs) to access their mail. Its created to be fast, secure , requires very less administration & uses very less memory to work. Squirrelmail provides a graphical interface for sending mail. As you can understand sending & receiving mail via command line can be bit of a hassle. With the help of Squirrelmail we can open a console in our web browser for sending & receiving mail. Pre-requisites  Remove SendMail (if installed), To remove previous installation of sendmail, run $ yum remove sendmail This is required to remove any conflicts between sendmail & postfix.  Setup a static IP A DHCP assigned IP will not work at all, we require a static IP. So make sure we have one, if using DHCP server, make sure to reserve an IP address for the mail server. Refer to our tutorial on DHCP server to learn how to reserve IP address.  Setup a hostname We will also need a permanent hostname for our server. To change hostname, run $ hostnamectl set-hostname mail.ltechlab.com You can also read out tutorial which details 5 ways you can change your system hostname.  A working DNS server To use our mail server, we need a working DNS server with mx record entry for our mail server. To create a new DNS server & adding mx records for mail server, refer our tutorial on DNS server  An entry in /etc/host
  • 2. Open /etc/hosts file & create an entry for our hostname $ vi /etc/hosts 192.168.1.120 mail.ltechlab.com  Enable epel-repository We will need to install epel-repository for installing SquirrelMail on our server. To install epel- repository RHEL/CentOS 7 $ rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm RHEL/CentOS 6 (64 Bit) $ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6- 8.noarch.rpm RHEL/CentOS 6 (32 Bit) $ rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm Step 1 – Installing Postfix We will install Postfix using yum, $ yum install postfix Postfix is now installed & we will now configure it, Step 2 – Configuring Postfix Main configuration file for Postfix is ‘/etc/postfix/main.cf’. open the file to make changes to it, $ vi /etc/postfix/main.cf myhostname = mail.ltechlab.com # Line 77 mydomain = ltechlab.com # Line 85 myorigin = $mydomain # Line 101 inet_interfaces = all # Line 115 inet_protocols = all # Line 121 #mydestination = $myhostname, localhost.$mydomain, localhost, # Line
  • 3. 166 (comment it) mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain # Line 167 (uncomment) ynetworks = 192.168.1.0/24, 127.0.0.0/8 # Line 266 home_mailbox = Maildir/ # Line 421 Make sure you make changes as per your domain. Save the file & exit and restart the postfix service to implement the changes, $ systemctl restart postfix $ systemctl enable postfix Configurations for postfix are complete, next we will test postfix . Step 3 – Testing Postfix To test our Postfix setup, we will need a user. So firstly we will add a new user in our machine & assign it a password, $ useradd mailuser $ passwd mailuser & enter the password of your choosing. Next we will telnet into our our localhost smtp $ telnet localhost smtp & you will see a screen with following, Trying ::1… Connected to localhost. Escape character is ‘^]’. 220 mail.ltechlab.com ESMTP Postfix Now to connect to you mail server, type ehlo localhost 250-mail.ltechlab.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN
  • 4. To send a mail, type your user name with the following command mail from:<mailuser> 250 2.1.0 Ok Then enter recipient mail address rcpt to:<mailuser> 250 2.1.5 Ok & enter the mail you want to type data # will put text in mail body 354 End data with <CR><LF>.<CR><LF> This is a test mail . . After you mail body is complete, type . (dot) 250 2.0.0 Ok: queued as E2B522032F93 To exit from the session, type quit 221 2.0.0 Bye Connection closed by foreign host. Now, let’s check if the user has received any mail or not, Goto user’s default mail directory for new mails which is /home/dan/Maildir/new. Next list the directory items in the folder $ ls & you should see an item something like ‘2456127891.Grd71I393g3e8I235126.mail.ltechlab.com’, that’s the mail that was sent by user ‘mail user’. To read it, you can use ‘cat’ command. So, our Postfix is working fine & we will move to configuring Dovecot. Step 4 Installing & configuring Dovecot To install Dovecot, use the following command
  • 5. $ yum install dovecot Once Dovecot is installed, open its configuration file i.e. ‘/etc/dovecot/dovecot.conf’, $ vi /etc/dovecot/dovecot.conf & uncomment the line 24, which is protocols = imap pop3 lmtp next open the file ‘/etc/dovecot/conf.d/10-mail.conf’ & again uncomment line 24, $ vi /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:~/Maildir then, open the file ‘/etc/dovecot/conf.d/10-auth.conf’ & make changes as following $ vi /etc/dovecot/conf.d/10-auth.conf # line 10 – Uncomment it disable_plaintext_auth = yes # line 100—edit it auth_mechanisms = plain login & last file to edit is ‘/etc/dovecot/conf.d/10-master.conf’, open it & uncomment then add ‘postfix’ to it, $ vi /etc/dovecot/conf.d/10-master.conf mode = 0600 user = postfix group = postfix […] Now restart dovecot service to implement all the changes we made, $ systemctl restart dovecot $ systemctl enable dovecot Step 5 Testing Dovecot We will now test dovecot by again logging into our telnet session with POP3 $ telnet localhost POP3 Trying ::1… Connected to localhost.
  • 6. Escape character is ‘^]’. +OK Dovecot ready. Enter user & password, user mailuser +OK pass ***** +OK Logged in. To view mail, type retr 1 +OK 415 octets Return‐Path: <mailuser@ltechlab.com> X‐Original‐To: mailuser Delivered‐To: mailuser@ltechlab.com Received: from localhost (localhost [IPv6:::1]) by mail.ltechlab.com (Postfix) with ESMTP id D34567837Z13 for <sk>; Fri, 17 Mar 2017 2:41:26 +0530 (IST) Message‐Id: 2456127891.Grd71I393g3e8I235126.mail.ltechlab.com’ Date: Fri, 17 Mar 2017 2:41:26 +0530 (IST) From: mailuser@ltechlab.com This is a test mail . To quit, Quit +OK Logging out. Connection closed by foreign host. Our Dovecot is also working fine but as you can see it does not feel right reading mail without GUI, so let’s install GUI for our mail server using Squirrelmail. Step 6 Installing & configuring Squirrelmail, Install Squirrelmail using yum, $ yum install squirrelmail To configure squirrelmail , we need to run a script named ‘conf.pl’ located at ‘/usr/share/squirrelmail/config/’
  • 7. $ cd /usr/share/squirrelmail/config/ $ ./conf.pl It will then open a configuration wizard with the following options, SquirrelMail Configuration : Read: config.php (1.4.0) ——————————————————— Main Menu — 1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages 1. Set pre-defined settings for specific IMAP servers C Turn color off S Save data Q Quit Select ‘1’ Organisation Preferences & then changes your organization name, again by selecting ‘1’, SquirrelMail Configuration : Read: config.php (1.4.0) ——————————————————— Organization Preferences Organization Name : SquirrelMail Organization Logo : ../images/sm_logo.png Org. Logo Width/Height : (308/111) Organization Title : SquirrelMail $version Signout Page : Top Frame : _top Provider link : http://squirrelmail.org/ Provider name : SquirrelMail
  • 8. R Return to Main Menu C Turn color off S Save data Q Quit Set your organization name & press ‘enter’. Similarly change other settings as well, once done save all the settings by pressing ‘s’. You will now return first menu on the configuration wizard, we will now change our ‘Server settings ’ by pressing ‘2’, SquirrelMail Configuration : Read: config.php (1.4.0) ——————————————————— Server Settings General ——- Domain : localhost Invert Time : false Sendmail or SMTP : Sendmail Update IMAP Settings : localhost:143 (uw) Change Sendmail Config : /usr/sbin/sendmail R Return to Main Menu C Turn color off S Save data Q Quit Change your domain name & save it. SquirrelMail Configuration : Read: config.php (1.4.0) ——————————————————— Server Settings General ——- Domain : ltechlab.com Invert Time : false Sendmail or SMTP : SMTP Update IMAP Settings : localhost:143 (uw) Change Sendmail Config : /usr/sbin/sendmail R Return to Main Menu C Turn color off
  • 9. S Save data Q Quit Our configuration for this wizard are now complete, so exit the wizard by typing ‘Q’. Next we need to create a apache host settings for Squirrelmail in ‘/etc/httpd/conf/httpd.conf’ & enter the following to the end of the file, $ vi /etc/httpd/conf/httpd.conf Alias /webmail /usr/share/squirrelmail <Directory /usr/share/squirrelmail> Options Indexes FollowSymLinks RewriteEngine On AllowOverride All DirectoryIndex index.php Order allow,deny Allow from all </Directory> Save file & restart apache service to implement the changes. $ systemctl restart httpd Step 7 Accessing the Webmail We can now access our webmail by entering the following URL in our web-browser, http://IPaddress OR domain name/webmail Then enter your username password & you can now access your webmail. You can read your mail, compose new mails through webmail. If needed more users, create them as we created our mailuser. That’s it guys, you now have a fully functional local mail server. But if you want to send mail over internet then you need to configure your mail server with a PUBLIC IP & make sure to ask your ISP to create MX record for your mail server. If having any issues or questions, please feel free to mention them in the comment box below