Auto inclusion of recipe in headeras

Professional Software Engineering PSE-L at
Wed Nov 28 20:23:20 CET 2007

At 12:21 2007-11-28 -0600, reader at wrote:
>Its supposed to allow me to quickly see what filter captured what
>string, but I want this to happen automatically.

Yea, let me know how that turns out for you.  Logfiles work pretty well for 
this, and you can always prefix your individual recipes with setting a 
recipe name:

* whatever conditions
| formail -A "X-HPmatch: ${MATCH}" -A "X-Rule: ${RULE}" > somemailbox.mbx

I don't put in match info, but pretty much all the mail I send along to my 
mailbox is tagged with a mailbox name, so my MUA can deposit individual 
messages into the appropriate folders at its end without having to 
reproduce any filtering logic (other than looking for the mailbox name in 
the headers).  This is done separate from my archived-to-specific mailbox 
stuff though - what I archive doesn't have the added header, and the copy I 
deposit into the system mailbox (for retrieval by my workstation) has the 
inserted mailbox identifier.

If it were truly automatable, that'd be great, but I don't see how you'd 
accomplish that.  TRAP could conceivably be used, but that'd get ugly fast.

>I find myself adjusting the filter but then forgetting to hand edit
>the formail run that includes it in the header.

Conversely, automating a process can allow you to automatically screw 
things up...

  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.

More information about the procmail mailing list