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

Domain aliasing

Expand Messages
  • Noel Butler
    Folks, Has been a while since I ve looked at this, but at present if we need to alias a domain, eg foo@example.com to foo@example.net we are using
    Message 1 of 4 , Aug 1, 2011
      Folks,
      Has been a while since I've looked at this, but at present if we need to alias a domain, eg  foo@... to foo@...
      we are using  mysql:/etc/postfix/mysql_alias_domains.cf after other entries in  our virtual_alias_maps
      and using
      query = SELECT email from virtual_users where email='%s' OR email =
      CONCAT('%u@', (SELECT destination from aliased_domains where domain = '%d'))

      .. which has served us well on the massive 2 domains we've need it to ;)   ...so, my question is, is there planned an easier, more
      direct call to do it, since, IIRC, the virtual alias domains despite its name, does not do this (or I never got it to work)

      It's one feature I miss from old sendmail days which did this easily  as a simple  "from_domain"  "to_domain"  table.

    • Jeroen Geilman
      ... Consider adding a regexp or PCRE map for this: virtual_alias_maps = mysql:/etc/postfix/mysql_alias_domains.cf regexp:/etc/postfix/domain_aliases
      Message 2 of 4 , Aug 2, 2011
        On 2011-08-02 06:30, Noel Butler wrote:
        Folks,
        Has been a while since I've looked at this, but at present if we need to alias a domain, eg  foo@... to foo@...
        we are using  mysql:/etc/postfix/mysql_alias_domains.cf after other entries in  our virtual_alias_maps
        and using
        query = SELECT email from virtual_users where email='%s' OR email =
        CONCAT('%u@', (SELECT destination from aliased_domains where domain = '%d'))


        Consider adding a regexp or PCRE map for this:

            virtual_alias_maps = mysql:/etc/postfix/mysql_alias_domains.cf     regexp:/etc/postfix/domain_aliases

        /etc/postfix/domain_aliases:

            /^([^@]+)@from_domain$/    $(1)@to_domain

        It'll be faster than mysql, too ;)

        .. which has served us well on the massive 2 domains we've need it to ;)   ...so, my question is, is there planned an easier, more
        direct call to do it, since, IIRC, the virtual alias domains despite its name, does not do this (or I never got it to work)

        It's one feature I miss from old sendmail days which did this easily  as a simple  "from_domain"  "to_domain"  table.


        Since this blindly forwards mail to (possibly external) destinations, it's not a very good practice, security-wise.
        Hence why postfix requires you to jump through one or two hoops to achieve it.

        -- 
        J.
      • Magnus Bäck
        On Tuesday, August 02, 2011 at 19:25 CEST, ... No, don t do this. This breaks recipient validation in the same way that @from_domain @to_domain
        Message 3 of 4 , Aug 5, 2011
          On Tuesday, August 02, 2011 at 19:25 CEST,
          Jeroen Geilman <jeroen@...> wrote:

          > On 2011-08-02 06:30, Noel Butler wrote:
          >
          > > Has been a while since I've looked at this, but at present if we
          > > need to alias a domain, eg foo@... to foo@...
          > > we are using mysql:/etc/postfix/mysql_alias_domains.cf after
          > > other entries in our virtual_alias_maps
          > > and using
          > > query = SELECT email from virtual_users where email='%s' OR email =
          > > CONCAT('%u@', (SELECT destination from aliased_domains where
          > > domain = '%d'))
          >
          > Consider adding a regexp or PCRE map for this:
          >
          > virtual_alias_maps = mysql:/etc/postfix/mysql_alias_domains.cf
          > regexp:/etc/postfix/domain_aliases
          >
          > /etc/postfix/domain_aliases:
          >
          > /^([^@]+)@from_domain$/ $(1)@to_domain
          >
          > It'll be faster than mysql, too ;)

          No, don't do this. This breaks recipient validation in the same way that

          @from_domain @to_domain

          in an indexed map does, except it's more complicated.

          [...]

          --
          Magnus Bäck
          magnus@...
        • Jeroen Geilman
          ... I agree that he probably shouldn t do this in the first place without a valid recipient map, but I was only correcting the mysql fiasco... ... Well, no,
          Message 4 of 4 , Aug 5, 2011
            On 2011-08-05 16:22, Magnus Bäck wrote:
            > On Tuesday, August 02, 2011 at 19:25 CEST,
            > Jeroen Geilman<jeroen@...> wrote:
            >
            >> On 2011-08-02 06:30, Noel Butler wrote:
            >>
            >>> Has been a while since I've looked at this, but at present if we
            >>> need to alias a domain, eg foo@... to foo@...
            >>> we are using mysql:/etc/postfix/mysql_alias_domains.cf after
            >>> other entries in our virtual_alias_maps
            >>> and using
            >>> query = SELECT email from virtual_users where email='%s' OR email =
            >>> CONCAT('%u@', (SELECT destination from aliased_domains where
            >>> domain = '%d'))
            >> Consider adding a regexp or PCRE map for this:
            >>
            >> virtual_alias_maps = mysql:/etc/postfix/mysql_alias_domains.cf
            >> regexp:/etc/postfix/domain_aliases
            >>
            >> /etc/postfix/domain_aliases:
            >>
            >> /^([^@]+)@from_domain$/ $(1)@to_domain
            >>
            >> It'll be faster than mysql, too ;)
            > No, don't do this.

            I agree that he probably shouldn't do this in the first place without a
            valid recipient map, but I was only correcting the mysql fiasco...

            > This breaks recipient validation in the same way that
            >
            > @from_domain @to_domain
            >
            > in an indexed map does, except it's more complicated.

            Well, no, not "breaks" - just always passes it.

            If you know why you're doing it, and will absolutely never send
            backscatter because of it, it's possible to do so.


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