mail server

Post on 15-Apr-2017

261 Views

Category:

Internet

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Mail server

A mail server is an application that receives incoming e-mail from the local users and remote senders’ and forwards outgoing e-mail for delivery. Mail Server is also known as Mail Transfer Agent (MTA) or a Mail router.

A computer dedicated to run such type of applications is called a Mail Server.

● MTA - Mail Transfer AgentIt’s a program used for transporting mails from one host to

another host.

● MDA - Mail Delivery AgentIts used by MTA to deliver emails to particular user mail box.

● MUA - Mail User AgentIt’s a program that people use to send/receive mails are known as

MUA.

MTA - Mail Transfer Agent

EXIM1. An open source mail transfer agent (MTA)

2. A program responsible for receiving, routing, and delivering e-mail messages.

3. Like all MTAs, Exim receives e-mail messages and recipient addresses from local users and remote hosts.

4. Perform forwarding functions, and deliver the messages todestinations.

Exim Log FilesThree logs are available for exim. They are exim_mainlog,

exim_rejectlog and exim_paniclog

The main exim log file (exim_mainlog) records the arrival of each message as well as the delivery in a single logical line.

The reject log file (exim_rejectlog) records information about messages and addresses that are rejected based on policy.

The exim panic log (exim_paniclog) is only used when Exim suffers a disastrous error.

Exim Configuration Files

/etc/exim.conf/var/log/exim_mainlog/var/log/exim_rejectlog/var/log/exim_paniclog

/etc/valiases/<domain-name>/etc/vfilters/<domain-name>

Exim Mail Queue

The exim queue on cPanel servers is stored at /var/spool/exim/input

On cPanel servers, we opt to split the queue into 62 subdirectories. ([a-z], [A-Z], and [0-9]). This causes all messages to be distributed to the separate directories based on the 6th character in the message ID.

This requires Exim to do more work when scanning the queue, but vastly improves the disk writing performance.

To view headerroot@localhost# exim -Mvh <message-id>

To view bodyroot@localhost# exim -Mvb <message-id>

To view message logsroot@localhost# exim -Mvl <message-id>

Start queue run root@localhost# exim -q -v

Remove a message from the queue: root@localhost# exim -Mrm <message-id>

Freeze a message: root@localhost# exim -Mf <message-id> [ <message-id> ... ]

Deliver a message: root@localhost# exim -M <message-id> [ <message-id> ... ]

Apart from Exim we have the below mails servers.

● Sendmail● Postfix● Qmail

Sendmail

Sendmail is the default MTA installed with FreeBSD.

It accepts mail from MUAs and delivers it to the exact mail host.

Sendmail can also accept network connections and deliver mail to local mailboxes or to another program.

The configuration files for Sendmail are located in /etc/mail. /etc/mail/accessThis access database file defines which hosts or IP addresses

have access to the local mail server and what kind of access they have.

Hosts listed as OKHosts listed as REJECTHosts listed as RELAYHosts listed as ERRORHost is listed as SKIPHosts listed as QUARANTINE

# makemap hash /etc/mail/access < /etc/mail/access# service sendmail restart

Configuration file : /etc/mail/sendmail.cf

Mail log: /var/log/maillog

Mail queue: mailq

Postfix

Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail.

Configuration file: /etc/postfix/main.cfmyhostname = mail.example.commydomain = example.cominet_interfaces = allmydestination = $mydomain, $myhostname

myorigin = $mydomainIf the myhostname is:mail.example.comAnd if the user who sends mail is mike, then the resulting mail

return address is: mike@mail.example.comusername@myhostname(FQDN)If users do not want the hostname of the server in the return

address then set the myorigin to this parameter:myorigin = $mydomainmike@example.com

Changes Necessary for Network Connectionsmydomain = example.com myorigin = $mydomain myhostname = mail.example.commydestination = $myhostname, localhost, localhost.$mydomain mynetworks = 192.168.3.0/24 inet_interfaces = all service postfix restart

log file : /var/log/maillog

Qmail

Qmail is a secure, reliable, efficient, simple message transfer agent.

Qmail works using about 15 small programs.Qmail continuously runs 5 daemons.1. qmail-send2. qmail-lspawn3. qmail-rspawn4. qmail-clean5. tcpserver

How Qmail works

1. Email arrival in Qmail2. Queuing emails3. Processing queued emails4. Email delivery to local and remote recipients5. Cleaning queue after delivering emails

Qmail configuration files

Configuration files : /var/qmail/control1. badmailfrom All "from addresses" which are blacklisted.

2. bouncefrom username of bounce sender

3. bouncehost hostname of bounce sender

4. concurrencyincoming Maximum number of simultaneous incoming SMTP connections

allowed.

5. concurrencylocal Maximum number of simultaneous local deliveries

6. concurrencyremote Maximum number of simultaneous remote deliveries

7. defaultdomain Default domain name of server

8. defaulthost Hostname of server

9. databytes Maximum number of bytes in message (0=no limit)

MDA- Mail Delivery Agent

Pop3

Post Office Protocol version 3 (POP3) is a standard mail protocol used to receive emails from a remote server to a

local email client.

POP3 allows you to download email messages on your local computer and read them even when you are offline.

IMAP

The Internet Message Access Protocol (IMAP) is a mail protocol that allows an e-mail client to access e-mail on a remote mail server.

IMAP and POP3 are the two most commonly used Internet mail protocols for retrieving emails. Both protocols are supported by all modern email clients.

Mail Ports

Outgoing SMTP Ports:SMTP non encrypted ports : 25 and 587SMTP encrypted port : 465

Incoming Mail server ports:POP non ssl port : 110IMAP non ssl port :143POP ssl port : 995IMAP ssl port : 993

MUA- Mail User Agent

● Outlook● Thunderbird● Windows Live● Mac Entourage

Email clients

Web Based Email Client

● Squirrel Mail

● Horde

● Round cube

THANKYOU

top related