Sunday, November 18, 2012

Mail server



Mail server
Mail server is used to send the email to local or remote systems.
Structure of mail server
Mail Transfer Agent
The Mail Transfer Agent (MTA) is the part of the email system that does much of the work of transferring the email messages from one computer to local or remote systems with /usr/bin/sendmail program. Once configured correctly, most users will not have any direct interaction with their chosen MTA unless they wish to re-configure it for any reason.
Mail User Agent
This is the part of the system that the typical user is likely to be most familiar with. The Mail User Agent (MUA), or mail client, is the application that is used to write, send and read email messages. Anyone who has written and sent a message on any computer has used a Mail User Agent of one type or another.
Mail Delivery Agent
 The MDS delivers mail to the recipients .
The Mail Delivery Agent (MDA) sits in the background and performs filtering on the email messages between the Mail Transfer Agent and the mail client (MUA). The most popular form of MDA is a spam filter to remove all the unwanted email messages from the system before they reach the inbox of the user’s mail client (MUA).
SMTP
SMTP is an acronym for Simple Mail Transport Protocol. This is the protocol used by the email systems to transfer mail messages from one server to another. This protocol is essentially the communications language that the MTAs use to talk to each other and transfer messages back and forth.
Relaying: Forwarding a submitted mail to another mail server for delivery when the distance is long.
If the machine needs to pass mail to another mail server to get out to the Internet, the hostname of the mail server should be defined as the Relay Host.
Postfix mail server Configuration
Service profile
Service: postfix
Package: postfix
Port no:25(TCP)
Configuration file: /etc/postfix/main.cf
Script file: /etc/ init.d/postfix
Daemons: postfix
Objective :To act as mail transfer agent

Install the postfix package
[root@mailserver~]#yum install  postfix* -y
Edit main Configuration file
[root@mailserver~]#vi /etc/postfix/main.cf
 myhostname=mailserver.raju.com
 mydomain=raju.com
myorigin=desktop1
mynetworks=192.168.0.0/24
#SMTP authentication for our users with postfix
smtpd_sasl_auth_enable = yes 
smtpd_sasl_local_domain = raju.com
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination 
smtpd_sasl_security_options = noanonymous

:wq!
[root@mailserver~]chkconfig postfix on
[root@mailserver~]#service postfix restart
Dovecot
Dovecot is one of the popular POP3/IMAP server which needs MTA like Postfix to work properly.
[root@mailserver~]#yum install  devcot* -y
[root@mailserver~]#vi /etc/devcot
 Protocols=imap pop3
disable_plaintext_auth=no
#SMTP authentication for users with dovecot.
#Look for the line that starts with auth default, before that insert the lines below.
auth default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}
#rename previous auth default to auth default2. If you dont rename this then dovecot server will give you error like multiple instances of auth default
:wq!
[root@mailserver~]chkconfig postfix on
[root@mailserver~]#service mailserver restart
[root@mailserver~]#chkconfig devcot on
[root@mailserver~]#service devcot restart
 Create user for testing
[root@mailserver~]#useradd koti
 [root@mailserver~]#useradd raju
logon to raju
[root@raju]mail  –s  hello  koti@mailserver.raju.com

Stay Connected With Free Updates!

Subscribe via Email

Follow me!

Leave Your Comment Below If You Like This Post

0 comments: