procmail
[Top] [All Lists]

Re: Sorting several lists into a common folder -- with a nice pretty name (was Re: Recipe problem)

2004-08-27 03:09:08
Toen wij Bob George kietelden, kwam er dit uit:

it does seem to provide a
way to easily write one procmail rule that can sort a variety of lists
into folders with great flexibility.

It's easy to do that with 'just procmail'.

Suppose that MATCH can have values such as the ones jou mention:

 listname(_at_)yahoogroups(_dot_)com - for the 1st
 <mailto:listname-unsubscribe@ - for the 3rd

Create a variable match2folder:

  match2folder = "
${TAB}listname(_at_)yahoogroups(_dot_)com${TAB}<mailto:listname-unsubscribe(_at_)${TAB}folder1
${TAB}otherlist(_at_)yahoogroups(_dot_)com${TAB}<mailto:otherlist-unsubscribe(_at_)${TAB}folder2
"

  folder = "IN.list"
  :0
  *$ match2folder ?? ()${TAB}${MATCH}${TAB}.*\/[^${TAB}]+^
  { folder = $folder.$MATCH }

(untested)

Of course you can also first get the listname out of MATCH, convert it if 
necessary, and then use it. That simplifies the match2folder definition. 

I have a folder 'IN.list.tech' in which I deliver messages of technical 
lists that I didn't give a specific folder.
And an 'IN.list' that gets als list messages that are not redirected yet.

-- 
Grtz, Ruud

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>