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

Re: Unifying virtual_alias_maps and domains

Expand Messages
  • Florian Lindner
    ... That may certainly be right. ;-) ... Ok, I hope I m right now: A recipient is found in virtual_alias_domains but not in maps - bounced. A recipient is not
    Message 1 of 4 , Sep 11, 2013
    • 0 Attachment
      Am Mittwoch, 11. September 2013, 15:30:15 schrieb Viktor Dukhovni:
      > On Wed, Sep 11, 2013 at 05:18:55PM +0200, Florian Lindner wrote:
      > > Since there are not many users and rather low mail traffic on
      > > the machine I want to simplify the query. There will be no more
      > > mail enabled or disabled domains, postfix should take all emails
      > > for which virtual_alias_maps returns an alias.
      >
      > You are confused.

      That may certainly be right. ;-)

      > Virtual alias rewriting applies to all domains
      > unconditionally. Your original settings are fine. Don't change them.
      >
      > With virtual alias domains, the recipient *must* be found in virtual
      > alias maps (close enough to the truth), while with other domains the
      > recipient *may* be found in virtual alias maps.

      Ok, I hope I'm right now:

      A recipient is found in virtual_alias_domains but not in maps -> bounced.
      A recipient is not found in domains but in maps -> email is delivered to alias
      if the the MTA considers itself destination
      A recipient is neither found in domains nor maps -> email is delivered using
      other means of getting the final user to deliver the mail to.


      From: http://www.postfix.org/postconf.5.html#virtual_alias_domains

      The default value is $virtual_alias_maps so that you can keep all information
      about virtual alias domains in one place. If you have many users, it is better
      to separate information that changes more frequently (virtual address -> local
      or remote address mapping) from information that changes less frequently (the
      list of virtual domain names).

      That gave me the impression that it is possible and desirable to use the same
      query for viritual_alias_maps and domains.

      For my configuration it would be fine to tie maps and domains together. All
      recipients that are in maps are also listed in domains.

      Hope I got at least my question right this time.... ;-)

      Florian
    • Viktor Dukhovni
      ... - Essentially correct (the whole truth is merely distracting with technicalities). ... - All recipients (even remote) are subject to virtual alias
      Message 2 of 4 , Sep 11, 2013
      • 0 Attachment
        On Wed, Sep 11, 2013 at 07:26:28PM +0200, Florian Lindner wrote:

        > > With virtual alias domains, the recipient *must* be found in virtual
        > > alias maps (close enough to the truth), while with other domains the
        > > recipient *may* be found in virtual alias maps.
        >
        > Ok, I hope I'm right now:
        >
        > A recipient is found in virtual_alias_domains but not in maps -> bounced.

        - Essentially correct (the whole truth is merely distracting with
        technicalities).

        > A recipient is not found in domains but in maps -> email is delivered to alias
        > [unconditionally].

        - All recipients (even remote) are subject to virtual alias rewriting.

        > A recipient is neither found in domains nor maps -> email is delivered using
        > other means of getting the final user to deliver the mail to.


        - The recipient address is not rewritten via virtual(5).

        > That gave me the impression that it is possible and desirable to use the same
        > query for viritual_alias_maps and domains.

        No. This is a backwards compatibility crutch for Postfix versions
        prior to 2.0. It is best practice to separate virtual alias domains
        and virtual alias maps.

        > For my configuration it would be fine to tie maps and domains together. All
        > recipients that are in maps are also listed in domains.

        I would not store both in the same table, but you can store both
        in the same database. If you want to suppress virtual alias lookups
        for recipients outside a static list of domains, the LDAP, MySQL
        and PgSQL drivers for Postfix support a "domain" attribute in the
        table configuration file that restricts table lookups to addresses
        in particular domains.

        If you do use the "domain" attribute, the list of virtual domains
        can no longer be stored in the table

        main.cf:
        ...
        virtual_alias_domains = example.com
        virtual_alias_maps = mysql:${config_directory}/virtual.cf

        virtual.cf:
        ...
        domain = example.com

        because only keys of the form localpart@... are passed to the
        database.

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