Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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 in content_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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.