|
NAMEdot-qmail - control the delivery of mail messagesDESCRIPTIONNormally the qmail-local program delivers each incoming message to your system mailbox, homedir/Mailbox, where homedir is your home directory.It can instead write the mail to a different file or directory, forward it to another address, distribute it to a mailing list, or even execute programs, all under your control. THE QMAIL FILETo change qmail-local's behavior, set up a .qmail file in your home directory..qmail contains one or more lines. Each line is a delivery instruction. qmail-local follows each instruction in turn. There are five types of delivery instructions: (1) comment; (2) program; (3) forward; (4) mbox; (5) maildir.
If .qmail has the execute bit set, it must not contain any program lines, mbox lines, or maildir lines. If qmail-local sees any such lines, it will stop and indicate a temporary failure. If .qmail is completely empty (0 bytes long), or does not exist, qmail-local follows the defaultdelivery instructions set by your system administrator; normally defaultdelivery is ./Mailbox, so qmail-local appends the mail message to Mailbox in mbox format. .qmail may contain extra spaces and tabs at the end of a line. Blank lines are allowed, but not for the first line of .qmail. If .qmail is world-writable, qmail-local stops and indicates a temporary failure. SAFE QMAIL EDITINGIncoming messages can arrive at any moment. If you want to safely edit your .qmail file, first set the sticky bit on your home directory:chmod +t $HOME qmail-local will temporarily defer delivery of any message to you if your home directory is sticky (or group-writable or other-writable, which should never happen). Make sure to chmod -t $HOME when you are done! It's a good idea to test your new .qmail file as follows: qmail-local -n $USER ~ $USER '' '' '' '' ./Mailbox EXTENSION ADDRESSESIn the qmail system, you control all local addresses of the form user-anything, as well as the address user itself, where user is your account name. Delivery to user-anything is controlled by the file homedir/.qmail-anything. (These rules may be changed by the system administrator; see qmail-users(5).)The alias user controls all other addresses. Delivery to local is controlled by the file homedir/.qmail-local, where homedir is alias's home directory. In the following description, qmail-local is handling a message addressed to local@domain, where local is controlled by .qmail-ext. Here is what it does. If .qmail-ext is completely empty, qmail-local follows the defaultdelivery instructions set by your system administrator. If .qmail-ext doesn't exist, qmail-local will try some default .qmail files. For example, if ext is foo-bar, qmail-local will try first .qmail-foo-bar, then .qmail-foo-default, and finally .qmail-default. If none of these exist, qmail-local will bounce the message. (Exception: for the basic user address, qmail-local treats a nonexistent .qmail the same as an empty .qmail.) WARNING: For security, qmail-local replaces any dots in ext with colons before checking .qmail-ext. For convenience, qmail-local converts any uppercase letters in ext to lowercase. When qmail-local forwards a message as instructed in .qmail-ext (or .qmail-default), it checks whether .qmail-ext-owner exists. If so, it uses local-owner@domain as the envelope sender for the forwarded message. Otherwise it retains the envelope sender of the original message. Exception: qmail-local always retains the original envelope sender if it is the empty address or #@[], i.e., if this is a bounce message. qmail-local also supports variable envelope return paths (VERPs): if .qmail-ext-owner and .qmail-ext-owner-default both exist, it uses local-owner-@domain-@[] as the envelope sender. This will cause a recipient recip@reciphost to see an envelope sender of local-owner-recip=reciphost@domain. ERROR HANDLINGIf a delivery instruction fails, qmail-local stops immediately and reports failure. qmail-local handles forwarding after all other instructions, so any error in another type of delivery will prevent all forwarding.If a program returns exit code 99, qmail-local ignores all succeeding lines in .qmail, but it still pays attention to previous forward lines. To set up independent instructions, where a temporary or permanent failure in one instruction does not affect the others, move each instruction into a separate .qmail-ext file, and set up a central .qmail file that forwards to all of the .qmail-exts. Note that qmail-local can handle any number of forward lines simultaneously. SEE ALSOenvelopes(5), maildir(5), mbox(5), qmail-users(5), qmail-local(8), qmail-command(8), qmail-queue(8), qmail-lspawn(8) Visit the GSP FreeBSD Man Page Interface. |