1

Topic: Receive email for all subdomains (wildcard subdomains)

==== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu 12.04
- Related log if you're reporting an issue:
====

I was wondering how to configure postfix so that it receives mail for *.example.com.

That is, I have created a domain "example.com" through the iredadmin console. I want
emails to "user@subdomain.example.com" to be delivered to "user@example.com".

What do I need to do to accomplish this?

Thanks!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Receive email for all subdomains (wildcard subdomains)

You can setup an alias domain for example.com. Insert a record in SQL table "vmail.alias_domain" is all you need.

3

Re: Receive email for all subdomains (wildcard subdomains)

And what would I enter in the alias? *.example.com? %.example.com? .example.com?

I tried all three in the domain alias section of the iredadmin web interface but none worked.

I get a "Relay access denied" error if I send to "user@sub.example.com", but sending to "user@example.com" works.

4

Re: Receive email for all subdomains (wildcard subdomains)

If you need 'sub.example.com', then use 'sub.example.com', not '*.example.com'. For example:

mysql> USE vmail;
mysql> INSERT INTO alias_domain (alias_domain, target_domain, created) VALUES ('sub.example.com', 'example.com', NOW());

5

Re: Receive email for all subdomains (wildcard subdomains)

ZhangHuangbin wrote:

If you need 'sub.example.com', then use 'sub.example.com', not '*.example.com'. For example:

mysql> USE vmail;
mysql> INSERT INTO alias_domain (alias_domain, target_domain, created) VALUES ('sub.example.com', 'example.com', NOW());

But I need a "catch-all" for all subdomains. So "anything.example.com" would be delivered.

6

Re: Receive email for all subdomains (wildcard subdomains)

Unfortunately, it doesn't support catch-all alias domain.