SlideShare a Scribd company logo
MAIL SERVER INSTALLATION & CONFIGARATION
» Installing and configuring postfix
Step 1 »Before installation assign a static ip and add a host entry for your domain to that IP in the /etc/hosts file like below.
192.168.0.15 dblgroup.com
Step 2 » Issue the below command to install postfix.
[root@mail ~]# yum -y install postfix
Step 3 » Now issue the below command to install SMTP AUTH packages .
[root@mail ~]# yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi
cyrus-sasl-md5 cyrus-sasl-plain
Postfix package installation is completed .
Step 4 » Issue the below commands one by one for creating SSL Cert.
[root@mail ~]# mkdir /etc/postfix/ssl
[root@mail ~]# cd /etc/postfix/ssl/
[root@mail ssl]# openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
[root@mail ssl]# chmod 600 smtpd.key
[root@mail ssl]# openssl req -new -key smtpd.key -out smtpd.csr
[root@mail ssl]# openssl x509 -req -days 365 -in smtpd.csr -signkey smtpd.key -out
smtpd.crt
[root@mail ssl]# openssl rsa -in smtpd.key -out smtpd.key.unencrypted
[root@mail ssl]# mv -f smtpd.key.unencrypted smtpd.key
[root@mail ssl]# openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out
cacert.pem -days 365
Step 4 » Now open /etc/postfix/main.cf file .
Find and comment the below lines .
#inet_interfaces = localhost #---> line no 116
#mydestination = $myhostname, localhost.$mydomain, localhost #--> line no 164
and add these lines at the bottom of the file.
myhostname = mail.dblgroup.com
mydomain = dblgroup.com
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
Step 5 » Now open /etc/postfix/master.cf file and add the below line after smtp
smtps inet n - n - - smtpd
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_sender=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o broken_sasl_auth_clients=yes
Step 6 » Now start postfix and saslauthd service
[root@mail ~]# service postfix start
[root@mail ~]# service saslauthd start
» Issue the below commands to start the postfix and saslauthd at startup
[root@mail ~]# chkconfig --level 235 postfix on
[root@mail ~]# chkconfig --level 235 saslauthd on
Step 7 » Now check your smtp connectivity . just telnet localhost on port 25 and type this command ehlo localhost
[root@mail ~]# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.dblgroup.com ESMTP Postfixehlo localhost <---- type this command 250-
mail.krizna.com250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-STARTTLS
250-AUTH PLAIN LOGIN250-AUTH=PLAIN LOGIN250-ENHANCEDSTATUSCODES250-8BITMIME
250 DSNquit221 2.0.0 ByeConnection closed by foreign host.
If you get this output .. Great .. everything is fine till now.
» Installing and configuring dovecot
Step 8 » Issue this command to install dovecot
[root@mail ~]# yum -y install dovecot
Step 9 » After installation open /etc/dovecot/dovecot.conf file and add the below line at the end of the file. please make sure
mail_location and home_mailbox in postfix configuration are using the same name.
protocols = imap pop3
mail_location = maildir:~/mail
pop3_uidl_format = %08Xu%08Xv
Step 10 » Now start dovecot service
[root@mail ~]# service dovecot start
» Issue the below command to start the dovecot at startup
[root@mail ~]# chkconfig --level 235 dovecot on
Step 11 » Now test your pop3 connectivity .
[root@mail ~]# telnet localhost 110
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.
Yes .. your server is ready to receive mails .
» Creating users and testing
Step 11 » Now create users to test your configuration.
[root@mail ~]# useradd -m chacheng -s /sbin/nologin
[root@mail ~]# useradd -m motin -s /sbin/nologin
and create passwords for the users created
[root@mail ~]# passwd chacheng
[root@mail ~]# passwd motin
» Installing and configuring squirrelmail
Step 12 » you need to add EPEL repository to install squirrelmail package. you can find latest EPEL repository rpm here
( http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/repoview/epel-release.html )
[root@mail ~]# rpm -ivh
http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm
Step 13 » Issue the below command to install squirrelmail.
[root@mail ~]# yum install squirrelmail
This command will install squirrelmail along with apache and php.
Step 14 » Now run the below command to configure squirrelmail .
[root@mail ~]# perl /usr/share/squirrelmail/config/conf.pl
»»» 1 »»» 1 »»» krizna (type Organization name ) »»» R ( return )
»»» 2 »»» 1 »»» ( hit space for empty Domain name ) and choose 3 »»» SMTP ( choose SMTP ) »»» R ( return )
»»» D »»» dovecot ( type ) »»» press enter with default
»»» s ( save and quit)
Step 15 » Open /etc/httpd/conf.d/squirrelmail.conf file and uncomment below lines
# RewriteCond %{HTTPS} !=on
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Step 16 » start apache service
[root@mail ~]# service httpd start
» Issue the below commands to start the httpd at startup
[root@mail ~]# chkconfig --level 235 httpd on
Step 17 » Now open http://serverip/webmail path in your browser . you could able to see the below page .
Login any problem or Error connecting to IMAP Server localhost
13. permission denied.
Then
[root@mail ~]# setsebool -P httpd_can_network_connect=1
[root@mail ~]# service httpd restart
BACKUP FILE LOCATION:
1. cp /etc/hosts
2. cp /etc/postfix/main.cf
3. cp /etc/postfix/master.cf
4. cp /etc/dovecot/dovecot.conf
5. cp /etc/passwd

More Related Content

PDF
Configuration of BIND DNS Server On CentOS 8
Kaan Aslandağ
 
PDF
Firewalld LAB
Kaan Aslandağ
 
PDF
Configuration Firewalld On CentOS 8
Kaan Aslandağ
 
PDF
CentOS Server Gui Initial Configuration
Kaan Aslandağ
 
PDF
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
Mohd Khairulazam
 
PDF
Configuration of NTP Server on CentOS 8
Kaan Aslandağ
 
PDF
CentOS Server CLI Configuration (Nmcli & Hosts)
Kaan Aslandağ
 
DOCX
How to install squid proxy on server or how to install squid proxy on centos o
Proxiesforrent
 
Configuration of BIND DNS Server On CentOS 8
Kaan Aslandağ
 
Firewalld LAB
Kaan Aslandağ
 
Configuration Firewalld On CentOS 8
Kaan Aslandağ
 
CentOS Server Gui Initial Configuration
Kaan Aslandağ
 
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
Mohd Khairulazam
 
Configuration of NTP Server on CentOS 8
Kaan Aslandağ
 
CentOS Server CLI Configuration (Nmcli & Hosts)
Kaan Aslandağ
 
How to install squid proxy on server or how to install squid proxy on centos o
Proxiesforrent
 

What's hot (18)

PPT
How to set up and Configure Kannel, A quick start
MobME Technical
 
PDF
Configuration IPTables On CentOS 8
Kaan Aslandağ
 
DOCX
Mikrotik and easy hotspot, as hotspot billing system
sedotabiz
 
PDF
Kannel configuration step by step with Motorolla Razer
Mahtab Rasheed
 
PDF
Basic security &amp; info
Tola LENG
 
PDF
Ajenti control panel
chacheng_dbl
 
PPT
Webmail
Santosh Khadsare
 
DOCX
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
Saroj Sahu
 
PDF
IPTables Lab
Kaan Aslandağ
 
PPTX
Topshelf - An easy service hosting framework for building Windows services us...
Larry Nung
 
DOC
Setting mikrotik untuk game online campur browsing
imanariepin24
 
TXT
Add fake
Aleksandr Chop
 
PDF
Configure Proxy and Firewall (Iptables)
Tola LENG
 
DOCX
DNS windows server(2008R2) & linux(SLES 11)
Tola LENG
 
PDF
DENOG9 - Automating Juniper Devices with Ansible
sipgate
 
PDF
Configuration of Smtp Server On CentOS 8
Kaan Aslandağ
 
PDF
Ftp configuration in rhel7
Balamurugan M
 
PPTX
Install PostgreSQL on CentOS
Rangson Sangboonruang
 
How to set up and Configure Kannel, A quick start
MobME Technical
 
Configuration IPTables On CentOS 8
Kaan Aslandağ
 
Mikrotik and easy hotspot, as hotspot billing system
sedotabiz
 
Kannel configuration step by step with Motorolla Razer
Mahtab Rasheed
 
Basic security &amp; info
Tola LENG
 
Ajenti control panel
chacheng_dbl
 
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
Saroj Sahu
 
IPTables Lab
Kaan Aslandağ
 
Topshelf - An easy service hosting framework for building Windows services us...
Larry Nung
 
Setting mikrotik untuk game online campur browsing
imanariepin24
 
Add fake
Aleksandr Chop
 
Configure Proxy and Firewall (Iptables)
Tola LENG
 
DNS windows server(2008R2) & linux(SLES 11)
Tola LENG
 
DENOG9 - Automating Juniper Devices with Ansible
sipgate
 
Configuration of Smtp Server On CentOS 8
Kaan Aslandağ
 
Ftp configuration in rhel7
Balamurugan M
 
Install PostgreSQL on CentOS
Rangson Sangboonruang
 
Ad

Viewers also liked (8)

PDF
Rhce syllabus | Red Hat Linux Training: IPSR Solutions
IPSRAptitudetraining
 
PDF
OTechs Advanced Mail Administration (POSTFIX) Training Course
Osman Suliman
 
PDF
Massive emailing with Linux, Postfix and Ruby on Rails
ibelmonte
 
PPT
Computer notes - Postfix
ecomputernotes
 
PDF
Postfix
Akila Jayarathna
 
PPT
Linux Based Mail Server
Bernics Gábor
 
PPTX
Mail server configuration
chacheng oo
 
PPTX
My lecture infix-to-postfix
Senthil Kumar
 
Rhce syllabus | Red Hat Linux Training: IPSR Solutions
IPSRAptitudetraining
 
OTechs Advanced Mail Administration (POSTFIX) Training Course
Osman Suliman
 
Massive emailing with Linux, Postfix and Ruby on Rails
ibelmonte
 
Computer notes - Postfix
ecomputernotes
 
Linux Based Mail Server
Bernics Gábor
 
Mail server configuration
chacheng oo
 
My lecture infix-to-postfix
Senthil Kumar
 
Ad

Similar to mail server (20)

PDF
Mail
Md Shihab
 
PPTX
SquirrelMail for webmail
Aryman Gautam
 
PDF
Basic Linux Configurations
Edmonds Namasenda
 
DOCX
Build your own secure mail server on the cloud using Amazon Web Services
ponukumatla joel nishanth
 
PPTX
Mail server on linux
Roshni17
 
PDF
Lab08Email
Robert Klebes
 
PPT
Linux corporate-training-in-mumbai
Unmesh Baile
 
PDF
How to install and configure Postfix Mail Server in Redhat (RHEL) / CentOS Linux
onlinerana
 
ODP
DIY eMail@Home
jvehent
 
ODP
7.protocols 2
Marian Marinov
 
PDF
How-to Integração Postfi
Thiago Cavalcante
 
PPS
Linux10 sendmail
Jainul Musani
 
PDF
OpenSMTPD: we deliver !!
Giovanni Bechis
 
PDF
Linux instalação e-conf postfix - pop3 eimap
Carlos Eduardo
 
PDF
Postfix, Imap e Pop3
Carlos Eduardo
 
PDF
Tested install-isp config3-ubuntu-16-04
SANTIAGO HERNÁNDEZ
 
PDF
Poppassd setup howto for rhel cent os 5 ‹‹ linux mail server setup and howto ...
Carlos Eduardo
 
PPT
Unix Administration 5
Information Technology
 
PDF
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola LENG
 
Mail
Md Shihab
 
SquirrelMail for webmail
Aryman Gautam
 
Basic Linux Configurations
Edmonds Namasenda
 
Build your own secure mail server on the cloud using Amazon Web Services
ponukumatla joel nishanth
 
Mail server on linux
Roshni17
 
Lab08Email
Robert Klebes
 
Linux corporate-training-in-mumbai
Unmesh Baile
 
How to install and configure Postfix Mail Server in Redhat (RHEL) / CentOS Linux
onlinerana
 
DIY eMail@Home
jvehent
 
7.protocols 2
Marian Marinov
 
How-to Integração Postfi
Thiago Cavalcante
 
Linux10 sendmail
Jainul Musani
 
OpenSMTPD: we deliver !!
Giovanni Bechis
 
Linux instalação e-conf postfix - pop3 eimap
Carlos Eduardo
 
Postfix, Imap e Pop3
Carlos Eduardo
 
Tested install-isp config3-ubuntu-16-04
SANTIAGO HERNÁNDEZ
 
Poppassd setup howto for rhel cent os 5 ‹‹ linux mail server setup and howto ...
Carlos Eduardo
 
Unix Administration 5
Information Technology
 
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola LENG
 

mail server

  • 1. MAIL SERVER INSTALLATION & CONFIGARATION » Installing and configuring postfix Step 1 »Before installation assign a static ip and add a host entry for your domain to that IP in the /etc/hosts file like below. 192.168.0.15 dblgroup.com Step 2 » Issue the below command to install postfix. [root@mail ~]# yum -y install postfix Step 3 » Now issue the below command to install SMTP AUTH packages . [root@mail ~]# yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain Postfix package installation is completed . Step 4 » Issue the below commands one by one for creating SSL Cert. [root@mail ~]# mkdir /etc/postfix/ssl [root@mail ~]# cd /etc/postfix/ssl/ [root@mail ssl]# openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024 [root@mail ssl]# chmod 600 smtpd.key [root@mail ssl]# openssl req -new -key smtpd.key -out smtpd.csr [root@mail ssl]# openssl x509 -req -days 365 -in smtpd.csr -signkey smtpd.key -out smtpd.crt [root@mail ssl]# openssl rsa -in smtpd.key -out smtpd.key.unencrypted [root@mail ssl]# mv -f smtpd.key.unencrypted smtpd.key [root@mail ssl]# openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 365 Step 4 » Now open /etc/postfix/main.cf file . Find and comment the below lines . #inet_interfaces = localhost #---> line no 116 #mydestination = $myhostname, localhost.$mydomain, localhost #--> line no 164 and add these lines at the bottom of the file. myhostname = mail.dblgroup.com mydomain = dblgroup.com myorigin = $mydomain home_mailbox = mail/ mynetworks = 127.0.0.0/8 inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain smtpd_sasl_auth_enable = yes smtpd_sasl_type = cyrus smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_sasl_authenticated_header = yes smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination smtpd_tls_auth_only = no smtp_use_tls = yes smtpd_use_tls = yes smtp_tls_note_starttls_offer = yes smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom
  • 2. Step 5 » Now open /etc/postfix/master.cf file and add the below line after smtp smtps inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_sender=yes -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o broken_sasl_auth_clients=yes Step 6 » Now start postfix and saslauthd service [root@mail ~]# service postfix start [root@mail ~]# service saslauthd start » Issue the below commands to start the postfix and saslauthd at startup [root@mail ~]# chkconfig --level 235 postfix on [root@mail ~]# chkconfig --level 235 saslauthd on Step 7 » Now check your smtp connectivity . just telnet localhost on port 25 and type this command ehlo localhost [root@mail ~]# telnet localhost 25 Trying ::1... Connected to localhost. Escape character is '^]'. 220 mail.dblgroup.com ESMTP Postfixehlo localhost <---- type this command 250- mail.krizna.com250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-STARTTLS 250-AUTH PLAIN LOGIN250-AUTH=PLAIN LOGIN250-ENHANCEDSTATUSCODES250-8BITMIME 250 DSNquit221 2.0.0 ByeConnection closed by foreign host. If you get this output .. Great .. everything is fine till now. » Installing and configuring dovecot Step 8 » Issue this command to install dovecot [root@mail ~]# yum -y install dovecot Step 9 » After installation open /etc/dovecot/dovecot.conf file and add the below line at the end of the file. please make sure mail_location and home_mailbox in postfix configuration are using the same name. protocols = imap pop3 mail_location = maildir:~/mail pop3_uidl_format = %08Xu%08Xv Step 10 » Now start dovecot service [root@mail ~]# service dovecot start » Issue the below command to start the dovecot at startup [root@mail ~]# chkconfig --level 235 dovecot on Step 11 » Now test your pop3 connectivity .
  • 3. [root@mail ~]# telnet localhost 110 Trying ::1... Connected to localhost. Escape character is '^]'. +OK Dovecot ready. quit +OK Logging out Connection closed by foreign host. Yes .. your server is ready to receive mails . » Creating users and testing Step 11 » Now create users to test your configuration. [root@mail ~]# useradd -m chacheng -s /sbin/nologin [root@mail ~]# useradd -m motin -s /sbin/nologin and create passwords for the users created [root@mail ~]# passwd chacheng [root@mail ~]# passwd motin » Installing and configuring squirrelmail Step 12 » you need to add EPEL repository to install squirrelmail package. you can find latest EPEL repository rpm here ( http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/repoview/epel-release.html ) [root@mail ~]# rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm Step 13 » Issue the below command to install squirrelmail. [root@mail ~]# yum install squirrelmail This command will install squirrelmail along with apache and php. Step 14 » Now run the below command to configure squirrelmail . [root@mail ~]# perl /usr/share/squirrelmail/config/conf.pl »»» 1 »»» 1 »»» krizna (type Organization name ) »»» R ( return ) »»» 2 »»» 1 »»» ( hit space for empty Domain name ) and choose 3 »»» SMTP ( choose SMTP ) »»» R ( return ) »»» D »»» dovecot ( type ) »»» press enter with default »»» s ( save and quit) Step 15 » Open /etc/httpd/conf.d/squirrelmail.conf file and uncomment below lines # RewriteCond %{HTTPS} !=on # RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} Step 16 » start apache service [root@mail ~]# service httpd start » Issue the below commands to start the httpd at startup [root@mail ~]# chkconfig --level 235 httpd on Step 17 » Now open http://serverip/webmail path in your browser . you could able to see the below page . Login any problem or Error connecting to IMAP Server localhost 13. permission denied. Then [root@mail ~]# setsebool -P httpd_can_network_connect=1 [root@mail ~]# service httpd restart
  • 4. BACKUP FILE LOCATION: 1. cp /etc/hosts 2. cp /etc/postfix/main.cf 3. cp /etc/postfix/master.cf 4. cp /etc/dovecot/dovecot.conf 5. cp /etc/passwd