procmail

procmail rule to write to two folders


I have a procmail rule that looks for email sent to a specific address and saves it to a folder. The rule looks like this and works just fine.

:0:
* ^TOarchive@extraspecialbitter.com
/home/pablo/mail/archive

I'd like it to write to a second folder as well, but so far everything I've tried hasn't worked. A second rule for the same "TO" address is ignored, as is a second folder following the first, i.e.:

:0:
* ^TOarchive@extraspecialbitter.com
/home/pablo/mail/archive
/home/pablo/mail/new

I've also tried putting both folders on the same line with delimiters of space, comma and "|", but no joy. The first folder is always used, and the second ignored. Any ideas?


Solution

  • Maybe this would work (don't miss c to make carbon-copy).

    :0 c:
    * ^TOarchive@extraspecialbitter.com
    /home/pablo/mail/archive
    
    :0:
    * ^TOarchive@extraspecialbitter.com
    /home/pablo/mail/new
    

    Or (should work the same):

    :0
    * ^TOarchive@extraspecialbitter.com
    {
      :0 c:
      /home/pablo/mail/archive
    
      :0:
      /home/pablo/mail/new
    }