Page 1 of 1

Receiving email from any subdomain.

Posted: 2020-08-05 02:37
by bloxxite
Hey there. I had a pleasant experience with hmailserver after spending days trying to set up postfix to no avail.
I was wondering if I could have any subdomain forward to a root email using a rule or script?

I found this was related: https://www.hmailserver.com/forum/viewtopic.php?t=20444
Although he only needed to forward to a catch all email, I need to forward to the appropriate user.

Example:
bloxxite@this.is.an.example.com -> bloxxite@example.com

Thank you!

Re: Receiving email from any subdomain.

Posted: 2020-08-05 07:31
by SorenR
You can have aliases on your domain. Check Names in domain settings.

Re: Receiving email from any subdomain.

Posted: 2020-08-05 17:11
by bloxxite
I have multiple users and would like to forward from their subdomain of choice to the root domain to their account.
I can't do wildcard subdomains in aliases, plus if there were, I would have to create a new alias per user.

Re: Receiving email from any subdomain.

Posted: 2020-08-06 00:43
by bloxxite
Alright, I'm gonna learn VBScript and make an SMTP External to External handler myself. Thank you!
When I am done hopefully I can edit this post to include my code.

Re: Receiving email from any subdomain.

Posted: 2020-08-06 01:46
by palinka
How will you receive the message if there is no mx record for this.is.an.example.com?

Re: Receiving email from any subdomain.

Posted: 2020-08-06 01:48
by bloxxite
I can do * for my MX record.

Re: Receiving email from any subdomain.

Posted: 2020-08-06 02:00
by mikedibella
bloxxite wrote:
2020-08-06 01:48
I can do * for my MX record.
Remember that *.example.com will only catch an.example.com, not is.an.example.com or this.is.an.example.com.

Re: Receiving email from any subdomain.

Posted: 2020-08-06 02:05
by bloxxite
That's weird, because my server is getting the HELO from gmail when I do a subdomain like that.
It just thinks that the "To" is external so it wants authentication.

Image

Re: Receiving email from any subdomain.

Posted: 2020-08-06 08:06
by johang
not all dns servers accept the input " * for mx record " but some surely do ( it is ok by for example https://tools.ietf.org/html/rfc1912 section 2.7 and https://tools.ietf.org/html/rfc4592#section-2.2.1 ) but be sure to know what to expect from it, 1 caveat could be.. there can only be 1 of info@, suport@, webmaster@, and so forth.

Re: Receiving email from any subdomain.

Posted: 2020-08-06 08:19
by Virinum
mikedibella wrote:
2020-08-06 02:00
bloxxite wrote:
2020-08-06 01:48
I can do * for my MX record.
Remember that *.example.com will only catch an.example.com, not is.an.example.com or this.is.an.example.com.
No, most DNS server don't reduce it to the first subdomain level only. So *.example.com will also serve a.b.c.d.example.com.

On wildcard certificates you're right. *.example.com is only valid for this first subdomain level.

Re: Receiving email from any subdomain.

Posted: 2020-08-28 01:07
by mikedibella
On wildcard certificates you're right. *.example.com is only valid for this first subdomain level.
Yup, that's where I got my circuits crossed.