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[9017]: pAHIfMuW009017: from=<yourboss@xyz.local>, size=1233, class=0, nrcpts=1, msgid=<d129d873.5d463d48@xyz.local>, proto=ESMTP, daemon=MTA, relay=[]
Nov 17 13:42:17 externalmailserver sendmail[9050]: pAHIfMuW009017: to=<zbob@xyz.local>, delay=00:00:55, xdelay=00:00:36, mailer=relay, pri=121233, relay=mailserver.xyz.local. [], dsn=2.0.0, stat=Sent (<d129d873.5d463d48@xyz.local> 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 <d129d873.5d463d48@xyz.local> "Undelivered Mail Returned to Sender" yourboss@xyz.local zbob@xyz.local MAILSERVER\DMZ Relay yourboss@xyz.local

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@externalmailserver@xyz.local.

If the e-mail is send via the tool, it's an ESMTP message where the msgid=esef9e.asdasfe@xyz.local

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 externalmailserver@xyz.local, 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: <e65f12.5fb1b@xyz.local>
Message-ID: <e65f12.5fb1b@externalmailserver.xyz.local>

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.

  • can you post Get-ReceiveConnector "DMZ Relay Connector" | select AuthMechanism,PermissionGroups? ...want to check if it's externally secured and allows anonymous users.
    – BoyMars
    Nov 18, 2011 at 17:32
  • AuthMechanism is Tls and BasicAuth. PermissionGroups include AnonymousUsers, EchangeUsers, ExchangeServers, Custom.
    – dubmojo
    Nov 18, 2011 at 17:52

1 Answer 1


Maybe the e-mails are getting delivered and Outlook is just moving them into the Junk folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.