domain-specific virtual_alias_maps file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

domain-specific virtual_alias_maps file

Mattia Rizzolo
Hi,

I'm setting up a new site that is going to handle all a mailing list
(with mailman, on its own domain lists.example.org) and a few aliases
@example.org.  The host is named mail1.example.org.
I successfully did it using:

----- main.cf:
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail1.example.org, localhost
relay_domains = lists.example.org
virtual_alias_maps = hash:/etc/postfix/virtual_domains
mailman_destination_recipient_limit = 1
transport_maps = hash:/etc/postfix/transport
-----

----- master.cf
mailman   unix  -       n       n       -       -       pipe
   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
   ${nexthop} ${user}
-----

----- transport
lists.example.org   mailman:
-----

---- virtual_domains
[hidden email] [hidden email]
[hidden email]  blablabla@gmail
[hidden email]  asdasdasd@gmail
-----

Now, this all works, but there is one thing that has been nagging me.

Backstory: I also inherited a host running exim4 that handles a few
aliases, and there I have a file /etc/exim4/aliases/example.org, and in
exim4.conf there this snippet:
----- exim4.conf
domain_aliases:
  driver = redirect
  allow_fail
  allow_defer
  domains = dsearch;/etc/exim4/aliases
  data = ${lookup{$local_part}wildlsearch{/etc/exim4/aliases/$domain}}
-----
Then the alias file is just
----- /etc/exim4/aliases/example.org
root: [hidden email]
info: root
blabla: [hidden email], [hidden email]
-----
...and the like, without having @example.org at each alias line.  It's
really the same syntax of the system's /etc/aliases, but it applies only
the single virtual domain (or "virtual alias" in postfix terms, I guess).

Is it possible to have anything like that?  Also assuming in the future
this host will have to handle a separate domain, I'd prefer to have
different files for each set of aliases, and keep it tidy.


Thank you in advance for any suggestion you can give me!

--
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: domain-specific virtual_alias_maps file

Wietse Venema
Mattia Rizzolo:
> Is it possible to have anything like that?  Also assuming in the future
> this host will have to handle a separate domain, I'd prefer to have
> different files for each set of aliases, and keep it tidy.

Postfix supports multiple aliases files; that is usually how mailman
is hooked up with Postfix, if you use the Postfix local delivery agent.

    alias_maps = hash:/etc/aliases, hash:/path/to/mailman/aliases, ...

There currently is no simple way to have different alias_maps
settings for different domains; that is because the Postfix local
delivery agent implements a domain-less flat namespace.

It is possible to configure different Postfix local delivery agents
for different domains, each agent having its own "-o alias_maps"
setting in master.cf, but I would not consider that simple.

Of course that is not a problem with virtual_alias maps; there,
each alias contains the domain name that it belongs in.

        Wietse