On Fri, Feb 13, 2015 at 07:22:19AM -0500, Wietse Venema wrote:

> Andre Dalle:
> > Hey all,
> > 
> > 
> >    Is it supported to override virtual_alias_maps in master.cf;
> >    rather than using receive_override_options to disable all address
> >    rewriting?
> 
> The two approaches solve different problems. Keep in mind that 
> 
> - virtual-alias expansion is implemented in the cleanup daemon, 
> 
> - the smtpd daemon reads the virtual-alias table to decide if a
>   recipient address may be invalid.
> 
> If you use different virtual-alias tables in different places, 
> then you can expect problems with recipient address validation.
> 
> I recommend doing all the virtual-alias exansion in one place, and
> not complicating the configuration with different virtual-alias
> tables.

The alternative is to configure a superset of all the mappings in
smtpd(8) via a master.cf override, and use multiple cleanup(8)
instances at least one of which also has an override.  Then assign
to each smtpd(8) the appropriate cleanup instance via "-o
cleanup_service_name=...".  

Keep in mind that cleanup(8) is also used:

    * To process mail injected via sendmail(1) via pickup(8),
    * To process certain mail aliased via local(8)
    * To process bounce and postmaster notices
    * To process verification probes

The default cleanup instance has to behave sensibly for these cases
too.

So splitting rewriting across a filter, means that you probably
need two additional cleanups, one before and one after, and a third
to be the default for mail that is not entering via SMTP.

The SMTP server can use the full rewrite table for recipient
validation, but the pre and post filter cleanup services can
each use the appropriate partial rewrites.

You also need to be aware that mail addressed to virtual alias
domain recipients will bounce if not rewritten to a real domain,
*UNLESS* a content_filter preempts normal routing,  so any
incomplete rewriting needs to always be at a stage of
processing where a content_filter override is present to
redirect mail for further processing and more rewriting.

If you can avoid the complexity, do so.

-- 
        Viktor.

Reply via email to