External mail servers

Hello, 2 things relating to external mail servers.

1) Is there a way to set up external mail servers through VM? I have tried disabling "Accept mail for domain" and of course set up the MX record, and all works well... except when the VM server is used as the outgoing SMTP server or email is sent by PHP. It does not seem to relay the mail externally?

2) Is there a way in VM have an external mail server, but use the "secondary mail server" feature to spool mail in case the external mail server is offline? Disabling "Accept mail for domain" removes the entry for the secondary.

Status: 
Active

Comments

So do you want Virtualmin to send all outgoing email via another mail server? If so, this is quite possible .. you can set it at Webmin -> Servers -> Postfix Mail Server -> General Options -> Send outgoing mail via host.

This will apply to mail generated by PHP scripts, sent by Virtualmin or Usermin, and mail relayed via clients such as Outlook and Thunderbird.

No it is only certain clients... for example a client has an exchange server and they want us to spool and hold mail when their server goes off line.... and for php generated mail to be relayed to their exchange server. But a global change is not appropriate on the vm server because all the other clients use the vm server for mail.

My hope was that vm could provide some easy way to this in the way vm does...

That's great. My only complaint is that doing this removes the config on the backup mail server as we must disable mail for a domain. Is there any easy way to prevent this from happening?

You could temporarily or permanently remove the other mail server as a secondary mail server first ..

I assume you have a secondary mail server defined in Virtualmin at Addresses and Networking -> Secondary Mail Servers , and don't want to remove the config from it? If so, you could just disable it on that page first..

OK... that makes sense. It's an easy enough workaround.