[prev in list] [next in list] [prev in thread] [next in thread]
List: procmail
Subject: Associative arrays in procmail recipes?
From: Marco Fioretti <m.fioretti () inwind ! it>
Date: 2002-12-24 12:48:57
[Download RAW message or body]
Hello,
I know that there are several recipes, both in the archives of this
list and elsewhere, to do the following:
if (From _or_ To _or_ Sender == [*]-list-admin@somewhere.com)
then save message to folder $1 (where $1 is the part in square
brackets above)
This is *very* good because it spares from writing one recipe per
list. I want to do this, but...
Quite often I don't like the "official" list name. For example, I
would like to put messages from "list-post:
iscuss@openoffice.org into an OOO folder, or stuff from
anaconda-devel-list-admin@redhat.com into a "custom_redhat" folder.
In other words, I'd like a generic way to bind a generic string to an
unrelated one.
If this where Perl, I would build an associative array:
%FOLDER_NAMES = (
'discuss@openoffice.org', 'OOO',
'anaconda-devel-list-admin@redhat.com', 'custom_redhat',
.....
);
and change the "save message to folder" line above to:
save message to folder $FOLDER_NAMES{$1}
How do I do this in procmail? (Some days ago I *did* search with google
both in the archives and on the Internet, to no avail)
TIA, and of course Merry Christmas
Marco Fioretti
_______________________________________________
procmail mailing list
procmail@lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic