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.
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.
The following specifies the syntax of the addr (and queue directory) address-list portion of the queued message:
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.