Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

webmaster@*

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

current setup with *@domain wildcard:

main.cf:

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.

share|improve this question
    
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 at 11:01
    
i added some details of the current setup. –  allo Mar 29 at 12:40

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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