In message <2a0d3251-10a1-4903-8689-2d190e144...@dukhovni.org>
Viktor Dukhovni writes:
 
> > On Jan 30, 2016, at 8:03 PM, Curtis Villamizar <cur...@orleans.occnc.com> 
> > wrote:
> > 
> > I'm asking a little advice.
> > 
> > On most of my hosts mail is generated for root and then canonicaled to
> > root@fqdn and is relayed to the MSA on another host.  This is by
> > design.
> > 
> >  relayhost = msa-fqdn
> > 
> > There is an alias on the originating host for root but it doesn't seem
> > to expand there.  If that could be fixed, then the rest doesn't matter.
>  
> Aliasing root on null-clients is explained in:
>  
>    http://www.postfix.org/MULTI_INSTANCE_README.html#split

OK.  This

> Perhaps STANDARD_CONFIGURATION_README.html should also cover this.
>  
>    http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client

Null client seems good for web servers and other servers not involved
in forwarding or delivering email.  Thanks.  I'll need more config
since the MSA will want a client cert and sasl-auth.

btw- BSD jails don't have a loopback, only numbered interfaces.
Would than mean using "inet_interfaces = " (empty).

> That example is at present more minimal, but global recipient aliasing
> via virtual(5) is covered in ADDRESS_REWRITING_README.html:
>  
>    http://www.postfix.org/ADDRESS_REWRITING_README.html#receiving
>    http://www.postfix.org/ADDRESS_REWRITING_README.html#virtual

I saw this but I'm not sure I got the config quite right.

I think what I need is:

  #  destination domains and virtual alias domains
  mydestination = hash:$config_directory/my-domains
  remote_destination = pcre:$config_directory/pcre-domains
  virtual_alias_domains = $mydestination $remote_destination
  #  local users (comment out if empty) and virtual alias users
  #local_alias_maps = hash:$config_directory/local-aliases
  remote_alias_maps = hash:$config_directory/remote-aliases
  alias_database = $local_alias_maps $remote_alias_maps
  alias_maps = $local_alias_maps
  virtual_alias_maps = $remote_alias_maps
  local_recipient_maps = hash:$config_directory/local-users

  local-aliases:
    (remove root, spam, ..., anything mapping to root, spam, ...)
    (strictly local aliases - none in my case)
  remote-aliases:
    root:     ad...@some.where.tld
    spam:     spam.catc...@some.where.tld
    ...
    (anything mapping to root, spam, ...)

Note: local-users matches the recipients known to cyrus imapd.

(and of course config_directory = /usr/local/etc/postfix).

Since the goal is to catch root@*.domain.tld by using the bare word
root on the lhs in remote-aliases and a pcre to put *.domain.tld in
virtual_alias_domains this should work.  Me thinks.

I think this will work and will try it when I get a chance (on a test
domain first).  Unless someone tells me it won't work.

> -- 
>       Viktor.

Curtis


btw- I think this would also be doable in sendmail address rewriting
rules (just about any rewrite is doable) but like writing assembly
language code, I'd rather not be pursuing such a solution.

Reply via email to