deliver(1) | Mail Avenger 0.8.5 | deliver(1) |
deliver - deliver mail to a mailbox or maildir spool
deliver [--umask[=val]] destination1 [destination2 ...]
Takes a mail message on standard input, and delivers it to one or more destination mailboxes. If a destination ends with a "/" character, it is interpreted as a qmail maildir format directory (which will be created if it doesn't already exist). Otherwise, if the destination does not end with a "/" character, it is interpreted as a Unix mbox format file.
If one of the mailboxes is specified as -, deliver will send a copy of the message to its standard output after generating the appropriate "From " and "Return-Path:" lines, if necessary. This is useful when piping messages to programs from avenger.local(8) scripts, as avenger.local does not generate any "From " or "Return-Path: " lines, while deliver will generate these based on the SENDER environment variable.
if test YES = "`formail -cxz X-Spam-Status:`"; then deliver $HOME/Mail/spam/ else deliver $HOME/Mail/ham/ fi
The --norewind inhibits that behavior, so that the above script would likely give unintended results. --norewind is useful for testing scripts that aren't supposed to assume they are getting input from a file.
The following environment variable affects deliver's operation.
Using avenger.local, to set up an address as a spam trap that reports any messages it receives as spam, you might place the following in the appropriate .avenger/local file:
| deliver - | spamassassin -r
If you want to reject spam messages during SMTP transactions using spamassassin, but still want to keep a copy of the spams in $HOME/Mail/spam-log to keep an eye on how spamassassin is doing, you might place the line "bodytest $HOME/.avenger/spam-check", and write the spam-check shell script as follows:
#!/bin/sh edinplace -x 111 spamassassin -e 100 case "$?" in 0) ;; 100) echo Sorry, spamassassin has flagged this message as spam deliver $HOME/Mail/spam-log exit 100 ;; 111) echo Sorry, spamassassin has encountered a temporary error exit 111 ;; *) echo Sorry, spamassassin exited witn an unknown status exit 111 ;; esac
Note here that the bodytest script does not need to pipe the message through "deliver -" before spamassassin, because bodytest's standard input does contain "From " and "Return-Path:" lines, even though avenger.local command input does not.
avenger(1), dotlock(1), mailexec(1), avenger.local(8)
The Mail Avenger home page: <http://www.mailavenger.org/>.
When delivering to multiple destinations, if one of them fails, deliver will halt with a non-zero exit status. However, it is not possible to know which destination caused the delivery failure.
To protect against concurrent accesses to mbox format files, deliver uses both flock and dotfiles to lock mailboxes. However, it does not use fcntl/lockf-style locking by default. Thus, if your mail reader exclusively uses fcntl for locking, there will be race conditions unless you specify the --fcntl option.
David Mazieres
2018-10-09 | Mail Avenger 0.8.5 |