Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Sorry for the title, I don't know how to sum up this situation.

I have a web server at mydomain.com, running qmail for website related mail delivery (i.e. newsletter, sign up confirmation, etc). qmail here is used only to send mails, because I have a fully working Google App Gmail associated with mydomain.com for normal email receiving.

qmail runs fine when sending email to remote addresses, for example to address@example.com, but fails when sending to address@mydomain.com. I think it's because the server thinks that he have to manage mailboxes for mydomain.com locally, instead of redirect them to Gmail. Here is the /var/log/qmail/current for two email: the first one is sent without problems to example.com, second one fails because it's for mydomain.com:

2012-11-15 15:04:11.551933500 new msg 262580
2012-11-15 15:04:11.551936500 info msg 262580: bytes 5604 from <anonymous@mydomain.com> qp 5185 uid 33
2012-11-15 15:04:11.575910500 starting delivery 316: msg 262580 to remote alice@example.com
2012-11-15 15:04:11.575912500 status: local 0/10 remote 1/20
2012-11-15 15:04:12.189828500 delivery 316: success: 74.125.136.27_accepted_message./Remote_host_said:_250_2.0.0_OK_1352991894_j49si13055539eep.9/
2012-11-15 15:04:12.189830500 status: local 0/10 remote 0/20
2012-11-15 15:04:12.189831500 end msg 262580

2012-11-15 16:49:20.270332500 new msg 262580
2012-11-15 16:49:20.270336500 info msg 262580: bytes 2192 from <anonymous@mydomain.com> qp 5479 uid 33
2012-11-15 16:49:20.315125500 starting delivery 323: msg 262580 to local bob@mydomain.com
2012-11-15 16:49:20.315128500 status: local 1/10 remote 0/20
2012-11-15 16:49:20.320855500 delivery 323: failure: Sorry,_no_mailbox_here_by_that_name._(#5.1.1)/
2012-11-15 16:49:20.320858500 status: local 0/10 remote 0/20
2012-11-15 16:49:20.372911500 bounce msg 262580 qp 5484
2012-11-15 16:49:20.372914500 end msg 262580

As you can see, it says:

Sorry,_no_mailbox_here_by_that_name

I can't say he's wrong :)

How to solve this? How to let Google App Gmail manage incoming email for mydomain.com for messages sent by mydomain.com qmail server?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Your really need to tell qmail that even though you have set it up to be the mail server for mydomain.com it should actually route all emails intented for this domain to a different mail server

You do this by adding smtproutes file in the /var/qmail/control directory with an entry of the form

mydonaim.com:other-mailserver.mydomain.com

Also make sure that /var/qmail/control/virtualdomains doesn't have an entry for that mydonaim.com


Another way to do it is to make sure that mydomain.com is in the /var/qmail/control/rcpthosts file but NOT in the /var/qmail/control/locals file. That will require that your MX records in DNS are setup in a way that are only pointing to Google and not the machine we are talking about.

Personally I would recomment the first option since it is cleaner to implement and does not require the use of DNS. Also that way you can use this machine as a backup MX server incase Google goes down (highly unlikely!)

share|improve this answer
    
Seems I've solved by removing mydomain.com from /etc/qmail/locals only (on my Debian machine, configuration files are there). Thank you very much. The MX record of my DNS were already correctly pointing to Gmail (and they have to!), so I preferred to do this way, with minimum qmail configuration edits. –  lorenzo-s Nov 16 '12 at 11:05
    
This guy knows what he is doing. –  Sammitch Nov 16 '12 at 16:29

Oh sweet jesus, someone is still using qmail? You poor soul. First and foremost, literally anything else is better than qmail.

Second, you either need to:

  1. Change your control files so that qmail no longer thinks mydomain.com is local.
    • I don't recall the filenames, if you post a file listing of /var/qmail/control it might refresh my memory.
  2. Configure a forward for every account in that domain to fire the email out for remote delivery.
    • You will have to send the email out via some alias domain, since qmail will always look at its local domains for delivery first, and ignore anything else if it finds a match.

Third, you'll probably have better luck posting your question to the qmail mailing list where all the grey-neckbeards who still use qmail gather. This is probably the best option since I'm having a hard time thinking of a way to make remote delivery and your mailing lists work at the same time.

share|improve this answer
    
What should I use instead of qmail?!? –  lorenzo-s Nov 16 '12 at 11:07
    
I moved from qmail to Postfix and was super happy. There is also Exim and Sendmail. Sendmail is supposed to be the best MTA on the planet, but its config files literally have their own config files. But if you're only using qmail for ezmlm you might want to base you decision on that functionality. –  Sammitch Nov 16 '12 at 16:27

I know nothing about how qmail works, but in general an email server that is authoritative for a domain will not forward email destined for that domain to another email server... unless the email server can be configured to share that SMTP address space.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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