viagra usa viagra pills discounts cialis levitra viagra buy cheap viagra uk sales viagra soft tablets mexico rx viagra cheap viagra germany viagra professional indian genric viagra viagra without rx viagra prescription or non overnight viagra how much viagra costs pfizer viagra cheap viagra in canada buy viagra no prescription pills viagra usa online sales viagra 100g viagra 50 mg delivery viagra 100 mg fast where can i get viagra germany generic viagra canada viagra fast viagra for wwomen overnight generic viagra cheap natural viagra delivery canadian viagra online sale canada non prescription viagra germany online viagra canada canada viagra viagra gel viagra no prescription canadian viagra germany viagra 100 cheap viagra canada viagra oral gel where to buy viagra online now buy viagra online without prescription viagra without a prescription viagra 100mg canadian pharmacy viagra how to buy viagra viagra pfizer viagra purchase discounts what kind of viagra canada viagra usa india viagra viagra discounts discounts viagra uk real viagra cheapest viagra online gel viagra viagra for sale viagra without prescription delivery canadian pharmacies/viagra now how does viagra work? usa pfizer viagra online viagra 100mg cheap where to get viagra for women uk now buy viagra cheap buy purchase viagra with no prescription pills generic viagra 50mg viagra soft viagra overnight canada buy india viagra buy how does viagra work viagra samples germany buy real viagra no rx viagra buy cheap viagra online pharmacy viagra - 100mg canadian buy viagra single online does viagra contains pork or alcohol should you use viagra with a catheter usa viagra sale viagra prescriptions buy pfizer viagra viagra prices usa viagra online sales now viagra side effects sales viagra price comparison viagra cost viagra sales viagra in mexico viagra low price cheap viagra price germany cost of viagra viagra sample germany purchase viagra 50mg reliable purchase of viagra where to buy viagra fast viagra discount viagra with no prescription viagra cheapest germany purchase viagra benefits of viagra germany generic viagra viagra online free viagra viagra drug buy viagra no prescription discount no prescription viagra viagra canadian pharmacy viagra no doctor fast viagra side effect viagra online ordering usa viagra on line usa is there a generic version of viagra buy viagra canada where can i get cheap viagra sales viagra now low price viagra usa discount viagra online viagra on sale cheap viagras viagra on line san marino viagra for women cialis best price cialis best way to take cialis discounts brand cialis discounts brand name cialis pharmacy buy cialis buy cialis without prescription sales buy generic cialis germany buy real cialis canada brand name cialis delivery canada pharmacy cialis canada pharmacy cialis soft buy canadian online cialis canadian pharmacy online generic cialis usa cheap cialis pharmacy cheap cialis no prescription cheapest cialis on the net cheapest price cialis fast cialis 100 cialis 100mg cialis 20mg cialis 30mg fast cialis 50mg cialis abdominal pain cialis age 45 fast cialis available cialis brand cialis canada online cialis canada pharmacy cialis canadian pharmacy cialis costs online cialis fast delivery germany cialis for sale now cialis for women cialis free cialis from canada now cialis from mexico cialis gel cialis generic cheap cialis generic on lice pills cialis in canada now cialis information canada cialis korea sales cialis levitra viagra canada cialis mailed overnight buy cialis medication sales cialis mexico cialis next day cialis next day delivery cialis no prescription pharmacy cialis online canadian delivery cialis online overnight germany cialis overnight cialis overnight delivery now cialis pills cialis pills canadian pharmacy sales cialis price pills cialis professional cialis professional singapore cialis purchase cialis purchase israel fast cialis sample cialis samples cialis side effects cialis suppliers fast cialis tablet sales cialis tablets cialis to children cialis without a prescription pills cialis without prescription pills discount cialis generic cialis buy generic cialis overnight online generic cialis overnight delivery online how cialis works delivery how much is cialis how to get cialis inquiry cialis sales low price cialis online name brand cialis canada next day delivery of cialis non-prescription cialis order cialis sales ordering cialis phentolamine in generic cialis professional cialis pharmacy canada purchase real cialis usa purchse cialis real cialis soft cialis where can i buy cialis where purchase cialis cheap where should i buy cialis online cheap where to buy real cialis buy why cialis does not work cialis daily usa generic viagra female viagra viagra buy cialis daily cialis viagra generic canada women viagra cialis price professional cialis online brand viagra professional online cialis dosage buy cialis no prescription now viagra gel viagra rx in canada buy cialis online canada fast brand viagra without prescription buy delivery viagra from india pills viagra 50 mg generic viagra made in india now cialis professional next day delivery buy cialis us discount viagra overnight delivery sales cialis soft viagra for cheap how to get viagra no prescription cialis professional 100 mg canada china viagra pharmacy buy viagra now price of cialis in canada delivery cheapest viagra online levitra vs viagra buying real viagra without prescription effect of cialis on women discounts cialis daily canada viagra in canada viagra canada pills how much does cialis cost canadian pharmacy cialis sales cialis for women viagra discount natural viagra viagra dosage germany cialis daily cialis without prescription pharmacy canadian pharmacy discount code viagra viagra soft tabs 100 mg now best viagra alternative delivery viagra tablets sale discount cialis herbal viagra viagra sales in canada viagra no prescription canada viagra generic where to purchase viagra canada buy cialis once daily sales viagra side effects viagra 100 mg sales pfizer viagra cheap 5 mg cialis buy viagra in canada no prescription canadian pharmacy viagra legal now price check 50mg viagra professional cialis online generic cialis canadian order usa viagra online now buy pfizer viagra online pills viagra cheap canada cialis professional germany buy cialis on line cheap viagra for sale mexico pharmacy cialis soft viagra real viagra without prescription discount brand name cialis buying cialis on line viagra online pharmacy usa canada online cheap viagra buy viagra china buy cialis generic cialis canada low cost viagra cialis women buy online pharmacy cialis usa cialis canadian pharmacy is pfizer viagra available in india delivery viagra fast delivery delivery get cialis online fast canada pharmacy viagra pfizer cialis professional no prescription cialis canadian pharmacy online overnight canadian viagra fast generic cialis soft tabs pfizer mexico viagra best cialis price viagra china viagra tablets canada cialis 50 mg viagra brand usa women viagra buy generic viagra made in india buy buy cialis without a prescription what better viagra or cialis canadain viagra india usa buy cialis without doctor prescription germany double dose of cialis 5 mg original brand cialis viagra no prescription sales does generic cialis work cheap viagra for women in india now one day delivery cialis pills buy cialis viagra canada generic viagra cheap canada sales buy cialis online uk how does viagra work viagra professional cialis soft canada sales cialis overnight cialis vs levitra cheap real viagra online buy cialis canada online buy viagra online viagra in india cost of viagra now female viagra viagra usa buy viagra cheap canada fast best price for generic cialis us discount viagra overnight delivery cheap viagra overnight delivery buy cialis online without prescription online order viagra overnight delivery buy cialis professional viagra in canada pfizer brand name cialis cialis fast delivery usa now pfizer viagra 50 mg online cheapest prices for viagra sales cheapest prices on viagra viagra canadian scam generic cialis in india cheap viagra for cheap cheap usa generic viagra cialis blood thinner cialisis in canada buy real cialis online overnight viagra buy get cialis online cialis for sale cialis low price cialis generic viagra order buying viagra buy viagra cookies cheap viagra oral gel pharmacy viagra samples viagra pfizer online viagra fast viagra dose sales viagra viagra cost no prescription viagra pills how to get cialis no prescription purchase cialis next day delivery canada viagra pharmacies scam brand name cialis overnight viagra online without a prescription pfizer viagra buy brand name cialis without prescription pills cialis and canada custom online viagra canadian pharmacy dosage cialis next day delivery fast brand viagra over the net can i get viagra in mexico online generic cialis 100 mg online pharmacy cialis low cost canadian viagra buy where to get viagra cheap now cialis canadian pharmacy sales where to get viagra cheap cialis samples in canada buy cialis doctor online viagra overnight delivery viagra generic canada pharmacy cialis germany pfizer female viagra cialis prescription

 

March 19, 2007

Exim - Basics

Filed under: Technical Articles — @ 12:43 pm

HISTORY
——-

* Exim was written by Philip Hazel at the University of Cambridge in 1995.
* Written using the basic philosophy of Smail
* The name was derived from “Experimental Internet Mailer” as the outcome of the
project at start was unknown.

EXIM
—-

* Exim is Open Source and distributed under the GNU General Public License (GPL)
* Exim is a Mail Transfer Agent (MTA)

INTERNET MAIL TRANSPORT AGENTS
——————————

* MTA – Mail Transfer Agent
MTA is a program used for transporting mail from one host to another. Messages sent from one host to another use the Simple Mail Transfer Protocol (SMTP).

* MUA – Mail User Agent
The program people most often use to send/receive mail are referred to as Mail UserAgents (MUAs). They exist to provide convenient mail interfaces for users.
Examples are Outlook, Thunderbird, iMail, etc

The MUA simply sends the mail to the MTA which then transports the mail from host to host until it’s delivered to mailbox and retrieved using an MTA

MDA – Mail Delivery Agent
A Mail Delivery Agent (MDA) is used by the MTA to deliver email to a particular user’s mailbox.

EXIM PORT
———
* SMTP listens on TCP port 25. Because of this, Exim must be run as a priviledged
program.

* Port 465 is reserved for SMTP over SSL. However, Exim employs Transport Layer
Security (TLS) in order to not need a seperate port for secure communications.

HEADERS
——-

* RFC 2822 is standard used for the message format.
* RFC 2822 - Internet Message Format. It is an international standard that defines the format of SMTP email
* A message consists of a header and a body. The header contains a number of lines as defined by RFC 2822.
* RFC 2822 allows many variations for addresses, such as :
To: example@example.com
John Doe <example@example.com>
example@example.com (John Doe)

* Many header lines are added by the MTA. In addition to the header and the body,an envelope is transmitted immediately before the headers using SMTP commands MAIL and RCPT.
* Envelope contains sender address and at least one recipient address. Always in form of <user@domain>.
* Delivery is based completely on the envelope, not the To: or Cc: lines. Any message failures are always sent to the envelope from address, not the From: or Reply-to: address.
* Additional header lines are also added by the MUA and MTA. Before transmitting message, Date: and Message-ID: line always added by the MUA. Many other headers can also be added by MUA and MTA.
* SpamAssassin on cPanel servers add headers which are prefixed with X-Spam. Other headers can be added based on the Exim configuration.

HOW SMTP WORKS
—————

* SMTP is a Simple command-reply protocol. Client host sends command and awaits a reply.

• MUA =requests=> MTA
• MTA =220 ESMTP Ready=> MUA
• MUA =EHLO=> MTA
• MTA =Accept=> MUA
• MUA =From=> MTA
• MUA =To=> MTA
• MTA =Accepted=> MUA
• MUA =Data=> MTA
• MTA =354=> MUA
• MUA =send=> MTA
• QUIT

EXIM IN CPANEL
————-

• On cPanel servers, both /usr/lib/sendmail and /usr/sbin/sendmail are symlinks to the Exim binary.

• Most exim processes act seperately and are short lived. The exception to this is:

1) Process to listen on SMTP port for incoming TCP/IP connections
2) Process to start up queue runner processes.

Exim configuration file is stored at /etc/exim.conf on cPanel servers. However, all modifications to the exim.conf can be made through the Advanced Exim Configuration Editor in WHM.

MESSAGE ID
———-

• Every message handled by Exim is issued a unique Message-ID.
• The ID is 16 characters and seperated into 3 parts by hyphens. Each part is actually a number, encoded in base 62.
• The first part is the unix time the message started to be received. The second part is the PID of the process that received it. The third part is are used to distinguish
between processes received by the same process at the very same moment.

EXIM 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 seperate subdirectories 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.

EXIM COMMANDS
————-

* You can manage the Exim queue from command line very easily.
* To list the contents of the queue, you would simply use the command:
exim -bp
* To only give you the number of emails in the spool you simply add a ‘c’ to the end of the command:
exim -bpc
* You can examine the contents of a message in queue using the ‘exim -Mvl command followed by the Message ID

EXIM STATS
———

* We use the eximstats daemon to monitor your exim queue.
* Eximstats is a perl script which parses logs and creates a mysql database with many different statistics about Exim.
* Most of this information can be accessed through WHM using the “View Mail Statistics” option.
* To restart eximstats you would use /scripts/restartsrv_eximstats.

TroubleShooting EXIM
——————–
* There are many troubleshooting techniques you can use on the command line for Exim.
* To test how Exim would route a message you simply use the ‘exim -bt’ command, for instance:
exim -bt nick@example.com
* This will tell you which routers Exim would use to deliver a message to this address.

EXIM LOG FILES
————–

* There are three log files available for you to monitor the activities of Exim.
- 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. (most often related to syntax errors in the log files).

EXIM.CONF
———

* The exim configuration editor can be accessed through WHM for modifying any aspect of the exim.conf.
* This editor also allows you some simple configuration options such as:
– Always set the Sender: header when the sender is changed from the actual sender. (Unchecking this will stop “On behalf of” data in Microsoft(R) Outlook, but may
limit your ability to track abuse of the mail system.)
* Verify the existance of email senders.
* Use callouts to verify the existance of email senders.
* Discard emails for users who have exceeded their quota instead of keeping them in the queue.

MAILDIR VS MBOX
—————-

* The best advantage of Maildir over other mailbox formats is maildir does not require locks as it’s all seperate files.
* All mail is written to a tmp directory first, and then written to the ‘new’ directory.
* Once the MUA finds mail in the ‘new’ directory, it will move it to the ‘cur’ directory.
* All cPanel servers now come default using Maildir instead of mbox. However, for any old systems which have not yet been converted to maildir, you can simply use the script:
/scripts/convert2maildir
* Maildir is especially beneficial for servers that pass large volumes of mail.

EXIM FACTS FOR THE SUPPORT TEAM
——————————-

• RELAYING
• RBL
• Finding A Mail From Log
• SPAMD
• CLAMD
Article Authored by Nobin Joseph

Author, Nobin, is a  Sr.Systems Engineer with SupportPRO. Nobin specializes in Exim,Cpanel and Linux servers. SupportPRO offers 24X7 technical support services to Web hosting companies and service providers.


AddThis Social Bookmark Button

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress