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

header_checks or maildrop?

Expand Messages
  • Crayon
    Hi I m new to postfix (having used qmail for several years). In my old setup I had maildrop rules that are run on addresses which I use to receive mailing
    Message 1 of 4 , Jan 1, 2007
    • 0 Attachment
      Hi

      I'm new to postfix (having used qmail for several years). In my old setup
      I had maildrop rules that are run on addresses which I use to receive
      mailing lists. So for example, for an address that is used solely for
      receiving this list, the maildrop rules would check for the presence of
      these headers:

      Sender: owner-postfix-users@...
      Precedence: bulk
      List-Post: <mailto:postfix-users@...>
      List-Help: <http://www.postfix.org/lists.html>
      List-Unsubscribe: <mailto:majordomo@...>
      List-Subscribe: <mailto:majordomo@...>

      If the check fails the mail is unlikely to have come from the list and is
      most likely spam (or a direct reply from someone on the list - which I
      don't want) and gets rejected.

      What I would like to know is, can something similar be implemented using
      postfix's header_checks? My reading of the docs suggests it can't be done
      because postfix only processes a single header at a time and makes a
      decision per header.

      Another thing is I would like to reject mails don't have a "Subject:"
      header (or it is empty). Again, because of the way the header_checks are
      done I don't think I can check for the absence of a particular header?

      --
      Crayon
    • Noel Jones
      ... header_checks doesn t keep state between lines, so it can t check for multiple conditions as your example above. Maildrop/procmail/SpamAssassin or similar
      Message 2 of 4 , Jan 1, 2007
      • 0 Attachment
        At 10:52 AM 1/1/2007, Crayon wrote:
        >Hi
        >
        >I'm new to postfix (having used qmail for several years). In my old setup
        >I had maildrop rules that are run on addresses which I use to receive
        >mailing lists. So for example, for an address that is used solely for
        >receiving this list, the maildrop rules would check for the presence of
        >these headers:
        >
        > Sender: owner-postfix-users@...
        > Precedence: bulk
        > List-Post: <mailto:postfix-users@...>
        > List-Help: <http://www.postfix.org/lists.html>
        > List-Unsubscribe: <mailto:majordomo@...>
        > List-Subscribe: <mailto:majordomo@...>
        >
        >If the check fails the mail is unlikely to have come from the list and is
        >most likely spam (or a direct reply from someone on the list - which I
        >don't want) and gets rejected.
        >
        >What I would like to know is, can something similar be implemented using
        >postfix's header_checks? My reading of the docs suggests it can't be done
        >because postfix only processes a single header at a time and makes a
        >decision per header.

        header_checks doesn't keep state between lines, so it can't check for
        multiple conditions as your example
        above. Maildrop/procmail/SpamAssassin or similar are well suited for
        this task.

        >Another thing is I would like to reject mails don't have a "Subject:"
        >header (or it is empty). Again, because of the way the header_checks are
        >done I don't think I can check for the absence of a particular header?

        Header_checks can detect an empty header, something like:
        /^subject: *$/ REJECT empty subject header
        (btw, the above is likely to reject legit mail) but header_checks
        cannot detect a missing header. Again,
        maildrop/procmail/SpamAssassin etc. can handle that task.

        --
        Noel Jones
      • Magnus Bäck
        On Monday, January 01, 2007 at 17:52 CET, ... Nope. ... Correct. Also, you can only place conditions on the existence of a particular header, not on the
        Message 3 of 4 , Jan 1, 2007
        • 0 Attachment
          On Monday, January 01, 2007 at 17:52 CET,
          Crayon <crayon.shin.chan.uk@...> wrote:

          > I'm new to postfix (having used qmail for several years). In my old
          > setup I had maildrop rules that are run on addresses which I use to
          > receive mailing lists. So for example, for an address that is used
          > solely for receiving this list, the maildrop rules would check for
          > the presence of these headers:
          >
          > Sender: owner-postfix-users@...
          > Precedence: bulk
          > List-Post: <mailto:postfix-users@...>
          > List-Help: <http://www.postfix.org/lists.html>
          > List-Unsubscribe: <mailto:majordomo@...>
          > List-Subscribe: <mailto:majordomo@...>
          >
          > If the check fails the mail is unlikely to have come from the list and
          > is most likely spam (or a direct reply from someone on the list -
          > which I don't want) and gets rejected.
          >
          > What I would like to know is, can something similar be implemented
          > using postfix's header_checks?

          Nope.

          > My reading of the docs suggests it can't be done because postfix only
          > processes a single header at a time and makes a decision per header.

          Correct. Also, you can only place conditions on the existence of a
          particular header, not on the inexistence of a header.

          > Another thing is I would like to reject mails don't have a "Subject:"
          > header (or it is empty). Again, because of the way the header_checks
          > are done I don't think I can check for the absence of a particular
          > header?

          You can check for an empty Subject: header, but not the lack of one.

          --
          Magnus Bäck
          magnus@...
        • Crayon
          ... and Noel, thanks for the clarification. -- Crayon
          Message 4 of 4 , Jan 1, 2007
          • 0 Attachment
            On Tuesday 02 January 2007 02:06, Magnus Bäck wrote:

            > You can check for an empty Subject: header, but not the lack of one.

            and Noel, thanks for the clarification.

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