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.

I have postfix set-up on my Debian VPS, I can:

  • send emails
  • receive emails

on my server

But forwarding emails from my server to gmail does not work!

I configured google's DNS through /etc/resolv.conf

I can ping google.com and with dig I also find gmail MX records. But when my server tries to forward email to gmail (setup with /etc/aliases) I get the following error:

postfix/smtp[20280]: 825E117BA8A80: to=<john_doe@gmail.com>, orig_to=<xxx@xxx.yyy>, relay=none, delay=40, delays=0/0.01/40/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)

What am I missing? Any help will be greatly appreciated!

share|improve this question
    
Is there any particular reason you have to modify resolv.conf? –  thinice Jun 30 '12 at 19:41

2 Answers 2

You are almost certainly running with postfix chrooted. You need to copy /etc/resolv.conf into the chroot as well. On Debian that should be /var/spool/postfix/ - so /var/spool/postfix/etc/resolv.conf.

You may want to check that you don't have SYNC_CHROOT turned off in /etc/default/postfix - it default's to yes - so just stopping and starting postfix with the init script should copy the new /etc/resolv.conf into the right location:

/etc/init.d/postfix stop /etc/init.d/postfix start

You can check if you are running chrooted by looking for any 'y' in the chroot column in /etc/postfix/master.cf

share|improve this answer

Your name resolution setup is broken. Repair it. First have a look into /etc/resolv.conf.

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.