Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Mail server
1. 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.
2.
3. ● MTA - Mail Transfer Agent
It’s a program used for transporting mails from one host to
another host.
● MDA - Mail Delivery Agent
Its used by MTA to deliver emails to particular user mail box.
● MUA - Mail User Agent
It’s a program that people use to send/receive mails are known as
MUA.
5. EXIM
1. 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 to
destinations.
6. Exim Log Files
Three 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.
8. 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.
9. To view header
root@localhost# exim -Mvh <message-id>
To view body
root@localhost# exim -Mvb <message-id>
To view message logs
root@localhost# exim -Mvl <message-id>
10. 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> ... ]
11. Apart from Exim we have the below mails servers.
● Sendmail
● Postfix
● Qmail
12. 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.
13. The configuration files for Sendmail are located in /etc/mail.
/etc/mail/access
This 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 OK
Hosts listed as REJECT
Hosts listed as RELAY
Hosts listed as ERROR
Host is listed as SKIP
Hosts listed as QUARANTINE
14. # 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
15. Postfix
Postfix is a free and open-source mail transfer agent (MTA) that
routes and delivers electronic mail.
Configuration file: /etc/postfix/main.cf
myhostname = mail.example.com
mydomain = example.com
inet_interfaces = all
mydestination = $mydomain, $myhostname
16. myorigin = $mydomain
If the myhostname is:
mail.example.com
And if the user who sends mail is mike, then the resulting mail
return address is: mike@mail.example.com
username@myhostname(FQDN)
If users do not want the hostname of the server in the return
address then set the myorigin to this parameter:
myorigin = $mydomain
mike@example.com
18. 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-send
2. qmail-lspawn
3. qmail-rspawn
4. qmail-clean
5. tcpserver
19. How Qmail works
1. Email arrival in Qmail
2. Queuing emails
3. Processing queued emails
4. Email delivery to local and remote recipients
5. Cleaning queue after delivering emails
20. Qmail configuration files
Configuration files : /var/qmail/control
1. badmailfrom
All "from addresses" which are blacklisted.
2. bouncefrom
username of bounce sender
3. bouncehost
hostname of bounce sender
21. 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
22. 7. defaultdomain
Default domain name of server
8. defaulthost
Hostname of server
9. databytes
Maximum number of bytes in message (0=no limit)
24. 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.
25. 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.
26. Mail Ports
Outgoing SMTP Ports:
SMTP non encrypted ports : 25 and 587
SMTP encrypted port : 465
Incoming Mail server ports:
POP non ssl port : 110
IMAP non ssl port :143
POP ssl port : 995
IMAP ssl port : 993