procmail
[Top] [All Lists]

Re: Comments on this way to use procmail with virtual domains

2007-06-02 00:58:26
On 1-Jun-2007, at 05:17, Marco Fioretti wrote:
me(_at_)virtualdomain1(_dot_)net   : "|/absolute/path/to/procmail -m 
/somedir/ 
me.virtualdomain1.net.procmailrc"
joe(_at_)virtualdomain2(_dot_)com  : "|/absolute/path/to/procmail -m 
/somedir/ 
joe.virtualdomain2.com.procmailrc"
jane(_at_)virtualdomain1(_dot_)net : "|/absolute/path/to/procmail -m 
/somedir/ 
jane.virtualdomain1.net.procmailrc"

What do you think? Is it safe,robust, are there any weird
cases (one message going to more than one user?) where
it wouldn't work?

It would work, it's just a PAIN.  Mostly building that  
virtual_alias_map which somehow you have to keep current so when a  
new sql user is added, the map is updated and postmaped

You can use multiple maps though, but once something matches, postfix  
stops checking.  For example, I use 3 myself:

virtual_alias_maps =
     hash:/usr/local/etc/postfix/virtual,        # regular local users
     pcre:/usr/local/etc/postfix/virtual.pcre,   # a custom pcre to  
make '_' a delimiter
     # virtual postfixadmin users
     mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf

virtual.pcre:
/^(.*)_(.*)@kreme.com$/    ${1}+${2}(_at_)kreme(_dot_)com

I suppose you could setup a cron job to create the virtual table  
based on the mysql data, but it would be better if you could query  
the mysql via virtual_alias_maps and then 'build' the procmail alias  
from that.

Certainly worth looking into.  It would allow me to convert all my  
local users to virtual users, and that would be a very good thing.

-- 
"If this is the best God can do, I'm not impressed."



____________________________________________________________
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