Download - Mail server
![Page 1: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/1.jpg)
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.
![Page 2: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/2.jpg)
![Page 3: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/3.jpg)
● 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.
![Page 4: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/4.jpg)
MTA - Mail Transfer Agent
![Page 5: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/5.jpg)
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.
![Page 6: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/6.jpg)
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.
![Page 7: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/7.jpg)
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>
![Page 8: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/8.jpg)
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.
![Page 9: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/9.jpg)
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>
![Page 10: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/10.jpg)
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> ... ]
![Page 11: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/11.jpg)
Apart from Exim we have the below mails servers.
● Sendmail● Postfix● Qmail
![Page 12: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/12.jpg)
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.
![Page 13: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/13.jpg)
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
![Page 14: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/14.jpg)
# 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
![Page 15: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/15.jpg)
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
![Page 16: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/16.jpg)
myorigin = $mydomainIf the myhostname is:mail.example.comAnd if the user who sends mail is mike, then the resulting mail
return address is: [email protected]@myhostname(FQDN)If users do not want the hostname of the server in the return
address then set the myorigin to this parameter:myorigin = [email protected]
![Page 17: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/17.jpg)
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
![Page 18: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/18.jpg)
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
![Page 19: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/19.jpg)
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
![Page 20: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/20.jpg)
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
![Page 21: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/21.jpg)
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
![Page 22: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/22.jpg)
7. defaultdomain Default domain name of server
8. defaulthost Hostname of server
9. databytes Maximum number of bytes in message (0=no limit)
![Page 23: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/23.jpg)
MDA- Mail Delivery Agent
![Page 24: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/24.jpg)
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.
![Page 25: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/25.jpg)
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.
![Page 26: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/26.jpg)
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
![Page 27: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/27.jpg)
MUA- Mail User Agent
![Page 28: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/28.jpg)
● Outlook● Thunderbird● Windows Live● Mac Entourage
Email clients
![Page 29: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/29.jpg)
Web Based Email Client
● Squirrel Mail
● Horde
● Round cube
![Page 30: Mail server](https://reader035.vdocuments.us/reader035/viewer/2022081605/587810fa1a28ab971e8b703d/html5/thumbnails/30.jpg)
THANKYOU