Postfix Virtual Wildcard Subdomains
Hi there,
I have setup Postfix to use virtual domains with non-UNIX account users. What would you call this: virtual domains delivering to virtual accounts? Anyway, it's fine. I'd like to accept mail for all subdomains of the main domain, but I can't get it to work. For example, I currently accept mail to @amazingmac.ca. I'd like to accept mail for any subdomain of the same, with the mail delivered to a catchall address. If it makes things any easier, all mail to the domain goes to just the one address. The message I get when I try sending to user@subdomain.amazingmac.ca is "relay access denied". The server receives the mail, but rejects it. I've seen elsewhere some suggestion that the directive virtual_alias_maps should point to a regexp file, which I have tried in the current configuration, but it doesn't work. Here's the files and all their relevant contents: Code:
root@ubuntu:/etc/postfix# postconf -n Code:
root@ubuntu:/etc/postfix# cat virtual Code:
root@ubuntu:/etc/postfix# cat subdomain-catchall Code:
root@ubuntu:/etc/postfix# cat vhosts.txt Code:
root@ubuntu:/etc/postfix# cat vmaps.txt Aaron. |
Your vhosts.txt should be
Code:
amazingmac.ca Addendum: Regarding the regexp question, you can have something like this: Code:
virtual_mailbox_maps = regexp:/path/to/vmaps.txt Code:
/^bob@amazingmac\.ca$/ somewhere/bob |
Thanks so much for responding!
I added the ".amazingmac.ca" to vhosts.txt, and still the same response: "relay access denied". Quote:
|
Quote:
Also, please take a look at my first post again, since I made some additions to it. Debugging suggestions: 1. make sure you can send mail to the parent domain first. 2. make sure a catchall works for the parent using a hash table for virtual. 3. keeping a hash format for virtual, add a catchall for a specific subdomain and test it. 4. now use regexp for virtual. |
Hi Berhanie,
Thanks again for going above and beyond for me here. Everything is working now! In particular, your advice about how to use the regexp was spot-on; this is clearly an area where I'm weak. You're the man! Cheers, Aaron. |
You're welcome, Aaron.
|
I found this thread particularly useful for setting up virtual wildcard subdomains on my server. So I wrote up everything I did and put it into a blog post. Hope this helps:
http://www.myintervals.com/blog/2011...fix-and-linux/ |
All times are GMT -5. The time now is 07:24 AM. |