So now that I have sendmail started (Sendmail1 ) everything should work, right? not yet. A little background first, I only need to send this email internally. I have an Exchange 2003 running GFI Mail Essentials 2010. So i first go into Exchange System Manager and into the SMTP Virtual Server and make sure my linux box ip address is allowed to relay. I then go into GFI ME and make sure that my Linux Box IP address is in the white list so nothing would block that server from sending.

I try to do a mail -s “Test” myemail@myemaildomain.com and check my inbox. It didn’t send. I run a ‘tail -f /var/maillog’ in another session to see what errors it’s throwing out there (-f will automatically update the end of the log so you don’t have to keep running the tail command) and then perform the test again. This time i’m getting a few different errors. The most notable is:

Sep 17 13:56:56 mylinuxbox sendmail[10836]: o8FLuXvL005391: to=, delay=1+20:00:21, xdelay=00:00:00, mailer=esmtp, pri=3991610, relay=mylinuxbox.mydomain.com. [192.168.1.3], dsn=4.0.0, stat=Deferred: Connection refused by mylinuxbox.myemaildomain.com.

The problem it seemed was that, even though i’m trying to send it to my exchange email server on my network, sendmail was trying to send the mail to itself. After doing a little searching and performing the following basic network command:

#nslookup
set type=mx
mydomain.com

I noticed a problem immediately. No MX record for my domain was popping up when performing the nslookup above. I then realized that the DNS server that my linux box uses in /etc/resolv.conf had no MX record in it. All my DNS MX records that the world needs to send email to this company are setup externally. Since my exchange server handles all of the internal mail, i never had a reason to set this up.

So the final solution was to place the mx record for myemaildomain.com in my DNS server that my linux box was using. It was then able to correctly find my email server internally. It was an easy solution but took a little while to figure out with the “connection refused” log entry.

Sep 21 10:19:01 mylinuxbox sendmail[26899]: o8LEJ1mX026899: to=myemail@myemaildomain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30050, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o8LEJ1g6026992 Message accepted for delivery)
Sep 21 10:19:01 mylinuxbox sendmail[27037]: o8LEJ1g6026992: to=, ctladdr= (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120309, relay=mymailserver.myemaildomain.com. [192.168.1.8], dsn=2.0.0, stat=Sent ( Queued mail for delivery)

Great, i got the email. Now let’s throw some info in the subject and message so i can get my backup info. Check out Sendmail3

Advertisements