From http://www.gsp.com/cgi-bin/man.cgi?section=5&topic=procmailrc
If the regular expression contains ^TO_ it will be substituted by (^((Original-)?(Resent-)?(To |Cc |Bcc) |(X-Envelope |Apparently(-Resent)?)-To) :(.*[^-a-zA-Z0-9_.])?), which should catch all destination specifications containing a specific address.
If the regular expression contains ^TO it will be substituted by (^((Original-)?(Resent-)?(To |Cc |Bcc) |(X-Envelope |Apparently(-Resent)?)-To) :(.*[^a-zA-Z])?), which should catch all destination specifications containing a specific word.
This example shamelessly taken from http://perkypants.org/dotfiles/procmailrc
:0:
- ^TO_.*(jdub|jeff|president)@slug.
SLUG/personal
Make sense?
Yes, that makes sense. The filtering on the 'To' or 'TO' fields is working great. Of course that leaves out emails that are not sent directly to my address...like kclug.
It seems that there are some header changes between emails that I collect using Thunderbird (pop3 style) and emails that I collect from the same server using fetchmail. For example.
The same email sent to the kclug. When I pop it from the server directly, I see:
To: KCLUGkclug@kclug.org Envelope-To: linux@bizniche.com
That makes for easy filtering...either by the kclug addy, or by the Envelope-To address, which would be more comprehensive it seems.
When I use fetchmail to get the same message, I see: To: KCLUGkclug@kclug.org Envelope-To: mdg@localhost
So, when that 'Envelope-To' changes, I lose any idea (from the headers) as to what address it was fetched from. There is no more record of linux@bizniche.com anywhere.
It seems that I should be doing something with X-Envelope-To, and your message above mentions that as well. But I don't see it anywhere.
See what I mean?
Matt
On Fri, October 15, 2004 10:38 am, linux@bizniche.com said:
To: KCLUGkclug@kclug.org Envelope-To: linux@bizniche.com
That makes for easy filtering...either by the kclug addy, or by the Envelope-To address, which would be more comprehensive it seems.
When I use fetchmail to get the same message, I see: To: KCLUGkclug@kclug.org Envelope-To: mdg@localhost
So, when that 'Envelope-To' changes, I lose any idea (from the headers) as to what address it was fetched from. There is no more record of linux@bizniche.com anywhere.
Here's a question: for a mailing list, do you care what mailbox/address it came in as? Consider the following procmailrc snippet:
# Used by the perl6-all list to break out into seperate mailboxes :0: * ^X-Mailing-List-Name: /[^@]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
# Majordomo uses Sender header to tell when it is coming from :0: * ^Sender: owner-/[^@]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
:0: * ^X-BeenThere: /[^@]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
:0: * ^Delivered-To: mailing list /[^@]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
:0: * ^X-Mailing-List: </[^@]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
:0: * ^X-Loop: /[^@]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
:0: * ^X-List-ID: </[^@.]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
:0: * ^X-list: /[^@.]+ lists/`echo $MATCH | sed -e 's/[/]/_/g'`
This procmailrc tries to identify mailing lists (mailman, Yahoo groups, etc) by using various headers that they use. You can subscribe to new lists, and it would automatically create the new folder for you.
For your multi-mailbox setup you could have a structure something like:
INBOX INBOX.mailacct1 INBOX.mailacct1.somefolder INBOX.mailacct2 INBOX.mailacct2.somefolder INBOX.mailacct3 INBOX.mailacct3.somefolder INBOX.lists INBOX.lists.kclug
Is this something of what you're looking for?
Jeremy