Martin List-Petersen writes:
Is there any environment variable available, which tells, what account
actually is beeing processed and there a possibility to include another
ruleset based on that ?
Consult the documentation for your mail server, for that information.
Found the solution: it's LOGNAME
However, here is a solution for anybody, who is using Postfix, Maildir,
userdb (my setup uses mysql for that), Courier-IMAP, Courier-POP3 and
Maildrop and doesn't want to have two tables with homedirs/maildirs (one for
postfix and one for courier-stuff), but instead of one for the whole thing.
Since postfix uses a constant value for the homedir, you're pretty bound to
having your homedir at "/home/vmail" or so. The user maildirs then are
"/domain.toplevel/user/" in my case. This could also be
"/domain.toplevel/user/Maildir/" but doesn't really matter, since the
homedir not is the "/domain.toplevel/user/" dir.
In "/home/vmail" you place a .mailfilter - file with the following content:
---------start snip----------
include "/home/vmail/.mailfilters/$LOGNAME"
---------stop snip----------
Please align the directory to your setup. I did choose .mailfilters/ to put
my include files in, they could be placed anywhere, that you want.
Small tip besides: you can also put some global rules in the the .mailfilter
file, which you want to apply to all users (blacklisting-stuff or what so
ever.)
in my example i put then a mailfilter-file in "/home/vmail/.mailfilters/",
which is named "user@domain.toplevel" and holds the user-specific rules.
For you guys, that use sqWebMail also, you can point MAILDIRFILTER in your
maildirfilterconfig file to /home/vmail/.mailfilters/user@domain.toplevel
and your users will actually also be able to edit their rules (*nice*)