On Wed, 15 Jan 1997, Willie Williams wrote:
Specificly, my problem lies in two areas. First, I know how to get the
recipe to copy the file so I retain the original in my inbox, but I
don't know how to get it to put the file anywhere other than in my
$MAILDIR. Second, is there a way to strip the headers, including the
subject so that the file created just contains the text in the body of
the message?
Here's an example:
:0
* ^From:.*somebody
* ^Subject:.*special_subject
{ # This begins a nested block of recipes.
:0c: # 'c' flag here makes a copy for delivery here, and
# sends a copy on to the next recipe.
$DEFAULT
:0b: # 'b' flag here delivers the body only.
$HOME/somedirectory/somefile
} # This is the end of the nested block.
Delivery to files in $MAILDIR is by default. To deliver to other files
or directories in your home directory, use the variable $HOME as in
the example above. $HOME is whatever your home-directory is and the
variable should be set in .procmailrc among the other variables there.
DEFAULT should also be there and it is your mailbox, probably
/var/spool/mail/airborne or /usr/spool/mail/airborne.
I would also like to know if there is a way for the recipe to check to
see if the file already exists, so it can remove that file before it
creates the new one.
There is a simple method for checking for duplicates of mail as it is
received. I don't know the method myself, so I'll have to refer you to
the manpage for procmailex for examples. The recipe to catch
duplicates should be placed before any delivering recipes.
david