How can I stop q-mail from handling my domain specific emails?

For example, I have a blog installed on my server and it uses PHP to make use of the mail() function to send out emails.

mail('email@my-domain.com', 'subject', 'message');

But when it sends email with @my-domain.com it doesn't leave the server to check what the MX records are, it just sends it locally because that address exists in its records some how.

I ask because I have started making use of GMail as my mail service provider and I need emails to arrive there rather than just stay in the server.

I hope I have made this clear as I am having trouble trying to find terms that I can use to serach via Google!

Thanks all

  • Why is this tagged "php"? Jan 20, 2011 at 22:53
  • I am making use of the PHP mail function.
    – Abs
    Jan 20, 2011 at 22:55
  • @Abs I read that. But it's tagged just because you mentioned it. The question's not tagged "google" or "mail" either... Jan 20, 2011 at 22:57
  • I can see where you are coming from, I have changed to google apps now.
    – Abs
    Jan 20, 2011 at 23:01

1 Answer 1


Qmail keeps it's configurations files in /var/qmail/control:

grep YOUR_DOMAIN /var/qmail/control/*

Remove your domain from the following files:

/var/qmail/control/rcpthosts /var/qmail/control/locals

  • I think you actually want to leave the name in rcpthosts, otherwise qmail will reject the messages outright because it's not responsible for the domain. Removing from locals tells qmail that the domain is not handled locally and it should try to deliver through smtproutes, and mx records. Dec 23, 2011 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.