Note: This is my re-post from Stackoverflow.
I've been messing with a test environment for security purposes where a DMZ RHEL5 sendmail server is used as a relay for an Exchange 2007 server. Exchange is working in the environment, I have Vista and XP VMs using Outlook on the Domain to send e-mail to each other. I've been trying to simulate an external internet VM sending an e-mail to the DMZ sendmail relay, which forwards to the Exchange server.
Before everyone thinks this is too big a problem/question, I've followed the sendmail/Exchange guides and all I want to know is how I can determine why a relayed message/e-mail in Exchange is "Undelivered".
Basically I send a SMTP message to the sendmail server, which relayed to my Exchange. The /var/log/maillog shows the e-mail being relayed to Exchange.
Nov 17 13:41:22 externalmailserver sendmail: pAHIfMuW009017: from=<firstname.lastname@example.org>, size=1233, class=0, nrcpts=1, msgid=<email@example.com>, proto=ESMTP, daemon=MTA, relay=[10.50.50.1] Nov 17 13:42:17 externalmailserver sendmail: pAHIfMuW009017: to=<firstname.lastname@example.org>, delay=00:00:55, xdelay=00:00:36, mailer=relay, pri=121233, relay=mailserver.xyz.local. [192.168.1.20], dsn=2.0.0, stat=Sent (<email@example.com> Queued mail for delivery)
This is good, but the To never receives the e-mail from Exchange. So I started poking around Exchange. In the "Message Tracking" Troubleshooting Assistant I queried the processed messages and found this: (I had to copy and paste the cells... sorry for the format)
2011/11/17 RECEIVE SMTP <firstname.lastname@example.org> "Undelivered Mail Returned to Sender" email@example.com firstname.lastname@example.org 192.168.100.10 MAILSERVER\DMZ Relay email@example.com
I just want to know if anyone has any suggestions on why the DMZ Relay Connector I setup isn't relaying and is instead returning the forwarded e-mail to sender as Undelivered?
My Exchange Relay Receive Connector is pretty simple. The Exchange server's FQDN is set as the HELO response, all available IP addresses can receive relayed e-mail, and the IP address of my sendmail server is specifically set as a remote server.
Acutally I think I know what the problem is. The tool I have to use to send the e-mail is sending a different message than when I try so manually via telnet.
If I send an e-mail via telnet over SMTP, the msgid=123123...123.PA12312356@firstname.lastname@example.org.
If the e-mail is send via the tool, it's an ESMTP message where the email@example.com
Exchange must be trying to do a relay check and can't find a server named "xyz.local". Does this sound about right? All my telnet sent e-mail arrive fine. It doesn't look like I have a choice on how the tool sends the e-mail. Where would it be getting the xyz.local domain from? When using telnet, the sendmail server presents itself as 220 firstname.lastname@example.org, which works.
Ok! A little Wireshark did the trick. It looks like the tool sending the SMTP message is setting the Message-ID itself, I guess much like a Mail Server would do before sending it off to it's destination Mail Server. The set Message-ID is for the domain only, (xyz.com) and when the e-mail is relayed through Sendmail to Exchange, it just seems to sit in the STOREDRIVER. I have notion what the STOREDRIVER is, but I know e-mails get delivered if the Message-ID includes the relay's FQDN (not just the domain), and when it includes only the domain they don't get delivered.
Message-ID: <email@example.com> Message-ID: <firstname.lastname@example.org>
Exchange must be applying some look up filtering, or some configuration is missing. Does anyone have any ideas?
ANSWERED: Again, I can't answer my own question, but the first person to answer with, "Maybe the e-mails are getting delivered and Outlook is just moving them into the Junk folder" wins my vote.
That's right. The messages were delivered fine but Outlook was filtering them as phishing attempts. This is a broad testing environment and it never occured to me to check.