<<< Date Index >>>     <<< Thread Index >>>

Re: Keeping two copies of sent messages



On Mon, Sep 01, 2008 at 02:18:06PM +1000, Cameron Simpson wrote:
> Procmail can make several filing decisions easily, but not based on ad hoc
> inspection of the message (i.e. you can write procmail rules based on known
> recipients, but not a general purpose one that "computes" the save folder
> from the headers).
> 

Sure you can. If you use \/ in a regular expression then procmail will put 
everything that matches the regex after the \/ in $MATCH, which you can then 
use in a delivery line. Not saying the OP should use this method, but procmail 
is definitely capable of performing this task.

Something like this would work (untested and you probably want to extend it 
quite a bit, but you get the idea):

:0
* ^To:\s*\/.*$
saved-mail/$MATCH/

Also, when debugging recipes like these it can be very handy to put procmail 
in verbose mode to see what it puts in $MATCH.


Regards,

Vincent van Leeuwen
Media Design - http://www.mediadesign.nl/