Mail hosted on an other server

Hello I have a domain with the email server hosted on an other server than the Virtualmin install. I have selected that the e-mail service for the domain not to be handled by virtualmin. The DNS MX host is pointing to the right server.

If I send an email from any other server than the Virtualmin sever the e-mail gets to the address.
When I send the email from the website hosted on the Virtualmin server using the sendmail and PHP the email is not going anywhere because it is send locally to an non-existent mailbox.
Is there a way to overcome this problem. Thanks

Howdy,

It sounds like Postfix thinks that it’s supposed to be delivering the email locally for some reason.

While you mentioned that you did this, just to be super-sure – can you click “Edit Virtual Server” for this particular domain, and verify that “Mail for Domain” is not checked? It being checked would explain why that’s occurring.

Also, is the domain in question by chance the hostname of your server? That is, if the “mydestination” line of /etc/postfix/main.cf contains the name of this domain, that’s another thing that could cause that problem.

-Eric

Hi I have checked and the Mail for Domain is disabled for this domain.
On the other side the line mydestination contains the name of the domain. Should I remove it from there? Is there a right way of doing this from virtualmin?
Thanks

On the other side the line mydestination contains the name of the domain. Should I remove it from there?

Well, the questions then would be:

  • Do you have any locally hosted email?

  • Is your remotely hosted domain also the hostname of your server?

The above questions affect how we would go about solving this particular issue. Have a good one!

-Eric

Hi
I have locally hosted mail for other domains running on this server.
I don’t understand what remotely hosted domain your are talking about above. in may case the domain name hosted on virtualmin is name.ro and on the mail server the domain for the mail is mail.name.ro
Is it this what you are asking me?
Thanks

I have a similar configuration and it is working well.

Check Virtualmin > Services > DSN Domain
Look at your address records, and verify that the name record for your mail server points to the mail server machine.

Chances are that sites hosted on the webserver are resolving to the DNS inside that machine prior to going to an external server. If the webserver’s mail.example.com address is the address of the webserver machine, mail addressed to the domain will never get out of the the webserver machine and to the mail server machine where it belongs.

Hi I have cheked the mail.example.com domain is pointing to the mail server IP, while the example.com is pointing to the webserver IP.
I need to mention that the primary dns server is the webserver and the seconday DNS server is the mail server.