forward mails to my own domain

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Rolf
New user
New user
Posts: 4
Joined: 2023-06-07 15:06

forward mails to my own domain

Post by Rolf » 2023-06-07 15:41

hmailserver is setup for a domain example.de. Mails from a linux program are sent to this server. It is forwarding all mails to an external provider. It's running.... but mails to users with adress xyz@example.de are NOT forwarded. How can I tell hmailserver to forward this mail too via the external provider?
Thanks for any solution, Rolf

palinka
Senior user
Senior user
Posts: 4209
Joined: 2017-09-12 17:57

Re: forward mails to my own domain

Post by palinka » 2023-06-07 16:20


Rolf
New user
New user
Posts: 4
Joined: 2023-06-07 15:06

Re: forward mails to my own domain

Post by Rolf » 2023-06-08 15:00

Thanks for the link....of course it works this way! Sorry that I didn't find it myself, but I'm working with hmailserver just a few days....
Regards, Rolf

RobLDN
New user
New user
Posts: 4
Joined: 2023-09-11 16:48

Re: forward mails to my own domain

Post by RobLDN » 2023-09-11 17:18

Apologies if this isn't the same topic, but I thought I'd thread hijack incase it's the same answer.

We're testing a migration to Google Workspace and have MX record on ourdomain.com set up accordingly, whereas it used to point to the hmailserver location.

Email addresses are identical on hmailserver & GWorkspace.

If an external address emails someone at name@ourdomain.com it goes to the inbox on GWorkspace which is desired.

UNLESS you send email via our hmailserver SMTP at mail.ourdomain.com then it goes straight to name@ourdomain.com inbox on hmailserver. It doesn't get out onto the internet to be routed to Google.

This would be okay except that I'm troubleshooting an IMAP migration process and can't be sure that this isn't causing an issue - INBOX.folder structure is migrated but no emails.

Will a route help here? I've tried some variations but can't get an email leaving via hmailserver mail.ourdomain.com to reach the same domain residing on GWorkspace.

User avatar
johang
Senior user
Senior user
Posts: 1023
Joined: 2008-09-01 09:20

Re: forward mails to my own domain

Post by johang » 2023-09-11 22:28

RobLDN wrote:
2023-09-11 17:18
Will a route help here?
yes...

did you configure as Example 2 ? https://www.hmailserver.com/documentati ... ure_routes
and possibly.. restart hmailserver after you added the route.
lets cheat darwin out of his legacy, find a cure for cancer...

RobLDN
New user
New user
Posts: 4
Joined: 2023-09-11 16:48

Re: forward mails to my own domain

Post by RobLDN » 2023-09-12 16:00

Thanks I had another go but it's still not sending to the target. If you can review my usage I'd be very grateful. Restarted hmailserver after changing settings.

Our hmailserver, still running at mail.example.com (addresses are @example.com)
MX record updated to new server on smtp.gmail.com:465 SSL

Route settings
Domain: example.com
Target: smtp.gmail.com
Sender match: local
Recipient match: local

IP Ranges
Internet: all 'Local to...' checkboxes ticked

User avatar
johang
Senior user
Senior user
Posts: 1023
Joined: 2008-09-01 09:20

Re: forward mails to my own domain

Post by johang » 2023-09-12 20:58

RobLDN wrote:
2023-09-12 16:00

Route settings
Domain: example.com
Target: smtp.gmail.com
Sender match: local
Recipient match: local

IP Ranges
Internet: all 'Local to...' checkboxes ticked
try
reccipent match = "A remote email address"
lets cheat darwin out of his legacy, find a cure for cancer...

RobLDN
New user
New user
Posts: 4
Joined: 2023-09-11 16:48

Re: forward mails to my own domain

Post by RobLDN » 2023-09-13 10:57

No difference. My test is to send an email from rob@example.com to rob@example.com;robtest@example.com.

Both accounts exist on both hmailserver and Google Workspace.

User avatar
jim.bus
Senior user
Senior user
Posts: 1450
Joined: 2011-05-28 11:49
Location: US

Re: forward mails to my own domain

Post by jim.bus » 2023-09-13 12:12

RobLDN wrote:
2023-09-13 10:57
No difference. My test is to send an email from rob@example.com to rob@example.com;robtest@example.com.

Both accounts exist on both hmailserver and Google Workspace.
There's your problem.

If the recipient email account exists as Local on hMailServer then the email will be delivered to the Local Email Account not the External Email Account when using a Route. That would then be why the email to rob@example.com on Google Workspace wasn't delivered to Google Workspace.

See Example 2 in this link: https://www.hmailserver.com/documentati ... ence_route
If you think you understand quantum mechanics, you don't understand quantum mechanics.

RobLDN
New user
New user
Posts: 4
Joined: 2023-09-11 16:48

Re: forward mails to my own domain

Post by RobLDN » 2023-09-13 12:29

Ah, right. I thought that was the point of setting up a route, to avoid that behaviour and use another mail server.

I've discovered that this shouldn't be impacting our migration, so not going to test further. Thanks for your help.

User avatar
jim.bus
Senior user
Senior user
Posts: 1450
Joined: 2011-05-28 11:49
Location: US

Re: forward mails to my own domain

Post by jim.bus » 2023-09-13 13:05

RobLDN wrote:
2023-09-13 12:29
Ah, right. I thought that was the point of setting up a route, to avoid that behaviour and use another mail server.

I've discovered that this shouldn't be impacting our migration, so not going to test further. Thanks for your help.
The Route would do that if the same Email Accounts on Google Workspace did not exist on hMailServer. As I understand how hMailServer works if the Recipient Email Account exists on hMailServer, it will always deliver it to the Local Email Account. In other words Local Recipient Email Accounts existing on hMailServer take precedence.
If you think you understand quantum mechanics, you don't understand quantum mechanics.

Post Reply