Procmail help?

Scott Abbey scott at wangfu.org
Sat Jun 16 22:48:28 UTC 2007


On Saturday 16 June 2007 13:34:27 Scott Lockwood wrote:
> I'd like to pair down my .procmailrc some, so I tried to make a rule for
> list traffic based on the List-Id header, rather than having to have one
> for the To header, and one for the Cc header. This doesn't seem to work,
> however. Anyone have a rule already they care share that works on the
> List-Id line in the header?
>
> --
> Regards,
> Scott

Procmail's TO_ macro will parse both the To and Cc headers. In other words:

 :0					# If using mbox, change to ':0:'
 * ^TO_ubuntu-users at lists.ubuntu.com
 DestinationFolder			# Change to your desired destination

Note that '^TO_' is in all uppercase. It must be typed exactly as it appears 
here. This will sort all mails from the Ubuntu Users list (whether it was 
CC'd or the only recipient) into DestinationFolder.

'^TO_' is a predefined macro in Procmail that will parse any destination 
header (To:, CC:, etc.) for the defined string.

If you have your heart set on sorting by List-Id, try the following:

 :0					# If using mbox, change to ':0:'
 * ^List-Id.*ubuntu-users at lists.ubuntu.com
 DestinationFolder			# Change to your desired destination

That should sort this list into DestinationFolder.

Regards,
Scott (heh. Same sig :) )




More information about the ubuntu-users mailing list