Red Squirrel
[H]F Junkie
- Joined
- Nov 29, 2009
- Messages
- 9,211
I guess this technically would go in Linux forum but I figure people here may know how to do this and this section gets more traffic.
I'm rebuilding my home email server so I can retire the old physical box that is currently responsible for it as well as update the software. It's currently running on FC9 which is super old. Current setup is as follows:
- Postfix / Dovecot using Linux accounts, so one account per mailbox, I just name them email_[something] to distinguish them from other users.
- Fetch mail gets mail from online servers and then delivers them to the respective local mailboxes.
- Each home directory has a procmailrc file which has rules for each mailbox. I have various requirements for each mailbox, such as some don't get spam filtering, some do, some have email that actually activate an external app etc...
- To access mail I just use imap and Thunderbird
- Current mailbox system is mbox format.
For the new setup, it is using virtual users and Maildir format. I have that working.
However, I'm not sure how I go about setting up per mailbox rules. I don't think procmail supports this, I read that it can but it sounded like quite the hack, such as having a master recipe file that just has conditions for each mailbox. That seems too ugly.
I tried experimenting with the virtual_alias_maps file and tried the following as an entry:
But not sure if that is the right syntax, or if arguments are even supported. Basically this file would have an entry for each mailbox and it's respective procmail file. At least in theory, I'm not sure if there is a way to do this.
So TLDR: I want to be able to control on a per virtual mailbox basis what happens to emails, such as sending them through SA, then acting upon the result, such as putting it in another folder. Or perhaps sending the entire email through a 3rd party app. I want to be able to do this for each individual mailbox.
I'm also willing to write a program to do this, if there is nothing available. In fact that may be my fail safe, I'll just use procmail and pipe the mail through this custom program and then have it handle the rest. Though if there is actually something already available to do this that is not too complicated to setup then I rather do this.
I'm rebuilding my home email server so I can retire the old physical box that is currently responsible for it as well as update the software. It's currently running on FC9 which is super old. Current setup is as follows:
- Postfix / Dovecot using Linux accounts, so one account per mailbox, I just name them email_[something] to distinguish them from other users.
- Fetch mail gets mail from online servers and then delivers them to the respective local mailboxes.
- Each home directory has a procmailrc file which has rules for each mailbox. I have various requirements for each mailbox, such as some don't get spam filtering, some do, some have email that actually activate an external app etc...
- To access mail I just use imap and Thunderbird
- Current mailbox system is mbox format.
For the new setup, it is using virtual users and Maildir format. I have that working.
However, I'm not sure how I go about setting up per mailbox rules. I don't think procmail supports this, I read that it can but it sounded like quite the hack, such as having a master recipe file that just has conditions for each mailbox. That seems too ugly.
I tried experimenting with the virtual_alias_maps file and tried the following as an entry:
[email protected] procmail /localdata/mail/conf/procmailrules/test3_test.loc
But not sure if that is the right syntax, or if arguments are even supported. Basically this file would have an entry for each mailbox and it's respective procmail file. At least in theory, I'm not sure if there is a way to do this.
So TLDR: I want to be able to control on a per virtual mailbox basis what happens to emails, such as sending them through SA, then acting upon the result, such as putting it in another folder. Or perhaps sending the entire email through a 3rd party app. I want to be able to do this for each individual mailbox.
I'm also willing to write a program to do this, if there is nothing available. In fact that may be my fail safe, I'll just use procmail and pipe the mail through this custom program and then have it handle the rest. Though if there is actually something already available to do this that is not too complicated to setup then I rather do this.