I have a new domain hosted on virtualmin (mydomain.com) with the mail server on exchange on another box (email@example.com addresses)
The site needs to be able to send emails for verification etc but when it sens emails to firstname.lastname@example.org they are being routed to postfix on the server and therefore not sent externally.
I’m sure this is an easy fix to make but i cant quite get my head round it.
Any help would be greatly appreciated.
You’d want to verify that the “Mail” feature for this particular Virtual Server is disabled.
Also, in Services -> DNS Domain, it sounds like you’d want the MX record to point to your Exchange box. Make sure to “Apply” the configuration so that BIND is restarted.
Thanks for the quick response.
That makes sense but disabling “mail” doesn’t seem obvious.
Under “Domain/Features and Plugins/” “Mail for Domain” does not have a check next to it, although “Default” is checked. If i click on “Show Domains” “delete selected” is an option but this looks like you deleting the whole domain (which i REALLY dont want to do).
Any pointers would be great.
Well, just to make sure you’re looking in the right place, what you’d want to do is go into “Edit Virtual Server” after choosing the domain from the drop-down on the top-left, and look in where it says “Enabled features”.
In there, you’d want to make sure that “Mail” is disabled for that Virtual Server. Disabling it there will only affect that one domain, your other Virtual Servers will continue to receive email without a problem.
Ok i’ve disabled mail for that domain. (For some reason i had to enable it in “Features and Plugins” and then disable it again)
i’m now getting the following in my postfix log:
email@example.com, relay=none, delay=0.08, delays=0.05/0.03/0/0, dsn=5.4.6, status=bounced (mail for mydomain.com loops back to myself)
Again thanks for you help.
I’d expect that error if Mail were disabled, but the MX record was still pointing to your server.
Can you verify in Services -> DNS Domain for that Virtual Server that the MX record is pointing to your Exchange server?
If it is, I’d restart BIND to make sure the changes are up to date.
in “Services/DNS Domain” i added “Mail server” values
Name = mail.mydomain.com
TTL = default
Mail server = xxx.xxx.xxx.xxx
Prioirty = 5
And then bounced BIND
I’m still getting
Aug 24 16:01:05 host postfix/smtp: B1081240612: firstname.lastname@example.org, relay=none, delay=0.11, delays=0.06/0.04/0/0, dsn=5.4.6, status=bounced (mail for mydomain.com loops back to myself)
Okay, so if you log into your server, and type:
host -t MX mydomain.com
The address that gets returned – is it the correct address for your Exchange server?
Thanks very much for all your help. It looks as though the MX was incorrectly set at there URL. Now that’s been fixed adding the MX record in virtualmin has sorted all the issues and mail is being received.
That’s great news, thanks for the update!