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

Re: alias_maps are not being read correctly

Expand Messages
  • list@airstreamcomm.net
    ... Understood, however I am wondering why the alias_maps are not working in my instance as it appears as if they are not being used at all. I am not sure if
    Message 1 of 6 , Nov 30, 2012
    • 0 Attachment
      On 11/30/12 10:22 AM, Wietse Venema wrote:
      > list@...:
      >> I am setup a 2.6.6 server with virtual domains and the entries in an
      >> alias_maps file (/etc/postfix/aliases) which look like this:
      >>
      >> localuser :include:/etc/postfix/massmail/localuser
      >> localuser2 :include:/etc/postfix/massmail/localuser2
      > As documented this format is supported in ALIAS_MAPS not VIRTUAL_ALIAS_MAPS
      >
      > Wietse
      >
      Understood, however I am wondering why the alias_maps are not working in
      my instance as it appears as if they are not being used at all. I am
      not sure if this is a symptom of my configuration, or the intended
      functionality.

      In my configuration is have:

      alias_database = hash:/etc/aliases, hash:/etc/postfix/aliases
      alias_maps = hash:/etc/aliases, hash:/etc/postfix/aliases

      Either of these maps appear to be recognized?
    • Noel Jones
      ... alias_maps are used by local(8) during delivery of local mail, and is not used by virtual domains. ... This defines the databases to be rebuilt when you
      Message 2 of 6 , Nov 30, 2012
      • 0 Attachment
        On 11/30/2012 10:45 AM, list@... wrote:
        > On 11/30/12 10:22 AM, Wietse Venema wrote:
        >> list@...:
        >>> I am setup a 2.6.6 server with virtual domains and the entries in an
        >>> alias_maps file (/etc/postfix/aliases) which look like this:
        >>>
        >>> localuser :include:/etc/postfix/massmail/localuser
        >>> localuser2 :include:/etc/postfix/massmail/localuser2
        >> As documented this format is supported in ALIAS_MAPS not
        >> VIRTUAL_ALIAS_MAPS
        >>
        >> Wietse
        >>
        > Understood, however I am wondering why the alias_maps are not
        > working in my instance as it appears as if they are not being used
        > at all. I am not sure if this is a symptom of my configuration, or
        > the intended functionality.

        alias_maps are used by local(8) during delivery of local mail, and
        is not used by virtual domains.


        >
        > In my configuration is have:
        >
        > alias_database = hash:/etc/aliases, hash:/etc/postfix/aliases

        This defines the databases to be rebuilt when you issue the
        "newaliases" command. This has no effect on what alias databases
        are used during local(8) delivery.
        http://www.postfix.org/postconf.5.html#alias_database

        > alias_maps = hash:/etc/aliases, hash:/etc/postfix/aliases

        List of databases used during local(8) delivery.
        http://www.postfix.org/postconf.5.html#alias_maps
        http://www.postfix.org/aliases.5.html


        >
        > Either of these maps appear to be recognized?
        >

        These maps are not used during virtual delivery. Please see
        virtual_alias_maps; note the format is different.
        http://www.postfix.org/postconf.5.html#virtual_alias_maps
        http://www.postfix.org/virtual.5.html



        It might be helpful to review
        http://www.postfix.org/ADDRESS_REWRITING_README.html



        -- Noel Jones
      • list@airstreamcomm.net
        ... Thanks for the clarification Noel, from your explanation it appears my relay is virtual so the alias_maps are not going to be recognized for the domains
        Message 3 of 6 , Nov 30, 2012
        • 0 Attachment
          On 11/30/12 11:17 AM, Noel Jones wrote:
          > On 11/30/2012 10:45 AM, list@... wrote:
          >> On 11/30/12 10:22 AM, Wietse Venema wrote:
          >>> list@...:
          >>>> I am setup a 2.6.6 server with virtual domains and the entries in an
          >>>> alias_maps file (/etc/postfix/aliases) which look like this:
          >>>>
          >>>> localuser :include:/etc/postfix/massmail/localuser
          >>>> localuser2 :include:/etc/postfix/massmail/localuser2
          >>> As documented this format is supported in ALIAS_MAPS not
          >>> VIRTUAL_ALIAS_MAPS
          >>>
          >>> Wietse
          >>>
          >> Understood, however I am wondering why the alias_maps are not
          >> working in my instance as it appears as if they are not being used
          >> at all. I am not sure if this is a symptom of my configuration, or
          >> the intended functionality.
          > alias_maps are used by local(8) during delivery of local mail, and
          > is not used by virtual domains.
          >
          >
          >> In my configuration is have:
          >>
          >> alias_database = hash:/etc/aliases, hash:/etc/postfix/aliases
          > This defines the databases to be rebuilt when you issue the
          > "newaliases" command. This has no effect on what alias databases
          > are used during local(8) delivery.
          > http://www.postfix.org/postconf.5.html#alias_database
          >
          >> alias_maps = hash:/etc/aliases, hash:/etc/postfix/aliases
          > List of databases used during local(8) delivery.
          > http://www.postfix.org/postconf.5.html#alias_maps
          > http://www.postfix.org/aliases.5.html
          >
          >
          >> Either of these maps appear to be recognized?
          >>
          > These maps are not used during virtual delivery. Please see
          > virtual_alias_maps; note the format is different.
          > http://www.postfix.org/postconf.5.html#virtual_alias_maps
          > http://www.postfix.org/virtual.5.html
          >
          >
          >
          > It might be helpful to review
          > http://www.postfix.org/ADDRESS_REWRITING_README.html
          >
          >
          >
          > -- Noel Jones
          >
          Thanks for the clarification Noel, from your explanation it appears my
          relay is virtual so the alias_maps are not going to be recognized for
          the domains that are hosted virtually. I just created a mysql table
          with a source and destination column like so:

          massmailaddr -> destaddr1
          massmailaddr -> destaddr2
          ...

          Added virtual_alias_map = mysql:/etc/postfix/massmail.cf:

          hosts = x.x.x.x, y.y.y.y
          user = user
          password = password
          dbname = massmail
          query = SELECT destination FROM entries WHERE source = '%s'

          postmap -q massmailaddr mysql:/etc/postfix/massmail.cf:

          destaddr1, destaddr2, ...

          And had success. I also had to update the value for
          virtual_alias_expansion_limit as my customer needed to deliver to more
          than the default 1000 addresses.
        • mouss
          ... it is recommended to use fully qualified addresses (put the domain in the addresses). otherwise, if you change myorigin, you ll have a surprise... ...
          Message 4 of 6 , Dec 2, 2012
          • 0 Attachment
            Le 30/11/2012 18:36, list@... a écrit :
            > [snip]
            > Thanks for the clarification Noel, from your explanation it appears my
            > relay is virtual so the alias_maps are not going to be recognized for
            > the domains that are hosted virtually. I just created a mysql table
            > with a source and destination column like so:
            >
            > massmailaddr -> destaddr1
            > massmailaddr -> destaddr2
            > ...

            it is recommended to use "fully qualified" addresses (put the domain in
            the addresses). otherwise, if you change myorigin, you'll have a surprise...


            >
            > Added virtual_alias_map = mysql:/etc/postfix/massmail.cf:
            >
            > hosts = x.x.x.x, y.y.y.y
            > user = user
            > password = password
            > dbname = massmail
            > query = SELECT destination FROM entries WHERE source = '%s'
            >
            > postmap -q massmailaddr mysql:/etc/postfix/massmail.cf:
            >
            > destaddr1, destaddr2, ...
            >
            > And had success. I also had to update the value for
            > virtual_alias_expansion_limit as my customer needed to deliver to more
            > than the default 1000 addresses.

            For mass mail, it is recommended to use a mailing list manager, such as
            mailman and sympa. these tools have been design for that task (and they
            do many things that you'll have a hard time implementing with a stock
            MTA).
          Your message has been successfully submitted and would be delivered to recipients shortly.