Você está na página 1de 25

Exim is a mail transfer agent(MTA) that can be

run as an alternative to Sendmail.

Exim is written in ANSI C.

Messages can be delivered at the first


attempt. messages can be delivered at the first
messages can be delivered at the first
attempt
attempt
Mail Transfer Agent

A Mail Transfer Agent receives messages


from different sources and deliver it to their
destinations.
It can accept messages from remote host or
local processes.
It can also deliver messages locally or to
remote hosts.
MTA

MUA
MUA MTA
MTA MUA
MUA

Remote
RemoteMTA
MTA Remote
RemoteMTA
MTA
Internet
Internet
Receiving and Delivering Messages

● Two entirely separate operations in Exim.


● Receiving a message consists of writing it to

local spool files


● A delivery operation gets all its data from the

spool files.
Exim's Queue

Exim's queue is normally treated as a


collection of messages with no implied
ordering, more like a ''pool'' than a ''queue.''

exim -bp
How exim delivers messages:

4 Types of drivers, of which directors, routers


and transports are concerned with handling
address and delivering messages. The fourth
one is used for SMTP Authentication.

Directors handle local addresses.

Routers handle remote addresses.


Local and Remote Addresses

The first thing Exim does when processing an


address is to determine whether it should be
handled by the directors or by the routers.
If the domain is listed in the configuration as a
local domain, the address is processed by the
directors and is called a local address.
Otherwise it is processed by the routers and is
called a remote address.
Exim Files

/etc/localdomains
/etc/userdomains
/etc/valiases/domain.com
/etc/vfilters/domain.com
/home/username/etc/domain.com/passwd
/home/username/etc/domain.com/shadow
Message Identification

Each message has a unique ID. Its 16 letter


long and consist of 3 parts. Each part is a
number encoded in base 62.

example: 1LbZ8L-0002GP-NP
Reducing Activity at high load

1) deliver_load_max:
When this option is set, no message deliveries
are ever done if the system load average is
greater than its value.

smtp_load_reserve:
This suspends incoming mail when load is high.
2) smtp_accept_max:
This specifies the maximum number of
simultaneous incoming SMTP calls that Exim
will accept.
smtp_accept_max = 100
3) smtp_accept_max_per_host:
This option restricts the number of simultaneous
IP connections from a single host to the Exim
daemon.
4) smtp_check_spool_space
When this option is set, if an incoming SMTP
session encounters the SIZE option on a MAIL
command, it checks that there is enough space
in the spool directory's partition to accept a
message of that size. If there isn't enough
space, a temporary error code is returned.
5) message_size_limit
This option limits the maximum size of message
that Exim will process.
6) remote_max_parallel
This option controls parallel delivery to remote
sites. If the value is less than 2, parallel
delivery is disabled, and Exim does all the
remote deliveries for a message one by one,
from a single delivery process.
Large Message Queues

split_spool_directory = yes
If this option is set, it causes Exim to split its
input directory into 62 subdirectories. Splitting
up the spool in this way may provide better
performance on systems where there are long
mail queues, by reducing the number of files in
any one directory.
Example:
/var/spool/exim/input
drwxr-x--- 2 mailnull mail 45056 Feb 24 06:56 0/
drwxr-x--- 2 mailnull mail 45056 Feb 24 07:01 1/
drwxr-x--- 2 mailnull mail 45056 Feb 24 07:05 2/
drwxr-x--- 2 mailnull mail 36864 Feb 24 07:00 3/
drwxr-x--- 2 mailnull mail 61440 Feb 24 06:59 4/
drwxr-x--- 2 mailnull mail 36864 Feb 24 07:08 5/
drwxr-x--- 2 mailnull mail 49152 Feb 24 06:19 6/
drwxr-x--- 2 mailnull mail 57344 Feb 24 07:08 7/
Example

host: simple.example

Suppose a user of this host has sent a


message addressed to one local and one
remote recipient:

postmaster@simple.example
friend@another.example
For postmaster@simple.example, the domain
is local, so it is passed to the first defined
director, whose configuration is as follows:

system_aliases:
driver = aliasfile
file = /etc/aliases
search_type = lsearch
Second director configuration:
userforward:
driver = forwardfile
file = .forward

Third director configuration:


localuser:
driver = localuser
transport = local_delivery
There is still one address to process:
friend@another.example. Its domain is not a
local one, so it is processed by routers rather
than by directors. Exim offers it to the first
router:

lookuphost:
driver = lookuphost
transport = remote_smtp
lookuphost: is used to obtain a list of remote
hosts for the domain of an address, and in its
normal configuration, it does this by looking
up the domain in the DNS using MX and
address records.
This details is then appended to the queue for
remote_smtp as a host list.
 friend@another_domain.example

Lookup
Lookuphost
host DNS
DNS

remote_smtp
remote_smtp
Transport
Transportqueue
queue
Exim Commands

exim -Mvh 1LbZ8L-0002GP-NP


exim -Mvb 1LbZ8L-0002GP-NP
exim -Mvl 1LbZ8L-0002GP-NP
exim -Mrm 1LbZ8L-0002GP-NP
exim -Mar 1LbZ8L-0002GP-NP <address>
exim -q -v: start a queue run
exim -ql -v: start a queue run for local
deliveries
exim -bp:
exim -M emailID:
force delivery of one message
exim -qf:
Force another queue run
exim -qff:
Force another queue run and attempt to
flush frozen messages

Você também pode gostar