Re: Multiple content-filters in postfix

From: Magnus Bäck (no email)
Date: Sun Jun 26 2005 - 16:58:01 EDT

  • Next message: Victor Duchovni: "Re: [: Preventing "Your account is suspended" messages from getting to our users]"

    On Sunday, June 26, 2005 at 22:39 CEST,
         Salvador Ramirez <> wrote:

    > I am trying to setup a relay smtp server which filter the messages
    > with clamav and dspam (I dont want to use amavis for this).
    > Currently I have postfix configured for filtering messages with
    > ClamSTMP which uses clamav. In postfix-> I have setted a
    > content filter (which define the use of clamsmtp) like this:
    > content-filter = scan:

    Change to:

    content-filter = scan:[]:10025

    > receive_override_options = no_address_mappings
    > then in postfix-> I have done this:
    > scan unix - - n - 16 smtp
    > -o smtp_send_xforward_command=yes
    > and for injecting the message filtered back into postfix:
    > inet n - n - 16 smtpd
    > -o content_filter=
    > ...
    > ...
    > Now I wonder how could I add the filtering using dspam to my
    > postfix configuration. My first question is if it is possible to
    > set more than one content-filter in postfix?

    You can have any number of content filters. You will need one smtpd(8)
    listener for each content filter that reinjects via SMTP.

    > Without success I tried adding this configuration in
    > content-filter = scan1:
    > receive_override_options = no_address_mappings
    > content-filter = scan2:
    > receive_override_options = no_address_mappings

    No, that won't work.

    This is what you want (port numbers may vary):

    Postfix:25 -> ClamAV:10025 -> Postfix:10026 -> dspam:10000 -> Postfix:10027

    So, set up the first reinjection listener (the one after ClamAV) to use
    dspam as the content filter. The final listener (port 10027 in this
    example) will set content_filter to nothing.


    > However this logical configuration, when both activated I don't get
    > the message delivered successfully. I get this on the logs:
    > Jun 26 12:30:13 localhost postfix/smtp[22233]: 3D3246CC097:
    > to=<>, relay=[], delay=13,
    > status=bounced (host[] refused to talk to me: 503
    > 5.0.0 Need LHLO here.)

    Whatever is listening on that port expects LMTP delivery and not SMTP.
    Change your line to use lmtp(8) instead of smtp(8), or change
    your content filter to accept mail via SMTP.

    Magnus Bäck

  • Next message: Victor Duchovni: "Re: [: Preventing "Your account is suspended" messages from getting to our users]"

    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs

    Powered By FreeBSD   Powered By FreeBSD