[SOLVED] Postfix mail filter
I have a Debian server with Postfix and would like to know if it's possible to create some "manual" filters, move/reject mails if the body contains something, if the header does and if it's sent to a specific person etc? Maybe coupling it with mysql
|
Quote:
http://spamassassin.apache.org/ Configs for it are in plain text, so it should be easy to put in whatever rule(s) you're looking for, and disable the ones you don't want. |
I can see that this might fit my needs
http://svn.apache.org/repos/asf/spam...3.3/sql/README Do you know how to enable spamassassin for Postfix and to check if it's working properly? |
Quote:
http://www.postfix.org/docs.html http://www.akadia.com/services/postf...massassin.html |
Thanks. I've configured Spamassassin now (without MySQL for now), but I'm facing some issues which restricts me from sending and receiving mails:
Code:
Oct 5 10:15:39 *** postfix/smtpd[20357]: fatal: open database /etc/postfix/access_client.db: No such file or directory http://www.debuntu.org/postfix-and-p...filter-spam-p2 |
Solved!
I had this in my main.cf Code:
smtpd_recipient_restrictions = |
It looks like it doesn't look up for the right account, and just uses spamd system user?
Code:
Oct 5 11:45:50.601 [21443] dbg: config: Conf::SQL: executing SQL: select preference, value from userpref where username = 'spamd' or username = '@GLOBAL' order by username asc to start spamd i use Code:
-q -x -u spamd -D -- That's for sure the problem! It works when I use @GLOBAL or spamd as account, how do I combine these rules with virtual SQL users? Maybe user should be ${recipient} in postfix? My conclusion: No! Code:
postfix 21541 20259 0 11:58 ? 00:00:00 pipe -n spamassassin -t unix user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} |
I've read that I should use a custom query for my purpose in /etc/spamassassin/local.cf, so I used this one as the documentation said, but without any luck:
Code:
user_scores_sql_custom_query SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = '@GLOBAL' ORDER BY username ASC |
Got it !
http://serversupportforum.de/forum/m...elle-user.html In /etc/postfix/master.cf argv=/usr/bin/spamc -u ${recipient} It's important to have -u ${recipient} Thanks for the links to get started, TB0ne. Hope someone some day can use my thoughts here. |
Quote:
|
All times are GMT -5. The time now is 07:03 AM. |