Disable email for a specific domain?

I have a customer that I am having trouble contacting by email. So I called him, and he said he made his [SiteWorx] account, but was not ready to switch so he wouldn’t have to worry about loosing emails during the week. That’s fine, but in the mean time my SMTP server is locally delivering email to his domain… :frowning:

I tried updating his MX record to be the same as his old one, but it looks like local delivery follows a different set of rules. How can I leave his account setup, but disable the local mail delivery for his domain?

I also have another customer who plans to signup soon, but they have specifically requested to keep their email with their ISP (i.e., leave their MX record pointing to their ISP’s mail server). Same question…

Thanks for the help!

I think I have figured it out. I found /var/qmail/control/virtualdomains and commented out the domain I did not want qmail handling. The email appears to have gone through this time.

But with that said, was it actually necessary to point that domain’s MX record at the old mail server? My guess is qmail would say “okay, so you don’t want local delivery, but let’s see what the local DNS says…” Of course, if the local DNS has a MX record pointing back to my server, that would create a recursive loop, right?

So my steps in the future are…

  1. Reconfigure the user’s DNS (using NodeWorx) to point their MX record to their old mailserver.
  2. Instruct qmail to stop listening on that domain.

Any chance this could be a feature of NodeWorx? :smiley:

Hi jimp,

I don’t believe it was neccessary to update the MX in your DNS server. As you discovered Qmail will always choose the local box first if it determines it is supposed to handle mail for a particular domain. However, if this Qmail install isn’t supposed to handle mail for that domain, it’ll do a full fledged MX lookup, it won’t check with “local DNS” first.

Of course, when/if the domain’s nameservers are changed to point to your server and it becomes authoritative for the domain, obviously at that point the MX in your DNS system would have to be changed (if they still wanted mail hosted elsewhere).

Any chance this could be a feature of NodeWorx?

Probably not a bad idea jimp.


Thanks for the tip, that makes a lot of sense. But another thought has crossed my mind concerning proper email delivery…

I am using ModernBill to handle the billing, which in turn instructs InterWorx-CP to create the account. After the account is created, ModernBill sends the new customer an email telling them their new SiteWorx account has been created along with the login information. But in the case of someone transfering their domain, they are likely going to provide their email_address@the_transfering_domain. If InterWorx-CP just created the account and told qmail about it, won’t ModernBill end up sending a locally delivered email? The customer will never receive the email.

This actually happened to me once. When I finally received access to my account (via a returned telephone call), the “catchall” box they had configured for me had my “Welcome” email as the first message.

The only solution I can think of for this would be to have a cron job that makes qmail the authority over the domain only after enough time (5-15min?) has passed to let ModernBill send its final email. This would have a positive effect for the “transfering domain” scenerio, and no effect if the user provided ModernBill with an email address on a different domain.

  • jim

This is a needed feature… disabling local delivery… does one comment with a # or a ; or other?

Comments start with a # character.

Cool… worked that out. I was given a tip to make a symlink for the virtualdomains to /dev/null - so that each time a new domain is added it will not only not need a manual edit - but any auto generated emails will be sent directly to the correct external mail server…

Neat idea. I wish I had thought of that. I’m going to give it a try. Thanks!