recently i started using an exchange hosting company to host my email and i changed my MX records email to email@example.com to their server. everything is working fine except for email sent from my web server (www.mydomain.com).
specifically... i have a contact page (www.mydomain.com/contact.html) on my website that uses a php script to send email to firstname.lastname@example.org. it worked just fine before i started using the exchange host. actually the script still sends a message to the local 'info' account.
in sendmail i added 'email@example.com' as an alias to the local 'info' user but this has not made any difference.
i think the problem is that somehow the web server has no idea that the exchange server exists -- even though the MX records point to it.
any ideas how to fix this? thanks in advance!
The problem is most likely to be that you have your web server machine still delivering mail to 'localhost'.
The simplest solution is probably to allow your web server to send all mail through your exchange machine - setting it up as a smart mail host. You'd need to enable relaying on the exchange machine to do this.
Alternatively, reconfigure your mail server on the web server machine to send mail normally (i.e. by doing dns lookups for MX and delivering using SMTP in the normal way) and make sure there is no entry in local DNS or in /etc/hosts pointing the domain for email purposes back to localhost.
I understood the question but not exactly the answer, I do not have this issue but it sounds interesting, can throw some more light please.
I'm sorry darkblue, but to be brutally frank, I cannot throw more light on this in a generic way. If you need to understand this issue, it might help if you research sendmail and dns. Both these packages are documented on the internet far better than I can do it in a few moments on here.
Originally Posted by darkblue
I do know about sendmail package or mail(), I do know about DNS server hosting... but, this was something that does not happen usually, isnt it?
Originally Posted by Roxoff
anyways, google and live are my friends now :D
We had this problem before.
What happen is that when your web server wanted to send a mail, it'll first try to resolve the domain by looking at it's localhost (/etc/hosts), then to whatever DNS you have it points to. Even if you change your MX record, your web server will look at your local host first, and that's why it never looked into the public MX record.
simple solution would be forward your email for your "info" account.
if you know the ip of your mail server, just add the .forward file in your info account home, with
info@[your ip here]
as you were doing, set up the alias but with the ip address
so in /etc/alias:
info: info@[ip here]
i hope this help
Thank you -- that sounded very promising and I attempted it. However, since I use an exchange hosting company, the exchange server on that IP address hosts multiple domains - not just mine. I need to specify my domain name in the address.
isn't there a way to force sendmail to look to the MX records - or to let it know that it is not handling mail for the domain - just for the local users?
I guess you are using those share hosting soultion for your exchange server.
try the following:
take out the domain name for your server here. This file defines what domain sendmail will receive mail for.
another thing you can try is messing with the /etc/mail/mailertable. this might be the correct way to do it.
Using 'mailertable' in Sendmail