Ville Walveranta wrote:
The exciting quest to Postfix continues...
Tonight's question is about virtual canonical domains (the term is
obviously coined by me since there are no Google hits with it before
this post gets indexed ;). I have currently (for clarity's sake while
I'm learning the system) defined virtual_mailbox_domains,
virtual_mailbox_maps, virtual_alias_domains, and _virtual_alias_maps
as individual files:
The mentioned domains are obviously internal..
#virtual_alias_domains:
thirddomain.com 20081114
fourthdomain.com 20081115
#virtual_mailbox_domains:
someotherdomain.com 20081115
#virtual_alias_maps:
[EMAIL PROTECTED] [EMAIL PROTECTED], [EMAIL PROTECTED]
[EMAIL PROTECTED] [EMAIL PROTECTED]
@thirddomain.com [EMAIL PROTECTED]
postmaster [EMAIL PROTECTED]
#virtual_mailbox_maps:
[EMAIL PROTECTED] someotherdomain.com/info/
[EMAIL PROTECTED] someotherdomain.com/test1/
[EMAIL PROTECTED] someotherdomain.com/test2/
[EMAIL PROTECTED] someotherdomain.com/test3/
--
What I'd like to accomplish is to create a new virtual domain that
mirrors the logins of an existing domain without a catch-all. In my
example above the domain fourthdomain.com has been defined as a
virtual alias domain, but how do I enable it to receive email for the
exact same email accounts as those of someotherdomain.com (i.e.
"[EMAIL PROTECTED]", "[EMAIL PROTECTED]",
"[EMAIL PROTECTED]", "test1fourthdomain.com",
"[EMAIL PROTECTED]", and "[EMAIL PROTECTED]")? Perhaps I
have to create all corresponding aliases for fourthdomain.com? Or is
there a simpler way? In the production environment I'm working on to
set up there are about a dozen domains with about 20 identical
accounts so that a given username receives email with all those dozen
domain names. If I can create virtual canonical domains, I could
create the accounts once and alias the rest of the domains as opposed
to creating 20 accounts and about 220 redirect aliases.
Perhaps this could be accomplished with check_recipient_access using
PCRE table that would have a IF.. REDIRECT ..ENDIF clause for each
address... or maybe there's a really simple way to do it (for why I
ask before I try anything else). I'm thinking along the lines of the
"virtualdomains" control file in qmail where it is possible assign
multiple domain names to a mailbox user which in turn automatically
aliases all 'attached' domains to the virtual user accounts defined
for that virtual domain.
in theory, you could use wildcard virtual_alias_maps:
@alternatename.example @primary.example
unfortunately, this makes all addresses [EMAIL PROTECTED] valid
during the smtp transaction, and this will cause a bounce if the address
cannot be delivered (if [EMAIL PROTECTED] does not exist). Thus
backscatter.
so the choices I can see are:
- use a script to create the virtual aliases
- if your users are stored in sql, you could use sql statements to
generate the aliases (only when the "primary" address really exists)
- write a policy service to do recipient validation. Then you can use
wildcard virtual aliases.
...