MAIL Server Configuration

Qmail:The Qmail MTA is another alternative to sendmail.
 It is used by an impressive list of Internet sites.
Smail:It is reportedly easier to configure than sendmail.
It also includes support for blocking messages.
Exim:The Exim MTA was developed at Cambridge (U.K.) and is licensed under the GPL. While based on an older MTAknown as Smail
     

        Features of mail server:

we can forward mails from one domain to another domain.with the help of this mail server we can forward mails to branches or public
mailserver must have public ip

we have three types of mail servers
1)MUA
2)MTA
3)MDA
  

sending & recieving mails using TCP/IP protocols such as 
– – – – – – – – – – – – – – –
SMTP server (simple mail transfer protocol port no.25)
pop3 server (postoffice protocol port no.110)
nmtp server (network news transfer protocol port no.119)
imap server (internet message access protocol port no.143)
x.500 server (directory server)
ldap server (leightweight directory access protocol)
x.400 server (message handling system)

Functions of mail server:
– – – – – – – – – – – – – – –
Sending and receiving mail from one user to group of users over internet 
Sending and receiving mail from one mail server to different mail servers over internet 
Sending and receiving mail that contains voice, images, sounds, movies
(Note:MIME is the service which is used to share voice, images, sounds, movies over internet. MIME-multipurpose mail extension)

Different mail servers:
– – – – – – – – – – – – – – –
Exchange server            Microsoft
Send mail            Linux/unix
Qmail                Linux/unix
Postfix                Linux/unix
Squirell mail            Linux/unix
Lotus domino            IBM(we can use on any operating system)
Lotus notes(client)        IBM
Novel groupwise            Novel

MUA:(mail user agent)
– – – – – – – – – – – – – – –
this is a client side package used to retrive mails from mail server
ex:mail(text),mutt,evolution,kmail

MTA(mail transfer agent)
– – – – – – – – – – – – – – –
this is the server side service used to send and receive mails with in the domain
ex:sendmail(text&gui),postfix,qmail

MDA:(mail delivery agent)
– – – – – – – – – – – – – – –
this is the server side service used to send and receive mails from one mailserver to another mail server.
ex:dovecot,procmail

Send mail:
– – – – – – – – – – – – – – –
    It listens mails sent by MUA’s through port no.25. 
in this mail server mails will be strictly check for exploids and regenerate the packet and send to MDA.

we have two types in MDA:
– – – – – – – – – – – – – – –
1)pop3
2)IMAP

1)pop3:(postoffice protocol 3 port no.110)
mails are in /var/spool/mail
    The pop3 connect to server with port no.110 and downloads /var/spool/mail/U1 and the clients every mail and move it to the client p.c(don’t have backup)
    The entire mails of user(U1) are downloaded into client system. It any damage had done to the client system. I want to get back.

2)IMAP:
From the client it connects to port no.143 and get the mails of the user(one copy) and it doesn’t remove original file when ever the damage occurs in client p.c. We can download another copy from server.

pop3–> moves original mails to the client
IMAP–> It send only one copy of the mails to the client

steps to configure mailserver
– – – – – – – – – – – – – – –
(here we are configuring MTA & MDA in one system)

#yum install sendmail-* -y
#service sendmail start
#chkconfig sendmail on
#cd /etc/mail
#vi sendmail.mc
add dnl # for line no116 
ex:DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl
save&quit
[root@server1 mail]# m4 sendmail.mc > sendmail.cf
# service sendmail restart

To configure MDA

#yum install dovecot-* -y
#service dovecot start
#chkconfig dovecot on
#vi /etc/dovecot.conf
(line no17)  #protocols = imap imaps pop3 pop3s(remove #)
save &quit

to check:

1st method
add 2users login as one user & send mail to another user
then login as second user type mail

2nd method
as root:  mutt -f {mahesh@server1.redhat.com}
yes
provide mahesh  password
O

configuruing e-mail aliases:

if u want to send an users mails to another user we have to configure email alias
steps

#vi /etc/aliases
go to last line add as follows
mahesh:   john  (here in this example we are redirecting mahesh mails to john)
save&quit
#newaliases (to update /etc/aliases file)

tocheck :
send a mail to same from remote system 
you have to get mail in john mailbox

###################################

            SQUIRRELMAIL (Gui based mail server)

to configure squirrel mail server

#yum install squirrelmail-* -y
#service httpd start
#service dovecot start
open mozilla
type http://sever1.linuxbeginners.com/webmail
provide username&password
now u can send or recieve mails from remote systems or remote mail servers

to check:
add an user send mail to that user from remote system
#############################################

            SSL Certification (Secure Socket Layer)

by using ssl certification we can encrypt the data transfer between one user to another user or one mailserver to another mailserver

#vi /etc/dovecot.conf

(line no 87 & 88)

 
#ssl_cert_file = /etc/pki/dovecot/certs/dovecot.pem
 #ssl_key_file = /etc/pki/dovecot/private/dovecot.pem (remove # for two lines)
save&quit
#make -C /etc/pki/tls/certs dovecot.pem

provide country,state,city,organization,server,user info (user must not root)

#cp /etc/pki/tls/certs/dovecot.pem /etc/pki/tls/private
#service sendmail restart
#service dovecot restart