Score:0

How it works content_filter in Postfix using spamassassin and clamav ( filtering order )?

br flag

How it works content_filter in case where is used spamassassin and clamav ? Here is example for one content_filter: http://www.postfix.org/FILTER_README.html And I see that sendmail command cant use the same content_filter otherwise it would be a loop. But example if content_filter will be set up as spamassassin the how it possible that after filtering is finished will run next clamav filter ?

If someone know please show me step by step how works content_filter using standard configuration spamassassin and clamav ( spamassassin in master.cf as an additional option for smtp service and clamav in main.cf: scan:localhost:10025 ) Order filtering, where is content_filter blocked and replaced with the next one.

Score:1
za flag

In general, you have the following options.

  • You may set up the first content filter so it'll not inject data directly back into Postfix, but it will give it to second content filter. Then it can give it further, and only the last filter in the chain will inject mail back into Postfix.
  • Notice, you already are using a dedicated Postfix smtpd instance (see "Advanced filter: injecting mail back into Postfix" on the FILTER_README page), which has content_filter setting cleared. You might add an intermediate smtpd instance, which will receive data from first content filter and feed it into another. Notice Postfix will log each successfully delivered mail three times in this case.
  • Use a filtering manager, such as Amavis. It is the single thing that needs to be hooked into Postfix, and then it'll call Spamassassin and ClamAV by its own means. This is usual "generic" way to do things, there are tons of step-by-step howtos which do it this way, I am surprised you hadn't bump into it yourself.
  • Cease after-queue content_filter and employ before-queue milter processing. In my opinion it's much easier to deploy and maintain, system looks cleaner and more understandable. Connecting several milters is also very easy and covered in the manual. Filtering managers like Amavis also support hooking via milter interface. See http://www.postfix.org/MILTER_README.html .
br flag
Of course I am using amavis and milters. Amavis can be used also before query as you know ( amavis milter ). But I asked this question only for the theory itself. Soon I will write step by step how content_filter works in details ( for the case spamassassin/filter/sendmail + clamav/filter/clamsmtp )
Nikita Kipriyanov avatar
za flag
Then this question is offtopic here. Probably the best place to ask it is the `postfix-users` mailing list. SF is the place where concrete business problems are solved, not just for pure theoretical investigations. Sorry.
id flag
@Macsurf did you ever finish your howto doc on content_filters with postfix and amavis?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.