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

multiple postmaster aliases

Expand Messages
  • Simon Brereton
    Hi Years ago when I set up the mysql based email infrastructure, I had little idea what I was doing and so I did things in a way that were easy to understand.
    Message 1 of 5 , Jun 22, 2012
    • 0 Attachment
      Hi

      Years ago when I set up the mysql based email infrastructure, I had
      little idea what I was doing and so I did things in a way that were
      easy to understand. Limited to the 2/3 domains I was caring for this
      wasn't a problem. However, with time I have added significantly more
      and my current methodology whilst sustainable is a PITA. And now I
      know there's a better way to do it.

      In essence and in order to comply with the RFCs, I set up specific
      addresses in the Accounts DB for postmaster@... and
      postmaster@... although they deliver to the same mailbox
      (postmaster@...) via Dovecot. However, adding
      postmaster@... and postmaster@... is as you can
      imagine not scaling terribly well. And that's before I did it all
      again with the required abuse@ etc. (which also go to
      postmaster@...).

      I've been reading http://www.postfix.org/VIRTUAL_README.html but I'm
      still confused as how best to implement this.

      Essentially, all the domains that I accept mail for are listed here:

      virtual_mailbox_domains = proxy:mysql:/etc/postfix/Domain.cf

      cat /etc/postfix/Domain.cf
      user = postfix
      password = **********************
      hosts = localhost
      dbname = Mail
      table = MailDomains
      select_field = Name
      where_field = Name
      additional_conditions = and active=1

      I would like to use an alias file that routes any of
      postmaster@..., postmaster@...,
      postmaster@..., postmaster@..., etc (and also abuse@)
      to postmaster@... without having to have the mailbox created
      in the Accounts table as I currently do. Since any replies to these
      emails would be sent from the .com domain only that mailbox and that
      entry needs to exist in the Accounts table.

      What is the best way to do this?

      Thanks.

      Simon
    • Wietse Venema
      ... Automation, i.e. some front-end application that automatically creates the necessary database entries whenever you add a domain. I have no first-hand
      Message 2 of 5 , Jun 22, 2012
      • 0 Attachment
        Simon Brereton:
        > I would like to use an alias file that routes any of
        > postmaster@..., postmaster@...,
        > postmaster@..., postmaster@..., etc (and also abuse@)
        > to postmaster@... without having to have the mailbox created
        > in the Accounts table as I currently do. Since any replies to these
        > emails would be sent from the .com domain only that mailbox and that
        > entry needs to exist in the Accounts table.
        >
        > What is the best way to do this?

        Automation, i.e. some front-end application that automatically
        creates the necessary database entries whenever you add a domain.

        I have no first-hand experience, but there are at least a half-dozen
        configuration management systems that understand Postfix.

        Wietse
      • James B. Byrne
        ... Have you considered using a regexp style virtual_aliases map? Something like: regexp:/etc/postfix/virtual_alaises_regexp that contains something along the
        Message 3 of 5 , Jun 25, 2012
        • 0 Attachment
          On Mon, June 25, 2012 11:50, Simon Brereton wrote:
          > On 22 June 2012 16:57, Wietse Venema <wietse@...> wrote:
          >> Simon Brereton:
          >>> I would like to use an alias file that routes any of
          >>> postmaster@..., postmaster@...,
          >>> postmaster@..., postmaster@..., etc (and also
          >>> abuse@)
          >>> to postmaster@... without having to have the mailbox
          >>> created
          >>> in the Accounts table as I currently do.  Since any replies to
          >>> these
          >>> emails would be sent from the .com domain only that mailbox and
          >>> that
          >>> entry needs to exist in the Accounts table.
          >>>
          >>> What is the best way to do this?

          Have you considered using a regexp style virtual_aliases map?
          Something like: regexp:/etc/postfix/virtual_alaises_regexp

          that contains something along the lines of:

          /^abuse@example\.[:alpha:]{2,4}$/ postmaster@...
          /^postmaster@example\.[:alpha:]{2,4}$/ postmaster@...

          These regexp are not tested so I doubt that they would work exactly as
          shown but, you get the idea. Note that in this case you absolutely
          MUST have postmaster@... mapped to a local delivery mailbox or
          aliased to something that will not match the left hand side of the
          regexp map. Otherwise I suspect that you will get a loop.

          --
          *** E-Mail is NOT a SECURE channel ***
          James B. Byrne mailto:ByrneJB@...
          Harte & Lyne Limited http://www.harte-lyne.ca
          9 Brockley Drive vox: +1 905 561 1241
          Hamilton, Ontario fax: +1 905 561 0757
          Canada L8E 3C3
        • Simon Brereton
          ... Wietse Thanks for your time and reply. My point is I don t want DB entries for those address - I wanted to use a maps file. I ll go an read the
          Message 4 of 5 , Jun 25, 2012
          • 0 Attachment
            On 22 June 2012 16:57, Wietse Venema <wietse@...> wrote:
            > Simon Brereton:
            >> I would like to use an alias file that routes any of
            >> postmaster@..., postmaster@...,
            >> postmaster@..., postmaster@..., etc (and also abuse@)
            >> to postmaster@... without having to have the mailbox created
            >> in the Accounts table as I currently do.  Since any replies to these
            >> emails would be sent from the .com domain only that mailbox and that
            >> entry needs to exist in the Accounts table.
            >>
            >> What is the best way to do this?
            >
            > Automation, i.e. some front-end application that automatically
            > creates the necessary database entries whenever you add a domain.
            >
            > I have no first-hand experience, but there are at least a half-dozen
            > configuration management systems that understand Postfix.

            Wietse

            Thanks for your time and reply. My point is I don't want DB entries
            for those address - I wanted to use a maps file. I'll go an read the
            documentation some more.

            Cheers

            Simon
          • Simon Brereton
            ... Thanks James I ll play around with that and see where I get to. Simon
            Message 5 of 5 , Jun 25, 2012
            • 0 Attachment
              On 25 June 2012 09:23, James B. Byrne <byrnejb@...> wrote:
              >
              > On Mon, June 25, 2012 11:50, Simon Brereton wrote:
              >> On 22 June 2012 16:57, Wietse Venema <wietse@...> wrote:
              >>> Simon Brereton:
              >>>> I would like to use an alias file that routes any of
              >>>> postmaster@..., postmaster@...,
              >>>> postmaster@..., postmaster@..., etc (and also
              >>>> abuse@)
              >>>> to postmaster@... without having to have the mailbox
              >>>> created
              >>>> in the Accounts table as I currently do.  Since any replies to
              >>>> these
              >>>> emails would be sent from the .com domain only that mailbox and
              >>>> that
              >>>> entry needs to exist in the Accounts table.
              >>>>
              >>>> What is the best way to do this?
              >
              > Have you considered using a regexp style virtual_aliases map?
              > Something like: regexp:/etc/postfix/virtual_alaises_regexp
              >
              > that contains something along the lines of:
              >
              > /^abuse@example\.[:alpha:]{2,4}$/             postmaster@...
              > /^postmaster@example\.[:alpha:]{2,4}$/        postmaster@...
              >
              > These regexp are not tested so I doubt that they would work exactly as
              > shown but, you get the idea.  Note that in this case you absolutely
              > MUST have postmaster@... mapped to a local delivery mailbox or
              > aliased to something that will not match the left hand side of the
              > regexp map.  Otherwise I suspect that you will get a loop.

              Thanks James

              I'll play around with that and see where I get to.

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