DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

queue(F)


queue -- MMDF queue files for storing mail in transit

Description

MMDF stores mail in /usr/spool/mmdf/lock/home, an isolated part of the filesystem, so that only authorized software can access the mail. Mail is stored under the directory sub-tree.

The queue directory can be changed using the MQUEUEDIR parameter (see mmdftailor(F)). The directory must must include a path with at least two sub-directories. The next-to-bottom sub-directory (/usr/spool/mmdf/lock by default) is used as a ``locking'' directory and the bottom sub-directory (/usr/spool/mmdf/lock/home by default) is the ``home''. For full protection, the locking directory is owned by MMDF and accessible only to it.

Queue entries

When mail is queued by submit, it is actually stored as two files. One contains the actual message text and the other contains some control information and the list of addressees.

The text file is stored in the msg sub-directory in home. The other file is stored in the addr sub-directory and is linked into one or more queue directories. The queue directories are selected based on the channels on which this message will be delivered. Each output channel typically has its own queue directory; they are usually named q.channel-name.

Another directory below home is a temporary area called tmp. It holds temporary address-lists as they are being built. Queuing of a message is completed by linking this address file into addr and the queue directories. The msg directory contains files with message text. The addr and msg files are synchronized by giving them the same unique name, called the ``message name''. The message name is derived by use of the mktemp(S) system call, using msg as the base filename. The files created in addr must have open read-write access; the ones in msg must have open read access.

When submit runs, it changes into home for its working directory. It then does a setuid to run as the caller. This is necessary to permit submit to access the caller's address-list files (specified as ``< file''). Deliver changes into the queue directory to minimize the time spent searching for messages to deliver.

The following depicts the directory organization:

              lock               (lock; mode 0700 - mmdf only)
                |
                |
          --- home ---           (open; mode 0777)
         /  |      |  \
        /   |      |   \
       /    |      |    \
      /     |      |     \
     /      |      |      \
    tmp    addr   q.*     msg    (open; mode 0777)
Addresses are built in tmp, moved into addr (file mode 0666), and linked into q.* (file mode 0666). Message text is put into msg with the file mode set to 0644.

Queue file formats

The msg portion of a queued message simply contains the message, which must conform to the Arpanet standard syntax, specified in RFC 822.

The following specifies the syntax of the addr (and queue directory) address-list portion of the queued message:

Address file contents


.br
file ::= creation late flags '\n' [rtrn-addr] '\n' *(adr_queue '\n')

creation ::=
{long integer decimal representation of the time the message was created}

late ::=
ADR_MAIL / ADR_DONE {from adr_queue.h}

flags ::=
{decimal representation of 16-bits of flags}

rtrn-addr ::=
{RFC 822 return address}

adr_queue ::=
temp_ok mode queue host local {conforms to structure specified in adr_queue.h}

temp_ok ::=
{temporary flag indicating whether this address has been verified by the receiving host: ``yes'' is ``+''; ``not yet'' is ``-''}

mode ::=
{send to mailbox(m), tty(t), both(b), either(e), or processing completed(*)}

queue ::=
{name of the queue into which this message is linked for this address}

host ::=
{official name (and domain) of recipient host}

local ::=
{local address on receiving host}

Address file description

An address queue file contains a creation time-stamp, an indication if the sender has been notified of delayed delivery, some flags, an optional return-mail address, and an address list. Several flags are currently in use. 0004 indicates whether late warnings should be sent to the return-mail address if the entire address list has not been processed within the number of hours specified by ``warntime''. 0002 indicates whether mail should be returned to the sender if it hasn't been completely processed within the number of hours specified by ``failtime''. 0001 indicates whether warning and failure messages are to contain only a citation of the message. An ``*'' value, for the ``late'' flag, indicates that a warning notice has been sent.

The creation date is coded as a long ASCII decimal string, terminated by the ``late'' flag. This has to be inserted into the file because UNIX System V doesn't maintain it. The date is used to sort the queue so that mail is delivered in the order submitted.

The return address is a line of text and may be any address acceptable to submit.

Each address entry is on a separate line, and conforms to the adr_struct format, defined in adr_queue.h. It contains several fields separated by spaces or commas. Fields containing spaces or commas must be enclosed in double quotes.

The temp_ok flag indicates whether the address has been accepted during an ``address verification'' dialog with the receiving host. When the message text is successfully accepted by the receiving host, then this flag no longer applies and the mode is set to ADR_DONE (``*''). Before final acceptance of message text, the mode flag indicates whether the mail is for a mailbox, terminal, both, or either. (Currently only mailbox delivery, ADR_MAIL, is used.)

The queue name is the name of the sub-queue in which the message is queued for this address. Each addressee's host may be on a separate queue or some hosts may share the same queue. When all addressees in the same queue have been delivered, the address file is removed from that queue directory. When all queues have been processed, the address file (in both addr and the queue directory) and the text file (in msg) are removed.

The host and local strings are used by the channel program. The host determines the type of connection the channel program makes. The local string is passed to the host; it should be something meaningful to that host. The local string must not contain newline or null and it must be a valid local address per RFC 822.

See also

cleanque(ADM), deliver(ADM), submit(ADM)

Standards conformance

MMDF is not part of any currently supported standard; it was developed at the University of Delaware and is used with permission.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005