It’s probably my own incompetence and lack of knowledge but I can’t figure this out.
I have Virtualmin set up on my VPS-hosted server.
I use Google Apps for mail.
The host has controls for managing DNS settings, so I have BIND DNS turned off in Virtualmin.
All the DNS records are correct and working for Google Apps, everything works fine with the mail.
The mail features are turned off in virtualmin. (no Mail for Domain)
The problem arises when I use one of my webforms (PHP Mail) to send a mail to any address at my own domain (which is handled by Google Apps). For instance I want my “contact us” form to send to info@mydomain.se.
It works fine when I set the receiving address to any other recipient, such as my personal e-mail elsewhere.
I’m guessing the mailserver tries to find a local account since it’s the same domain, and trashes the mail since there is no “info” account. But where can I turn this off so that it just sends even though it’s the same domain as a recipient?
PLEASE, does anyone have any help for me? I’m going nuts here. Thank you!
I’m guessing the mailserver tries to find a local account since it’s the same domain, and trashes the mail since there is no “info” account. But where can I turn this off so that it just sends even though it’s the same domain as a recipient?
I suspect you’re right, that it’s trying to deliver the messages locally rather than sending them along to Google Apps.
One cause of that is if the “Mail for Domain” feature is enabled. To disable that, you can go into Edit Virtual Server -> Features, and disable “Mail for Domain”.
There where some entries for like hostmaster, abuse etc. for the domain, and I cleared all lines as per your recommendation, and then did the postmap command. Nothing…
The log gives the exact same error as before, by the way.
That would put us back to the problem of the original thread. Mail isn’t handled by this server (using Google apps). Then localy sent mail wouldn’t go out to Google.
So, I think the problem in this case is that your system’s hostname is also one of the Virtual Server names… and that’s causing some troubles.
Typically, we suggest using a FQDN, such as “host.domain.tld” for your server’s hostname. You’d want a hostname that doesn’t exist in Virtualmin as a Virtual Server.
My recommendation would be to set your hostname an FQDN, and to make sure that name doesn’t already exist in Virtualmin.
When changing your hostname, make sure you set it in /etc/hosts, as well as in /etc/postfix/main.cf on the mydestination line.