Loading ...
Sorry, an error occurred while loading the content.

RE: filter per domain not working

Expand Messages
  • Gary W. Smith
    ... little ... is ... Message ... Here is the actual email sent from mta04.mxtest.com to mta03.mxtest.com (we own mxtext.com, .net, org and use them internally
    Message 1 of 5 , Feb 29, 2008
    • 0 Attachment
      > > We have a script that processes email based upon domain. It's a
      little
      > > wacky in that it can only handle one domain at a time. The problem
      is
      > > that the script is receiving emails with multiple domains within the
      > > same email.
      >
      > Define "multiple domains" in this context. Envelope recipients?
      Message
      > headers? Example? Logs?

      Here is the actual email sent from mta04.mxtest.com to mta03.mxtest.com
      (we own mxtext.com, .net, org and use them internally for testing). It
      appears that mta4 is sending all three email addresses, two for one
      domain and one for the other, in a simple SMTP session call.

      This is what's being password to the filter.
      -f gary@... -- gary.smith@... gary@...
      gary@...

      <MSG>
      Return-Path: <gary@...>
      Received: from mta03.mxtest.com (unknown [10.80.71.4])
      by mta03.mxtest.com (Postfix) with ESMTP id 761FB6C102;
      Fri, 29 Feb 2008 22:00:52 -0800 (PST)
      Received: from mta04.mxtest.com (unknown [10.80.69.4])
      (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
      (No client certificate requested)
      by mta03.mxtest.com (Postfix) with ESMTP id 61FF96C0F7;
      Fri, 29 Feb 2008 22:00:52 -0800 (PST)
      Received: by mta04.mxtest.com (Postfix, from userid 124)
      id 3E15B11C179; Fri, 29 Feb 2008 22:00:52 -0800 (PST)
      Received: from localhost (unknown [10.80.72.103])
      by mta04.mxtest.com (Postfix) with ESMTP id F2AD011C16D;
      Fri, 29 Feb 2008 22:00:51 -0800 (PST)
      Received: from c-67-164-10-244.hsd1.ca.comcast.net
      (c-67-164-10-244.hsd1.ca.comcast.net [67.164.10.244]) by
      webmail.mxtest.com (Horde MIME library) with HTTP; Fri, 29 Feb
      2008
      22:00:51 -0800
      Message-ID: <20080229220051.ynmngnhbksswwc8k@...>
      Date: Fri, 29 Feb 2008 22:00:51 -0800
      From: gary@...
      To: gary@..., gary.smith@..., gary@...
      Subject: test 2202
      MIME-Version: 1.0
      Content-Type: text/plain;
      charset=ISO-8859-1;
      DelSp="Yes";
      format="flowed"
      Content-Disposition: inline
      Content-Transfer-Encoding: 7bit
      User-Agent: Internet Messaging Program (IMP) H3 (4.1.4)
      X-Virus-Scanned: ClamAV using ClamSMTP



      Gary -- mxtest.net

      ----------------------------------------------------------------
      This message was sent using IMP, the Internet Messaging Program.

      </MSG>

      The filter receives all 3 email addresses in a single call, regardless
      if we use filter:dummy or just filter.

      >
      > > My understanding is that if we do content_filter=filtername (instead
      > > of content_filter=filtername:dummy) that it will operate on a per
      email
      > > address or domain, at least this was my understanding about a year
      ago.
      >
      > This is correct. If no explicit nexthop is supplied, mail is grouped
      by
      > the domain (or email address) depending on the transport's destination
      > recipient limit (> 1 or = 1).
      >
      > --
      > Viktor.
      >
      > Disclaimer: off-list followups get on-list replies or get ignored.
      > Please do not ignore the "Reply-To" header.
      >
      > To unsubscribe from the postfix-users list, visit
      > http://www.postfix.org/lists.html or click the link below:
      > <mailto:majordomo@...?body=unsubscribe%20postfix-users>
      >
      > If my response solves your problem, the best way to thank me is to not
      > send an "it worked, thanks" follow-up. If you must respond, please put
      > "It worked, thanks" in the "Subject" so I can delete these quickly.
    • Victor Duchovni
      ... Reading the code more closely, it appears that content filters don t behave the way I thought. There is no practical difference between filter:dummy and
      Message 2 of 5 , Mar 1, 2008
      • 0 Attachment
        On Fri, Feb 29, 2008 at 11:04:51PM -0800, Gary W. Smith wrote:

        > > > We have a script that processes email based upon domain. It's a
        > little
        > > > wacky in that it can only handle one domain at a time. The problem
        > is
        > > > that the script is receiving emails with multiple domains within the
        > > > same email.
        > >
        > > Define "multiple domains" in this context. Envelope recipients?
        > Message
        > > headers? Example? Logs?
        >
        > Here is the actual email sent from mta04.mxtest.com to mta03.mxtest.com
        > (we own mxtext.com, .net, org and use them internally for testing). It
        > appears that mta4 is sending all three email addresses, two for one
        > domain and one for the other, in a simple SMTP session call.
        >
        > This is what's being password to the filter.
        > -f gary@... -- gary.smith@... gary@...
        > gary@...

        Reading the code more closely, it appears that content filters don't
        behave the way I thought. There is no practical difference between
        "filter:dummy" and "filter". When the nexthop is absent, it is set
        to $myhostname. So either way all recipients are routed to a single
        destination. You can either take all the recipients together or one at
        a time by setting the transport destination recipient limit to 1.

        Sorry about that. This is unlikely to change I think, too many people
        probably use just "filter" and get decent performance because all the
        recipients *are* sent together. If this were to be made possible it
        would need to be controlled by a boolean parameter that defaults to
        the current behaviour.

        --
        Viktor.

        Disclaimer: off-list followups get on-list replies or get ignored.
        Please do not ignore the "Reply-To" header.

        To unsubscribe from the postfix-users list, visit
        http://www.postfix.org/lists.html or click the link below:
        <mailto:majordomo@...?body=unsubscribe%20postfix-users>

        If my response solves your problem, the best way to thank me is to not
        send an "it worked, thanks" follow-up. If you must respond, please put
        "It worked, thanks" in the "Subject" so I can delete these quickly.
      • Gary W. Smith
        Viktor, I started with trying to go with the one recipient approach but then after considering the performance impacts of everything that s running in the
        Message 3 of 5 , Mar 1, 2008
        • 0 Attachment
          Re: filter per domain not working
          Viktor,
           
          I started with trying to go with the one recipient approach but then after considering the performance impacts of everything that's running in the filter, we decived just to rewrite the filter to handle multiple domains.  It's a good time to review all of that code anyway.
           
          So we are approach it as a bug that needs to be fixed on our side...  Which is probably the best approach for the long run.
           
          Gary
           
           

          From: owner-postfix-users@... on behalf of Victor Duchovni
          Sent: Sat 3/1/2008 7:49 PM
          To: Gary W. Smith
          Cc: postfix-users@...
          Subject: Re: filter per domain not working


          Reading the code more closely, it appears that content filters don't
          behave the way I thought. There is no practical difference between
          "filter:dummy" and "filter". When the nexthop is absent, it is set
          to $myhostname. So either way all recipients are routed to a single
          destination. You can either take all the recipients together or one at
          a time by setting the transport destination recipient limit to 1.

          Sorry about that. This is unlikely to change I think, too many people
          probably use just "filter" and get decent performance because all the
          recipients *are* sent together. If this were to be made possible it
          would need to be controlled by a boolean parameter that defaults to
          the current behaviour.

          --
                  Viktor.

          Disclaimer: off-list followups get on-list replies or get ignored.
          Please do not ignore the "Reply-To" header.

          To unsubscribe from the postfix-users list, visit
          http://www.postfix.org/lists.html or click the link below:
          <mailto:majordomo@...?body=unsubscribe%20postfix-users>

          If my response solves your problem, the best way to thank me is to not
          send an "it worked, thanks" follow-up. If you must respond, please put
          "It worked, thanks" in the "Subject" so I can delete these quickly.

        Your message has been successfully submitted and would be delivered to recipients shortly.