LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2006, 12:13 PM   #1
carlmarshall
Member
 
Registered: Jan 2004
Location: North Yorkshire, UK
Distribution: Centos 5
Posts: 133

Rep: Reputation: 16
Postfix Clamsmtpd and Spamassassin


Can anyone help with getting Postfix, Clamsmtpd and Spamassassin to work together WITHOUT using Amavisd?

I have Postfix and Clamsmtpd running just fine and I like the low overheads of Clamsmtpd as compared to using Amavisd. I can also get Postfix and Spamassassin to work fine too. I just can't get them to work together! I get mail loops.

If I use more than one filter, then the mail is reinjected as I expect, but then the whole loop occurs once more.

In main.cf (working with only Clamsmtpd)I have the following:


content_filter = scan:127.0.0.1:10025
receive_override_options = no_address_mappings


and in master.cf I have:


# AV scan filter (used by content_filter)
scan unix - - n - 16 smtp
-o smtp_send_xforward_command=yes
# For injecting mail back into postfix from the filter
127.0.0.1:10026 inet n - n - 16 smtpd
-o smtpd_authorized_xforward_hosts=127.0.0.0/8
-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 mynetworks_style=host
-o content_filter=


In order to get Spamassassin working too, I added the following to master.cf:

smtp inet n - n - - smtpd
-o content_filter=spamf
spamf unix - n n - - pipe
user=nobody argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}

but this just causes a mail loop. Anyone see where I've gone wrong? (and preferably suggest the correct answer too!)

Thanks

Carl.

Last edited by carlmarshall; 01-25-2006 at 04:16 AM.
 
Old 01-31-2007, 05:51 AM   #2
numira
LQ Newbie
 
Registered: Jan 2007
Location: Czech republic
Distribution: Mandriva
Posts: 2

Rep: Reputation: 0
Solution ...

Hi,

I was in the same situation and I discovered solution for me ...

I have in master.cf these records:

---cut---
smtp inet n - n - - smtpd

# AV clamsmtp - clamav scan filter (used by content_filter)
scan unix - - n - 16 smtp
-o smtp_send_xforward_command=yes
-o smtp_enforce_tls=no

# For injecting mail back into postfix from the filter
127.0.0.1:10026 inet n - n - 16 smtpd
-o content_filter=spamchk:dummy
-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 mynetworks_style=host
-o smtpd_authorized_xforward_hosts=127.0.0.0/8
# end of AV scan filter clamav

### start of SA
spamchk unix - n n - 10 pipe
flags=Rq user=filter argv=/usr/local/bin/spamchk -f ${sender} -- ${recipient}
### end of SA

### modified for SA using
pickup fifo n - n 60 1 pickup
-o content_filter=
### end modified for SA using
---cut---

And this record in main.cf
---cut---
# clamsmtp AV filter
content_filter = scan:[127.0.0.1]:10025
---cut---

So, I was in the same situation with mail loops until I changed default pickup record. In original master.cf is this record writed without "-o content_filter=", and it seems to be source of troubles with mail loops with Spamassassin.

After I changed "pickup" record to this form, mails from internet are deliered to clam-smtpd and after checking are these mails transfered to SA by content_filter "spamchk:dummy" and in next step are correctly delivered back to the postfix.

Script "spamchk" is modified script from this site:

http://www.akadia.com/services/postf...massassin.html

So, I hope, it will help you ...
Numira
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up SpamAssassin with POSTFIX wfernley Linux - Software 1 11-29-2005 08:51 AM
Postfix Dovecot Spamassassin php4u Fedora 1 04-09-2005 03:48 AM
Postfix + SpamAssassin + Hivemail = ? technician Linux - Software 1 10-16-2004 02:58 PM
Postfix and Spamassassin Phaethar Linux - Networking 0 10-30-2003 09:30 AM
Postfix/Spamassassin on firewall Pcghost Linux - Software 0 04-10-2003 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration