# Postfix - Clam-SMTP & SpamAssassin - endless loop



## Leander (Feb 10, 2015)

Hi,

I want my Postfix to scan all mail (excep outgoing) via

Clam-SMTP
Spamassassin
even local, since one of my virtual users could also be spammer. This far the Clam-SMTP scans work as expected for all mail going through Postfix. But as soon as I add the SpamAssassin relevant part my mail stucks in an endless loop - which eventually gets interrupted and deliverd as "Undelivered Mail Returned to Sender". I can't figure out what I'm doing wrong!?

Relevant part of main.cf:
	
	



```
### Global Content Filter
#
content_filter = clamsmtp:127.0.0.1:10025
```
Relevant part of master.cf:
	
	



```
# ClamSMTP anti virus filter (used by global content_filter)
clamsmtp  unix  -  -  n  -  -  smtp
  -o smtp_send_xforward_command=yes
  -o smtp_tls_security_level=none

# For injecting mail back into postfix from the filter
127.0.0.1:10026 inet  n  -  n  -  -  smtpd
  -o content_filter=
  -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
  -o smtpd_helo_restrictions=
  -o smtpd_client_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o smtpd_authorized_xforward_hosts=127.0.0.0/8
  -o content_filter=spamassassin

#--max-size=50M
spamassassin  unix  -  n  n  -  -  pipe
  flags=Rq user=spamd argv=/usr/local/bin/spamc --max-size=52428800 -u ${recipient} -f -e /usr/local/sbin/sendmail -oi -f ${sender} ${recipient}
```

Thanks

Best Regards


----------

