ispCP - Board - Support
per user server side filtering for virtual users - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: per user server side filtering for virtual users (/thread-3024.html)



per user server side filtering for virtual users - MrRagga - 04-13-2008 12:31 PM

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


RE: per user server side filtering for virtual users - joximu - 04-13-2008 05:53 PM

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


RE: per user server side filtering for virtual users - MrRagga - 04-13-2008 10:57 PM

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


RE: per user server side filtering for virtual users - joximu - 04-14-2008 02:37 AM

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

http://web.archive.org/web/20070629164310/http://www.isp-control.net/forum/procmail-bzw-procmailrc-verwenden-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?


RE: per user server side filtering for virtual users - MrRagga - 06-01-2008 11:44 AM

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/howto/mail/setup_procmail

Thanks.

Cheers Jonas