I use postfix and procmail for mail and folder filtering. I have a main address and a bunch of alias addresses that go to it, then I sort the username to a folder that matches. For example I have the main address of '[email protected]" and a alias of "[email protected]" pointing to it, and I have a folder called 'customer1' under '[email protected]' and a script like the following in .procmailrc -
:0:
* ^(To|Cc).*[email protected]
.customer1/
and it works fine, but every time I add a alias I have to also add a line in .procmailrc to filter to it. Would there be a way I can create the alias, the folder, and have one procmail recipe that would grab the 'customer1' from the address and store the message in a folder by that same name? Even having procmail create the folder if it does not exist would be great too. Thanks!
Ok I found another question that was similar that solved this, Procmail to automatically make new folders to store emails from new senders
So the following code solved the quesiton -
I tested it and it worked wonderfully