maildelivery(4)
maildelivery --
mail delivery configuration file
Description
The
slocal(1)
program allows you to have your inbound mail processed according
to a complex set of selection criteria, specified in the file
.maildelivery in the user's home directory.
The maildelivery file controls how local delivery is
performed. Each line of this file consists of five fields, space or
comma separated. Because double-quotes are honored, these characters
can be included in a single argument by enclosing the entire argument
in double-quotes. A double-quote can be included by preceding it with
a backslash. Lines beginning with a hash sign (#) are ignored. The
format of each line in the maildelivery file is:
header pattern action result string
header-
The name of a header field that is to be searched for a pattern. This
is any field in the headers of the message that might be present. The
following special fields are also defined:
source-
The out-of-band sender information.
addr-
The address that was used to cause delivery to the recipient.
default-
This matches only if the message has not been delivered yet.
*-
This always matches.
pattern-
The sequence of characters to match in the specified header field.
Matching is not case-sensitive and does not use regular expressions.
action-
The action to take to deliver the message:
destroy-
This action always succeeds.
file-
Append (>) the message to the file named by string. The
message is appended to the mail folder in the maildrop format used
by your message transport system. If the message can be appended to
the folder, this action succeeds. When writing to the file, a
Delivery-Date: date
header is added that gives the date
and time message was appended to the folder.
mbox-
Identical to file.
pipe-
Pipe (|) the message as the standard input to the command named by
string, using the Bourne shell,
sh(1),
to interpret the string. Prior to giving the string to the shell,
the string is expanded with the following built-in variables:
$sender-
The out-of-band sender information.
$address-
The address that was used to cause delivery to the recipient.
$size-
The size of the message in bytes.
$reply-to-
Either the
Reply-To:
or From:
field of the
message.
$info-
The out-of-band information specified.
qpipe-
Similar to pipe, but executes the command directly, after
built-in variable expansion, without assistance from the shell. This
action can be used to avoid quoting special characters which your
shell might interpret.
result-
Indicates how the action should be performed.
A-
Perform the action. If the action succeeds, the message is considered
delivered.
\-
Perform the action. Regardless of the outcome of the action, the
message is not considered delivered.
?-
Perform the action only if the message has not been delivered. If the
action succeeds, then the message is considered delivered.
N-
Perform the action only if the message has not been delivered and
the previous action succeeded. If this action succeeds, the message
is considered delivered.
Files
$HOME/.maildelivery-
The file controlling local delivery.
/etc/mail/maildelivery-
Rather than the standard file.
mailbox/var/mail/$USER-
The default maildrop.
Examples
default mh-workersxx destroy result
# field pattern action result string
# lines starting with '#' are ignored, as are blank lines
#
# file mail with mmdf2 in the "To:" line into file mmdf2.log
To mmdf2 file A mmdf2.log
# Messages from mmdf pipe to the program err-message-archive
From mmdf pipe A /bin/err-message-archive
# Anything with the "Sender:" address "mh-workers"
# file in mh.log if not filed already
Sender mh-workers file ? mh.log
# "To:" unix; put in file unix-news
To Unix > A unix-news
# If the address is "jpo=mmdf" pipe into mmdf-redist
addr jpo=mmdf | A mmdf-redist
# If the address is "jpo=ack" send an acknowledgement copy back
addr jpo=ack | R /bin/resend -r (reply-to)
# Anything from steve destroy!
From steve destroy A -
# Anything not matched yet put into mailbox
default - > ? mailbox
# Always run rcvtty
* - | R /mh/lib/rcvtty
The file is always read completely so that several matches can be made
and several actions can be taken. The maildelivery file
must be owned either by the user or by root, and must be
writable only by the owner. If the maildelivery file cannot
be found or does not perform an action that delivers the message,
the file /etc/mail/maildelivery is read according to the
same rules. This file must be owned by root and must be
writable only by root. If this file cannot be found, or
does not perform an action that delivers the message, standard
delivery to the user's maildrop is performed.
References
slocal(1)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004