Re: Multiple content-filters in postfix

From: Salvador Ramirez (no email)
Date: Sun Jun 26 2005 - 18:01:06 EDT

  • Next message: Ralf Hildebrandt: "Re: Multiple content-filters in postfix"

    Magnus Bäck wrote:
    > 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->main.cf I have setted a
    >>content filter (which define the use of clamsmtp) like this:
    >>
    >>content-filter = scan:127.0.0.1:10025
    >
    > Change to:
    >
    > content-filter = scan:[127.0.0.1]:10025
    >
    >>receive_override_options = no_address_mappings
    >>
    >>then in postfix->master.cf I have done this:
    >>
    >>scan unix - - n - 16 smtp
    >> -o smtp_send_xforward_command=yes
    >>
    >>and for injecting the message filtered back into postfix:
    >>
    >>127.0.0.1:10026 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 main.cf:
    >>
    >>content-filter = scan1:127.0.0.1:10025
    >>receive_override_options = no_address_mappings
    >>content-filter = scan2:127.0.0.1:10000
    >>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.

    OK, I did this in this way:

    scan1 unix - - n - 16 smtp
             -o smtp_send_xforward_command=yes
    127.0.0.1:10026 inet n - n - 16 smtpd
             -o content_filter=scan2
             ...

    scan2 unix - - n - 16 lmtp
             -o smtp_send_xforward_command=yes

    # Para meter el email de vuelta a Postfix luego del filtro dspam
    127.0.0.1:10001 inet n - n - 16 smtpd
             -o content_filter=

    and in main.cf I just use have now:

    content_filter = scan1:[127.0.0.1]:10025
    receive_override_options = no_address_mappings

    So scan1 on the reinjecting would call scan2. But now I get the
    following message error on the logs:

    Jun 26 13:55:58 localhost postfix/lmtp[23071]: 1FAF66CC098:
    to=<>, relay=none, delay=0, status=bounced (Host or domain
    name not found. Name service error for name=avas.uchile.cl type=A: Host
    not found)

    I don't have this problem if I don't use "-o content-filter=scan2" on
    the first reinjecting. Well, it is true that I don't have a DNS entry
    for this test server on my DNS but I don't understand why this would be
    needed in this configuration and not before.

    Any idea?

    thanks

    > [...]
    >
    >
    >> 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=127.0.0.1[127.0.0.1], delay=13,
    >>status=bounced (host 127.0.0.1[127.0.0.1] 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 master.cf line to use lmtp(8) instead of smtp(8), or change
    > your content filter to accept mail via SMTP.
    >


  • Next message: Ralf Hildebrandt: "Re: Multiple content-filters in postfix"





    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs



    Powered By FreeBSD   Powered By FreeBSD