title: sendmail and MX records when mail server is not on web host
body: <p>This is a problem I'm sure is easy to fix, but I've been banging my head on it all day.</p>
  
  <p>I'm developing a new web site for a client.  The web site resides at (this is an example) website.com.  I have a PHP form script to email visitors' requests to requests@website.com.</p>
  
  <p>When I coded this on a staging server on a different domain, all worked fine.  When I moved it to website.com, the mail messages never arrived.  The web server is on a virtual host with a major ISP.</p>
  
  <p>Here's what I've learned since then:  My client's mail server is Microsoft Exchange on a box physically in their office.  Whenever someone on the outside world emails requests@website.com, the mail arrives.  <em>But</em> if the web server sends to the same email address, it fails every time.  This is <strong>not</strong> a PHP problem.  I secure shell in to the web server and have tested this both with sendmail and the UNIX mail application.  I've also tested it by emailing various email accounts from the shell.  I can email myself, for example, just nobody at the website.com domain.</p>
  
  <p>In short, when I'm logged in to website.com, mail to requests@website.com, user@website.com, another_user@website.com all fail.  All other addresses work fine.  What I've discovered is those dropped emails are routed to the web server's "catchall" account where they sit in its inbox.</p>
  
  <p>I've done an MX lookup on website.com.  The MX record points to mailsec.website.com.  I can telnet to mailsec.website.com port 25 and see the SMTP server.</p>
  
  <p>It appears to me that website.com isn't doing an MX lookup when it's sending mail to requests@website.com.  My theory is that it recognizes the domain as local, sees that there's no "requests" user account to deliver it to, and drops the mail into the catchall account.  What I want is to force sendmail to do the MX lookup and send the message on to the Exchange server.  I'm at wit's end here.  I can't figure out how to do this.</p>
  
  <p>For that matter, I may be way off base here and have misdiagnosed this entirely.  Internet mail and MX has always seemed  a black art to me, and my ignorance is certainly showing in this question.</p>