Sending email from IIS to local email server - messages stuck in IIS queue folder.

Windows server 2003 domain, server 2003 IIS 6 and Exchange 2003 SP2

I am using IIS to send out messages to website users. The script formats an email message and puts it in the "Pickup" directory in inetpub\mailroot of the IIS server.

Sometimes we need a message sent from the web server to one of our IT staff internally so in that case the message is addresesd to ITuser@ourdomain.com.

Any message sent to an outside  user from the web server sends without incident. IIS on the web server will NOT send sucessfully to anything addressed to our local domain.

An mx record lookup on the IIS server shows our email server address which is correct. Our email server allows the IP of the web server to relay through it. Further, a manual smtp session from the IIS server to the mail server will allow a message through OK. i.e. telnet mailserver.domain.local 25 mail from: etc..

The messages attempted on the IIS server to the local recipients will always get stuck in the queue folder of IIS and no SMTP errors are logged in the log files.

I have tried testing with the antivirus shut off on the mail server as well and it made no difference.

Both servers are on the same domain if that is important. Stil trying to figure this one out. Any help is appreciated. Thanks!

-P

LVL 1
PonthecomputerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SembeeCommented:
You have two options here.

If the web server is using your AD for DNS then setup a split DNS system with MX records for your domain, where the MX records point to the internal IP address of your Exchange server.

Another option would be to put a domain in to the IIS SMTP server, set it with your own domain. Then set a smart host and point it directly at your Exchange server.

Simon.
0
PonthecomputerAuthor Commented:
Thanks Simon. I already have the first item done and an nslookup on the web server resolves the domain's mail server correctly. I tried adding a domain as well with mail server as smarthost - same result.

I've been testing by creating a text file:

from: test@domain.com
to: user@ourdomain.com
subject: test

this is a test

And then dropping it in the pickup directory. Today I found that this works for just about any domain but on suspicion, I tried sending to another domain I set up running exchange 2k3 and it too will not accept the message so I think it must be the way the test message is formatted - Exchange 2k3 does not like it.

For whatever reason yahoo, and all other outside domains have always accepted it OK.

Do you know of a format that would work with Exchange? I ususally use this without problems.

http://www.petri.co.il/test_smtp_service.htm

0
SembeeCommented:
Can you telnet to the Exchange server from the web server? You need to confirm whether it is a connectivity or a formatting issue. I would be surprised if it was a formatting issue if the same format works for other servers.

Simon.
0
PonthecomputerAuthor Commented:
Yes I can telnet just fine and can sucessfully send a message manually ie:
From the web server:

telnet mailserver 25
ehlo
mail from:x@x.com
rcpt to: user@ourdomain.com
data
test
.

This works just fine. This morning I set up a lab in vmware and tested and all is ok on the lab. I believe that there is something wrong with the instance of IIS on this server. It is doing something odd with the formatting of the message that exchange does not like.

I can set up 2 other IIS servers and they will send just fine. Sending only out of this one gives me problems.

Do you know if I can safeley remove SMTP from IIS and re install it without affecting the other portions of IIS or is this even worth trying?
Thanks!
0
SembeeCommented:
If the box is just IIS (ie not Exchange) then you can remove components easily. Remove, reboot and then reinstall. If you have service packed the machine then you may want to use a slipstreamed installation for the reinstall when it prompts for components. You will have a period of downtime, as the IIS services will be stopped.

The other thing it could be is AV or Antispam software on that machine. That can mung email messages.

Simon.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.