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 localp...@example.com are passed to the
database.

-- 
        Viktor.

Reply via email to