Post Reply  Post Thread 
per user server side filtering for virtual users
Author Message
MrRagga



Posts: 4
Group: Registered
Joined: Apr 2008
Status: Offline
Reputation: 0
Post: #1
per user server side filtering for virtual users

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

04-13-2008 12:31 PM
Find all posts by this user Quote this message in a reply
joximu
Moderator
*****


Posts: 3,534
Group: Moderators
Joined: Jan 2007
Status: Offline
Reputation: 47
Post: #2
RE: per user server side filtering for virtual users

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


2008-03-16 ispCP RC4 released!!!
04-13-2008 05:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
MrRagga



Posts: 4
Group: Registered
Joined: Apr 2008
Status: Offline
Reputation: 0
Post: #3
RE: per user server side filtering for virtual users

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

This post was last modified: 04-13-2008 11:24 PM by MrRagga.

04-13-2008 10:57 PM
Find all posts by this user Quote this message in a reply
joximu
Moderator
*****


Posts: 3,534
Group: Moderators
Joined: Jan 2007
Status: Offline
Reputation: 47
Post: #4
RE: per user server side filtering for virtual users

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?


2008-03-16 ispCP RC4 released!!!
04-14-2008 02:37 AM
Visit this user's website Find all posts by this user Quote this message in a reply
MrRagga



Posts: 4
Group: Registered
Joined: Apr 2008
Status: Offline
Reputation: 0
Post: #5
RE: per user server side filtering for virtual users

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

06-01-2008 11:44 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump:

| All rights reserved : isp-control.net |