Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rewrite(6) [plan9 man page]

REWRITE(6)							   Games Manual 							REWRITE(6)

NAME
rewrite - mail rewrite rules SYNOPSIS
/mail/lib/rewrite DESCRIPTION
Mail(1) uses rewrite rules to convert mail destinations into commands used to dispose of the mail. Each line of the file is a rule. Blank lines and lines beginning with # are ignored. Each rewriting rule consists of (up to) 4 strings: pattern A regular expression in the style of regexp(6). The pattern is applied to mail destination addresses. The pattern match is case- insensitive and must match the entire address. type The type of rule; see below. arg1 An ed(1) style replacement string, with standing for the text matched by the nth parenthesized subpattern. arg2 Another ed(1) style replacement string. In each of these fields the substring s is replaced by the login id of the sender and the substring l is replaced by the name of the local machine. When delivering a message, mail starts with the first rule and continues down the list until a pattern matches the destination address. It then performs one of the following actions depending on the type of the rule: >> Append the mail to the file indicated by expanding arg1, provided that file appears to be a valid mailbox. | Pipe the mail through the command formed from concatenating the expanded arg1 and arg2. alias Replace the address by the address(es) specified by expanding arg1 and recur. translate Replace the address by the address(es) output by the command formed by expanding arg1 and recur. Mail expands the addresses recursively until each address has matched a >> or | rule or until the recursion depth indicates a rewriting loop (currently 32). If mail(1) is called with more than one address and several addresses match | rules and result in the same expanded arg1, the message is delivered to all those addresses by a single command, composed by concatenating the common expanded arg1 and each expanded arg2. This mail bundling is performed to reduce the number of times the same message is transmitted across a network. For example, with the following re- write rule ([^!]*.att.com)!(.*) | "/mail/lib/qmail 's' 'net!1'" "'2'" if user presotto runs the command % mail research.att.com!ken research.att.com!rob there will follow only one execution of the command /mail/lib/qmail presotto net!research.att.com ken rob Here /mail/lib/qmail is an rc(1) script used for locally queuing remote mail. In the event of an error, the disposition of the mail depends on the name of the command executing the rewrite. If the command is called mail and is run by $user, the command will print an error and deposit the message in /mail/box/$user/dead.letter. If the command is called rmail, usually because it was invoked to deliver mail arriving over the network, the message will be returned to the sender. The returned message will appear to have been sent by user postmaster. SEE ALSO
mail(1) REWRITE(6)

Check Out this Related Man Page

mail.local(1M)						  System Administration Commands					    mail.local(1M)

NAME
mail.local - store mail in a mailbox SYNOPSIS
/usr/lib/mail.local [-f sender] [-d] recipient DESCRIPTION
mail.local reads the standard input up to an end-of-file and appends it to each user's mail file (mailbox). This program is intended to be used by sendmail(1M) as a mail delivery agent for local mail. It is not a user interface agent. Messages are appended to the user's mail file in the /var/mail directory. The user must be a valid user name. Each delivered mail message in the mailbox is preceded by a "Unix From line" with the following format: From sender_address time_stamp The sender_address is extracted from the SMTP envelope address (the envelope address is specified with the -f option). A trailing blank line is also added to the end of each message. The mail files are locked with a .lock file while mail is appended. The mail files are created with mode 660, owner is set to recipient, and group is set to mail. If the ``biff'' service is returned by get- servbyname(3SOCKET), the biff server is notified of delivered mail. This program also computes the Content-Length: header which will be used by the mailbox reader to mark the message boundary. OPTIONS
The following options are supported: -f sender Specifies the "envelope from address" of the message. This flag is technically optional, but should be used. -d Specifies the recipient of the message. This flag is also optional and is supported here for backward compatibility. That is, mail.local recipient is the same as mail.local -d recipient. -l Turn on LMTP mode. -r from Specify the sender's name (for backward compatibility). -7 Do not advertise 8BITMIME support in LMTP mode. -b Return a permanent error instead of a temporary error if a mailbox exceeds quota. OPERANDS
The following operand is supported: recipient The recipient of the mail message. ENVIRONMENT VARIABLES
TZ Used to set the appropriate time zone on the timestamp. EXIT STATUS
The following exit values are returned: 0 Successful operation. >0 An error occurred. FILES
/tmp/local.XXXXXX temporary files /tmp/lochd.XXXXXX temporary files /var/mail/user_name user's mail file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsndmu | +-----------------------------+-----------------------------+ SEE ALSO
mail(1), comsat(1M), sendmail(1M), getservbyname(3SOCKET), attributes(5) SunOS 5.11 11 Apr 1997 mail.local(1M)
Man Page