Submitted by responsiveny on Tue, 11/01/2011 - 01:45
Hi, one of the domains I am hosting on VM needs to have all email delivered to an external exchange server. I am generating emails for the domain in questions via an application on the VM box, but those emails are being trapped by VM and not relaying out to the exchange server.
What is the easiest way for me to have those emails relay out?
Thank you
Status:
Active
Comments
Submitted by andreychek on Tue, 11/01/2011 - 08:50 Comment #1
Howdy -- if the "Mail for Domain" feature is enabled in Edit Virtual Server -> Enabled Features, that tells Postfix to deliver all email for that domain locally.
Does the MX record for that domain point to your Exchange server? If so, unchecking the Mail for Domain feature should allow those emails to get to your Exchange server.
Submitted by responsiveny on Tue, 11/01/2011 - 13:27 Comment #2
got the following error when trying to uncheck "mail for domain"
Error
Failed to modify server : Virus filtering cannot be enabled unless email and spam filtering is
Submitted by responsiveny on Tue, 11/01/2011 - 13:28 Comment #3
and yes the mx for that domain points to an external exchange server. so emails to that domain work fine except those that originate on the virtualmin server. i want the VM server to be able to send emails to that domain thanks
Submitted by andreychek on Tue, 11/01/2011 - 13:33 Comment #4
It's saying that, in order to disable the "Mail for Domain" feature, that the "Virus Scanning" feature also needs to be disabled.
Disable that Virus Scanning feature, and then try it again.
Submitted by responsiveny on Tue, 11/01/2011 - 14:49 Comment #5
I have disabled spam, AV and mainman but I cannot uncheck "mail for domain" error is:
Error
Failed to modify server : A target server must have email enabled if any aliases do
Submitted by andreychek on Tue, 11/01/2011 - 14:52 Comment #6
It sounds like you're working with a Virtual Server that has one or more alias servers.
That error is explaining that you'd need to first disable the Mail for Domain feature in the alias, before you can disable Mail for Domain in the current Virtual Server.
Submitted by responsiveny on Tue, 11/01/2011 - 14:58 Comment #7
yes, that was it. thank you
Submitted by responsiveny on Tue, 11/01/2011 - 22:21 Comment #8
ok, so I was finally able to uncheck "Mail for Domain" feature after following the advice above. The email still gets trapped by the VM. What log can I check to trace the email going out? thanks
Submitted by andreychek on Tue, 11/01/2011 - 22:29 Comment #9
Hmm, disabling the Mail for Domain feature is typically all that's required to resolve that.
One thing to check for is to verify that there isn't still an entry remaining in the Postfix config for that particular domain.
To do that, log into your server as root over SSH, and run this command:
grep domain.tld /etc/postfix/virtual
Where "domain.tld" is the name of the domain you're attempting to host on the Exchange server.
When you run that command, does it show any output?
Submitted by responsiveny on Tue, 11/01/2011 - 22:44 Comment #10
see next response
Submitted by responsiveny on Tue, 11/01/2011 - 22:45 Comment #11
Submitted by andreychek on Tue, 11/01/2011 - 23:17 Comment #12
Well, nuts, those shouldn't be in there :-)
Just to be super-sure -- can you take a look in Edit Virtual Server -> Enabled Features, and verify that Mail for Domain is still listed as being disabled?
If it is -- you may have run into a bug that we should get Jamie to take a look at.
We can get that manually fixed up quickly, but Jamie may need to look first in order to figure out how to prevent that from happening in the future.
Submitted by responsiveny on Tue, 11/01/2011 - 23:22 Comment #13
here is what i have. i have not restarted any services since unchecking all of these things.
Submitted by responsiveny on Tue, 11/01/2011 - 23:24 Comment #14
please let me know what i need to do to clean this up in the meantime so i can get emails flowing from my apps to the users on this domain
thank you!
Submitted by responsiveny on Tue, 11/01/2011 - 23:30 Comment #15
I will be happy to work with Jamie to help recreate this bug.
Submitted by andreychek on Tue, 11/01/2011 - 23:36 Comment #16
Thanks for all your help, and we're sorry that you're running into problems with email.
I sent Jamie a notice regarding this, so we'll see what he has to say. We'll have your system fixed up soon!
Submitted by andreychek on Wed, 11/02/2011 - 11:43 Comment #17
Okay, we're discussing a more intuitive long-term fix for this issue.
However, in the meantime -- to get this issue corrected, what you'll need to do is:
Re-enable the Mail for Domain feature
Go into System Settings -> Virtualmin Configuration -> Advanced Options, and set "Delete all email aliases when disabling mail" to "yes".
Un-check the Mail for Domain feature
After doing that -- those entries in your virtual file should be removed as expected.
Submitted by responsiveny on Wed, 11/02/2011 - 14:28 Comment #18
ok that worked, and the entries are now gone. However, email is still not being received on the users external server. What log can I look at to troubleshoot the outbound email for this domain, and where how can I view the catchall mailbox to see what emails have already been piling up on the server?
thank you
Submitted by andreychek on Wed, 11/02/2011 - 14:40 Comment #19
On CentOS -- you can view the mail logs in /var/log/maillog.
Those will show any incoming and outgoing emails, as well as any errors that come up during the delivery process.
There aren't any catchall addresses setup by default in Virtualmin -- but those can be manually added.
If you did add a catchall, you would have had to associate it with a particular email account. So, to view any email the catchall address received, you would need to view the email for that specific account.
There's a few ways to do that -- one of which is to log into that user on Usermin on port 20000.
Submitted by responsiveny on Wed, 11/02/2011 - 14:43 Comment #20
Ah, so here's the problem from /var/log/maillog
Nov 2 15:34:02 kickback postfix/smtp[6380]: connect to pickettspress.com[69.160.251.229]: Connection timed out (port 25) Nov 2 15:34:02 kickback postfix/smtp[6380]: 1B6EF4A6E90: to=info@pickettspress.com, relay=none, delay=1139, delays=1119/0.03/21/0, dsn=4.4.1, status=deferred (connect to pickettspress.com[69.160.251.229]: Connection tim ed out)
postfix is still trying to deliver to the local server and not via the MX records for the hosted domain.
Submitted by responsiveny on Wed, 11/02/2011 - 14:45 Comment #21
by the way, certain character in the above are not showing between the greater than and less than symbols.
Submitted by andreychek on Wed, 11/02/2011 - 14:55 Comment #22
It sounds like you're saying the domain you're having problems with is pickettspress.com. When reviewing the whois records for that domain, it looks like the nameservers for that server are set as NS29.WORLDNIC.COM and NS30.WORLDNIC.COM.
It looks like the MX records for that domain are pointing to Google (Gmail).
However, I believe those "worldnic.com" nameservers belong to a third party, and aren't nameservers running on your own Virtualmin server.
If your DNS is being hosted by a third party, you'd need to go into Edit Virtual Server -> Enabled Features, and disable the "BIND DNS Domain" feature.
Otherwise, your server will think it has authoritative DNS data on it's server -- and that data may differ from what you intended, causing the problems you're seeing.
Submitted by responsiveny on Wed, 11/02/2011 - 17:37 Comment #23
after dns was disabled, the mail is now flowing to the external mail server.
so in the future, what exactly needs to be done? Since this is a common scenario for us. DNS and email will usually be hosted by exchange or google and there will be a separate dns server hosting the records for the domain? can we just disable dns or does "email for domain" also need to be disabled?
thanks for the support
Submitted by andreychek on Wed, 11/02/2011 - 19:26 Comment #24
so in the future, what exactly needs to be done
If email is being hosted on a different server, you'd want to disable the "Mail for Domain" feature (and then, any "Mail" dependencies such as the Spam and Virus scanning features).
If DNS is being hosted on a different server, you'd want to disable the "BIND DNS Domain" feature.
That's all you should have to do! Everything else should be in good shape.
Submitted by responsiveny on Wed, 11/02/2011 - 22:04 Comment #25
Thanks, case closed.