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

link|improve this question

Why is this tagged "php"? – Linus Kleen Jan 20 '11 at 22:53
I am making use of the PHP mail function. – Abs Jan 20 '11 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... – Linus Kleen Jan 20 '11 at 22:57
1  
This question should be migrated to serverfault.com because it's not related to programming, it's related to configuration of qmail. – Greg Hewgill Jan 20 '11 at 23:01
I can see where you are coming from, I have changed to google apps now. – Abs Jan 20 '11 at 23:01
show 2 more comments
feedback

migrated from stackoverflow.com Jan 24 '11 at 14:23

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 4 down vote accepted

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

link|improve this answer
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. – David Smith Dec 23 '11 at 17:34
feedback

Your Answer

 
or
required, but never shown

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