Solved

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

Posted on 2007-03-22
5
373 Views
Last Modified: 2007-04-17
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

0
Comment
Question by:Ponthecomputer
  • 3
  • 2
5 Comments
 
LVL 104

Expert Comment

by:Sembee
ID: 18783689
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
 
LVL 1

Author Comment

by:Ponthecomputer
ID: 18784488
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
 
LVL 104

Expert Comment

by:Sembee
ID: 18785584
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
 
LVL 1

Author Comment

by:Ponthecomputer
ID: 18787284
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
 
LVL 104

Accepted Solution

by:
Sembee earned 500 total points
ID: 18788076
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now