I've configured postfix with spamassassin. master.conf is as following.
spamfilter unix - n n - - pipe
flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter -f ${sender} -- ${recipient}
smtp inet n - n - 20 smtpd
-o content_filter=spamfilter:dummy
above configuration is working fine.
I want to add spampd proxy after spamfilter. I've tried the following but it does not work.
spamfilter unix - n n - - pipe
flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter -f ${sender} -- ${recipient}
125 inet n - y - - smtpd
-o content_filter=spamfilter:dummy
-o content_filter=smtp:192.168.0.51:10025
127.0.0.1:10026 inet n - n - 10 smtpd
-o content_filter=
I need to use spampd proxy to connect other mta for users authentication. So therefore i want to filter and discard spam before sending request/data to spampd. Can anybody help me in this regard. If there is any option to discard spam before delivering it to final destination in SpamPD that is also suitable for my scenario.
In Postfix there are two ways to insert a content-filter: before and after queuing.
If you want your e-mails stored in the queue and then after that send it to the filter (postqueing), you have to use the option
content_filter
. Here you have to format your filter address in the way that is also used in transport tables:transport:nexthop
where transport is smtp and nexthop your address where spampd is listening. Be aware that if your nexthop is an IP address then you have to enclose it with square brackets. So in your case:-o content_filter=smtp:[192.168.0.51]:10025
If you want your e-mails filtered before Postfix stores it in its queue (prequeing) then you have to use the
smtpd_proxy_filter
option. The format of the address in this case is different then the one incontent_filter
. In this case you can simply forget about the square brackets and the transport-method:-o smtpd_proxy_filter=192.169.0.51:10025