ispCP - Board - Support - VHCS fork

Full Version: per user server side filtering for virtual users
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I am wondering how to set up per user server side filtering as easy as possible. As far as i understand I can only use a procmailrc for local users, since virtual_transport is set to virtual. The server side filtering should be possible for every email account, so that i can filter every message to the appropriate maildir folder.
So what is the easiest solution to enable this? It doesn't matter if i use maildrop, procmail or whatever. I am just interested in that kind of solution without modifying too much.

Cheers Jonas
there's a post about doing this with procmail - but well, the forum is broken, so you won't find it...

Basically it this in the master.cf:
Code:
procmail  unix  -       n       n       -       -       pipe
    flags=DRhu user=vmail argv=/usr/bin/procmail HOME=/var/mail
    DEFAULT=/var/mail/virtual/${nexthop}/${user}/

then you can put a .procmailrc in every mail account

/var/mail/virtual/domain/user/.procmailrc

Give it a try...

/J
Hi,
filtering does not work. Do I need to change the main.cf too? Do you have an example of a working procmailrc?

Cheers Jonas
Yeah - I just found the original thread in archive.org

http://web.archive.org/web/2007062916431...t-676.html

at least the first 10 posts...

You also need the following in main.cf:

Code:
virtual_transport = procmail
procmail_destination_recipient_limit = 1

(replace the actual virtual_transport...)

and a .procmailrc example, well some fragments and trials - I'll post the complete fragments...

Code:
# MAILDIR=$HOME/Maildir/
# DEFAULT=$MAILDIR
#VERBOSE=on
LOGFILE=$HOME/procmail.log

#LOGFILE="/var/log/procmail.log"
VERBOSE=yes

# MAILDIR=$DEFAULT
# FORMAIL=/usr/bin/formail
# SENDMAIL=/usr/sbin/sendmail

:0:
* ^X-Spam-Flag: YES
$DEFAULT.Spam/

This one just does some logging into /var/mail/procmail.log

-> HOME is HOME of user vmail...

You have to try with several variables $DEFAULT and others to get the MAILDIR root...

Would you mind trying this out and writing a howto which can be placed into the howto on this site?
joximu Wrote:Would you mind trying this out and writing a howto which can be placed into the howto on this site?

Done.

http://www.isp-control.net/documentation...p_procmail

Thanks.

Cheers Jonas
Reference URL's