Using Quick Mail Transfer Protocol

 < Free Open Study > 



QMTP is an SMTP replacement protocol designed by Dan Bernstein. The protocol is defined at http://cr.yp.to/proto/qmtp.txt. QMTP is similar to SMTP but is simpler, faster, and incompatible with SMTP. qmail includes a QMTP server, qmail-qmtpd, which is run very much like qmail-smtpd. QMTP usually uses port 209.

qmail doesn't include a QMTP client, but the serialmail package does (see Appendix B, "Related Packages"). maildirqmtp takes a maildir mailbox and delivers the messages it contains to the designated QMTP server via QMTP.

QMTP is not a drop-in replacement for SMTP, and it's not yet in widespread use across the Internet.

A patch is available for qmail-remote that adds support for QMTP (see the previous section for more information.)

Setting Up a QMTP Service

qmail-qmtpd is built and installed with qmail. To activate it, all you need to do is set up a service directory for it under /service.

A tarball package is available (http://www.qmail.org/qmtpd-service.tar.gz) that can be extracted to configure a QMTP service.

For example, to set up a QMTP service, do this:

 $ cd /tmp $ wget http://www.qmail.org/qmtpd-service.tar.gz —11:58:09—  http://www.qmail.org/qmtpd-service.tar.gz             => 'qmtpd-service.tar.gz.1' Connecting to www.qmail.org:80. . . connected! HTTP request sent, awaiting response. . . 200 OK Length: 1,054 [application/x-gunzip] 0K -> .                                                                 [100%] 11:58:11 (114.37 KB/s) - 'qmtpd-service.tar.gz.1' saved [1054/1054] $ su Password: rootpassword # cd / var/qmail/supervise # zcat /tmp/qmtpd-service.tar.gz | tar xf - # ln -s /var/qmail/supervise/qmtpd /service # 

Within seconds, svscan will notice the /service/qmtpd directory and run supervise on it. qmail-qmtpd uses the rcpthosts file to control relaying, just like qmail-smtpd. Unlike the services installed in Chapter 2, "Installing qmail," the qmtpd service directory is self-contained: Logging and configuration is done under /var/qmail/supervise/qmtpd.

QMTP

SMTP requires a lot of back and forth between the client and server, which lowers its performance over high-latency connections. It's also not 8-bit clean—some MTAs refuse or damage messages containing characters with the highest bit set— which makes it hard to send messages composed with international character sets. It also requires messages to be converted to DOS-style carriage return/line-feed (CR-LF) newlines when they're sent over the network.

QMTP minimizes the number of round trips required between the client and server and is entirely 8-bit clean. It also allows messages to be sent with either DOS-style CR-LF or Unix-style LF-only newlines.

RFC 1854, replaced by RFC 2197, added the PIPELINING extension to SMTP. This extension allows SMTP clients to continue sending SMTP commands without waiting for responses to previous commands from the server. This feature was added to lessen the effect of high-latency connections on SMTP performance. QMTP goes one step further by allowing messages to be sent using a single "command" followed by one server response per recipient—and the dialogue is pipelined, so the client doesn't have to wait for server responses while it has got more messages to send.

For example, sender@host-a is sending a message to recip@host-b. Using standard SMTP, the dialogue would look like Figure 7-1.

click to expand
Figure 7-1: Example SMTP dialogue

The complete dialogue requires seven round trips from host-a to host-b and back to host-a. Note that each additional recipient will add another round trip.

Figure 7-2 shows the same exchange using pipelining SMTP.

click to expand
Figure 7-2: Example of pipelined SMTP dialogue

Pipelining has reduced the number of round trips from seven to four, and multiple recipients won't require additional round trips.

Finally, Figure 7-3 shows how the message would be sent using QMTP.

click to expand
Figure 7-3: Example of QMTP dialogue

QMTP sends the message in two round trips, and, again, multiple recipients won't require additional round trips.



 < Free Open Study > 



The Qmail Handbook
The qmail Handbook
ISBN: 1893115402
EAN: 2147483647
Year: 2001
Pages: 186
Authors: Dave Sill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net