HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   adding Server side mail filters to Virtual Users And Domains With Postfix 7.10 (http://www.howtoforge.com/forums/showthread.php?t=19728)

c0mputernick 23rd January 2008 15:58

adding Server side mail filters to Virtual Users And Domains With Postfix 7.10
 
Has anyone added server side mail filters to their "Virtual Users And Domains With Postfix, Courier And MySQL Ubuntu 7.10" setup?

I would like to, but am unsure what to change in postfix/maildrop to be able to add this functionality. Can anyone assist me with this? Ive found some related gentoo material creating the file: /home/vmail/.mailfilter with this inside:
"
xfilter "/usr/bin/spamc"
# Check for user defined filter file
exception {
include "$HOME/mailfilters/$LOGNAME"
}
"
and then creating this file that holds the filters for this particular user:
/home/vmail/mailfilters/virtuser@somedomain.com

But i need to know how to change postfix to hand the mail off to maildrop instead of its normal delivery.

Any help would be much appreciated.

falko 24th January 2008 14:59

Why don't you use amavisd as shown in the tutorial?

c0mputernick 24th January 2008 18:37

i am. Im not talking about spam/virus filtering. Im talking about sorting mail, or server side mail filters. Where i can put mail as it comes into the server into its respective folder, normally via maildrop.
Unless i missed something (and ive done the setup at least 10 times by now) i didnt see an option (or even know that amavisd does mail sorting) to do mail sorting.
If i missed something please point it out, i have read and reread the entire setup from start to finish several times and must be missing what your referring to.

Thanks for the help.

falko 25th January 2008 17:02

These links might help you: http://www.howtoforge.com/postfix_mailfilter
http://www.howtoforge.com/autorespon..._postfix_users

c0mputernick 25th January 2008 17:11

Thats exactly what i was looking for! Thanks for the links!

c0mputernick 25th January 2008 17:26

I wonder if there is a way to link or add links to the end of a particular how-to so other users can find them easier?
Like "Add-ons for Postfix Guide 7.10" or something similar.

falko 26th January 2008 19:06

I'm already adding links to related tutorials at the end of the tutorials. Do you mean that users should be able to add links themselves?

c0mputernick 6th February 2008 22:40

Quote:

Originally Posted by falko

I followed all the instructions perfectly, double checked them, but im getting an error in my syslog and mail is getting bounced before i even send a test for the filter:

postfix/pipe[25281]: 9F6B874D750: to=<nick@mydomain.com>, relay=maildrop, delay=20738, delays=20738/0.03/0/0.04, dsn=5.1.1, status=bounced (user unknown. Command output: Invalid user specified. )

The user is correct, it should be vmail as in the guide with uid/gid of 5000

I think it has something to do with the line changed in master.cf for maildrop:

maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/maildrop/bin/maildrop -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}

I am using the falko guide for ubuntu 7.10 and i did have to change the path names in the filter part from:
/u0/vmail/.mailfilter/user@domain.com
to:
/home/vmail/.mailfilter/nick@mydomain.com
because that is where the mail and filters are held.

I start getting those errors as soon as i add this section:
VALUES ( 'mydomain.com', 'maildrop' ); in the transport table.

Ive checked for type-o's and their dont seem to be any, which is why i think its something to do with the line in master.cf (mainly because i dont understand all the ${} stuff, it could be right, but i wouldnt know it. Do you have to change it at all for ubuntu 7.10?

I hope im not the only one that has ran into this and im crossing my fingers its a simple fix, it seems im almost there (if the filters actually work after this)


Also, you said in the how-to that you could filter mail on a per users basis instead of the entire domain. "(important to note you can do this on a purely per email basis ie, all emails but users@example.com go to the normal virtual transport and by adding in the email address and a maildrop transport)"
How is this done? instead of adding "mydomain.com, maildrop" would you add "user@mydomain.com, maildrop" instead in the transport table?

Thanks for any and all help.


All times are GMT +2. The time now is 04:22.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.