Is there a way to use an wildcard for the domainname, like


Wildcards for addresses on a domain are working with "@domain", but "hostmaster@" does not work.

current setup with *@domain wildcard:


virtual_alias_maps = hash:/etc/postfix/virtual

virtual (wildcard for domain, one mailadress for domain2):

domain anything
domain2 anything
@domain user@localhost
mail@domain2 user2@localhost

and now i want to have some standard addresses for every domain, like

webmaster@ user3@localhost

But this syntax does not work in that way. One option would be to add the address to each (non-wildcard) domain by hand, another option may be to use a pcre map for the virtual table. But using a pcre-table for aliases seems too unclean and adding them by hand is what i want to avoid.

  • For which address class? For local address class, the alias expansion will happen for the username part of the email address already. Can u be more specific about your requirement? – clement Mar 28 '14 at 11:01
  • i added some details of the current setup. – allo Mar 29 '14 at 12:40

I believe you'd want to use a regexp type map file and then you could do something like

/^webmaster@/ user3@localhost

If you want to keep the existing hash virtual file as well I suppose the config directive would be something like

virtual_alias_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regex

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.