Exim Configuration

Exim

Exim is what is known as an MTA, or a Mail Transit Authority. There are several different MTA’s available on the market. Some of the most popular ones are Exim, Sendmail, Postfix and qmail. Exim is our choice for mail on the servers because it came with cPanel.

Exim configuration files are mainly located in /etc.

Configuration File Location

/etc/exim.conf – main server exim configuration.
/etc/localdomains – For Local email Delivery
/etc/remotedomains – For remote email delivery
/etc/backupmxhosts – This is for allowing users to bypass the email rate limiting.
/etc/skipsmptcheckhosts – this will allow you to skip the smtp checks.
/etc/senderverifybypasshosts – This file allows you to setup a list of verified senders hosts that bypass the
sender checks
/etc/trustedmailhosts – This file allows you to setup trusted email hosts, bypassing checks
/etc/userdomains – this file has the user to domain mapping for local delivery.
/etc/valiases/ – This directory stores all of the email aliases on the entire server, if you add it in cpanel it is here.
/etc/vfilters/ – This directory is where all of the email filters are for the entire server.
Exim Log file Location
/var/log/exim_mainlog – The main exim log that you check for any incoming/outgoing mail issues
/var/log/exim_paniclog – The exim panic log which shows unexpected and fatal errors
/var/log/exim_rejectlog – The exim reject log of any email’s that are automatically rejected from the server

Part of troubleshooting exim will start with the exim logs, there are several things you need to know while
reading these logs, here is a legend to some of the symbols you will see in the logs. These symbols show
weither the email is coming in, going out or is deferred.

=> normal message delivery
-> additional address in same delivery
*> delivery suppressed by -N
** delivery failed; address bounced
== delivery deferred; temporary problem

File structure for the Mail Directory(

You may see other directories here, they are either created by cpanel or the user, so make sure you fully
investigate.

cur/ – this directory shows what is currently in their email box, but is already read
.Drafts/
maildirsize – cache file with directory size which coralates with what is in cpanel
new/ – unread messages
.Sent/ – sent messages
tmp/ – temp folder
training.yklinux.com/ – Domain storage for the email address associated with this domain name
.Trash/ – Trashed Email
symlink to the email addresses stored under the domain training6.prepgator.com
.sam@training_yklinux_com@
.jon@training_yklinux_com@
.git@training_yklinux_com@
.mans@training_yklinux_com@

Useful Exim Commands

Counts all email in the mail queue
exim -bpc
Prints a listing of the queue contents
exim -bp
View Log for message
exim -Mvl messageID
View Body for message
exim -Mvb messageID
Prints a summary of the messages in queue – add “-c” to sort by count and “-a” to sort by age.
exim -bp | exiqsumm

example:
[root@yklinux ~]# exim -bp | exiqsumm -c | head -6
Count Volume Oldest Newest Domain
—– —— —— —— ——
3 12KB 12h 6m saudi.net.sa
2 8089 2h 27m telecomitalia.it

force delivery of one message
exim -M emailID
Force another queue run
exim -qf
Force another queue run and attempt to flush frozen messages
exim -qff
View Header for message
exim -Mvh messageID
ReMove message (no errors sent)
exim -Mrm messageID
Give up and fail message, message bounces to sender
exim -Mg messageID
Delete all those pesky messages that are causing line mismatches by not having a size attribute.
exim -bpr | awk ‘{print $2}’ | grep -e ‘-……-‘ | xargs exim -Mrm >/dev/null 2>/dev/null &

Bookmark the permalink.

Comments are closed.