In the given section the system of post dispatch or the agent of mail transfer (Message Transfer Agent, MTA) is
described. Here under sendmail any program giving the interface for dispatch of mail, realizing reports SMTP is meant,
UUCP, etc. In Windows such programs are Microsoft Exchange, Netscape Messaging Server, MDaemon, etc. For Unix is Sendmail,
Exim, RSMTP. We shall consider the most popular server for Unix - Sendmail.
The basic means of mail dispatch in Internet is the sendmail. It ensures the functioning into modular system of
dispatch which is intended for reception and sending of the correspondence, and also management of programs of preparation
and viewing of post messages. Sendmail allows to organize post service of a local network and to exchange mail with other
servers of post services through special sluices. Sendmail can be configured for work with various post reports. Usually
it is reports UUCP (Unix-Unix-CoPy) and SMTP (Simple Mail Transfer Protocol).
Sendmail works in style of post service which accepts and sends post messages. Sendmail can interpret two types of
post addresses:
- Post SMTP addresses;
- Post UUCP addresses.
Sendmail it is possible to adjust for support:
- The list of addresses-synonyms;
- The list of addresses of dispatch of the user;
- Automatic dispatch of mail through sluices;
- Supports of turns of messages for repeated dispatch of mail in case of refusals at dispatch;
- Works as a SMTP-server;
- Access to addresses of machines through a server of domain names BIND;
- For access to external servers of names.
Principle of the sendmail work
Sendmail sends mail in two stages:
1. Post messages gather in turn
2. Turns are sent.
Each message consists of three parts: an envelope, heading and a body of the message.
Envelope. The envelope consists of the address of the sender, the address of the addressee and the information of dispatch
which is used by programs of preparation, dispatches and receptions of mail. The envelope remains invisible to the sender
and the addressee of the post message.
Heading. The heading consists of standard text lines which contain addresses, the information on dispatch and data. The
heading can be a part of the text file prepared by the user, and can be prepared and added to a body of the message by the
program of preparation of mail. Data from heading can be used for registration of an envelope of the message.
Body of the message. The first empty line in a file of the post message separates heading from a body of the message.
Everything, that follows after this line, refers to as a body of the message and is transferred by mail without changes.
Sendmail can be caused:
- The program of preparation of messages for sending already prepared messages;
- The program of reception of mail for transfer of mail received from a network;
- Directly user for sending by mail a file or the short message;
- A post demon which usually is itself sendmail.
After mail is collected, its dispatch begins. Thus following actions are carried out:
- Addresses of the sender and the addressee will be transformed to a format of a network-addressee of mail;
- If it is necessary, in heading of the message the lines allowing the addressee to answer the accepted message (for
example are added: FROM: -the address-);
- Mail is transferred one of programs of dispatch of mail.
When the program of reception of mail receives the message it transfers its program sendmail for the subsequent dispatch.
If the message has reached the machine of the addressee it sends the program of local dispatch to a mail box of the user.
The first stage of dispatch - gathering of messages. Sendmail receives post messages from three sources:
- A command line or standard input;
- Through the SMTP-report (from a network);
- From turn of messages.
At reception of messages from a command line or standard input sendmail it is caused by the user with the instruction of
the address of delivery of the message. Thus following actions are carried out: the address of the sender is defined, the
address of the addressee and both addresses gets out of a command line will be transformed according to the description of
a file of a configuration, the way of delivery the message is defined, the heading in operative memory for the subsequent
transformations is placed, and the body of the message is placed in a time file for sending without changes.
At reception of messages under report SMTP sendmail it is used as the program of the client and a server of the report.
The report is certain in RFC-821 and is the core for dispatch of mail in Internet. In this case sendmail it is started as
a demon which "listens" to port TCP and in case of reception of the message establishes connection with removed client
SMTP. As a rule, such client is other program sendmail.
The program of preparation of mail by the local machine also can use SMTP. For this purpose sendmail opens the channel
(pipe) an interprocessor exchange.
At reception of messages from turn time files of turns are used. These turns are used for storage of not dispatched
messages. The message is stored in two files. In one file, and the body of the message is stored in Other an envelope
and heading of the message. Usually sendmail interrogates turns through certain by the manager of a post server time
intervals for presence in them of not dispatched messages.
The second stage of dispatch of mail - dispatch of messages. As soon as one of described above ways sendmail has received
the message, attempt it is done to send to the address of. For this purpose sendmail defines three parameters: the program
of dispatch, unit of a network and the addressee. This procedure is made by rules which contain in a file of a
configuration. Sendmail keeps one copy of a body of the message in a time file, and the heading loads into operative
memory. For each message the program of delivery (dispatch) of messages is caused separately. If the message should be
delivered to different machines for each of machines the program of delivery also is caused. Some programs can serve at
once some subscribers of one machine; if it is impossible, for each subscriber the program of delivery is caused also.
|