sending mail with virtual smtp server

sending mail with virtual smtp server

am 10.09.2007 21:02:20 von Oliver Weichhold

Hi all,

Time to ask the experts;

I have the virtual SMTP server running in IIS 6 on a win2k3
standalone server.

I use it to send email by dropping a properly written text file
in the pickup folder, this works fine.

Now I want to use it with a program that requires an SMTP
server name, port, username and password.

Well, the port is 25, of course, I left the user name and
password blank (not sure which username and password would
be appropriate here, I have set none up for SMTP, allow
anonymous is checks off in properties)

For the SMTP server name I tried to use server name, localhost,
//servername, my domainname.com that is tied to the public IP
address, all to no avail.

What would I put for SMTP server name if I wanted to use the
default SMTP server installed with IIS?

Again, I only want to send mail, not receive it, from the
server, and it does this just fine by copying files into the
pickup folder.

Everything I find on the subject assumes I want to send and
receive mail, so it describes how to either A) install SMTP
and POP3, or B) install exchange server.

I have applications that use the SMTP sever as it is and
don't want to break them - so I refuse to change the basic
setup I have now.

I just seems that there should be a way to use the SMTP
server just as one would use and 'full blown' mail server
to send mail.

Thanks
kpg

Re: sending mail with virtual smtp server

am 10.09.2007 21:17:14 von Kristofer Gafvert

Hello,

For SMTP server name you can use localhost, IP address, domain name and
whatever you can use to access the SMTP server.

What is happening when you try to use any of this? Do you get an error
message? What is logged in the SMTP log? What is happening?

Depending on your SMTP settings, you may need to allow relaying. I don't
think it is allowed by default, which means that you cannot send emails.

Perhaps that is the problem? Perhaps you can establish a connection, but
do not authenticate propery so you cannot send emails?

What settings do you have regarding relaying and authentication?

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


kpg* wrote:

>Hi all,
>
>Time to ask the experts;
>
>I have the virtual SMTP server running in IIS 6 on a win2k3
>standalone server.
>
>I use it to send email by dropping a properly written text file
>in the pickup folder, this works fine.
>
>Now I want to use it with a program that requires an SMTP
>server name, port, username and password.
>
>Well, the port is 25, of course, I left the user name and
>password blank (not sure which username and password would
>be appropriate here, I have set none up for SMTP, allow
>anonymous is checks off in properties)
>
>For the SMTP server name I tried to use server name, localhost,
>//servername, my domainname.com that is tied to the public IP
>address, all to no avail.
>
>What would I put for SMTP server name if I wanted to use the
>default SMTP server installed with IIS?
>
>Again, I only want to send mail, not receive it, from the
>server, and it does this just fine by copying files into the
>pickup folder.
>
>Everything I find on the subject assumes I want to send and
>receive mail, so it describes how to either A) install SMTP
>and POP3, or B) install exchange server.
>
>I have applications that use the SMTP sever as it is and
>don't want to break them - so I refuse to change the basic
>setup I have now.
>
>I just seems that there should be a way to use the SMTP
>server just as one would use and 'full blown' mail server
>to send mail.
>
>Thanks
>kpg

Re: sending mail with virtual smtp server

am 10.09.2007 23:26:53 von Oliver Weichhold

"Kristofer Gafvert" wrote in
news:xn0fb1lid000001e@news.microsoft.com:

Thanks for the reply. Answers in-line:


> For SMTP server name you can use localhost, IP address, domain name and
> whatever you can use to access the SMTP server.

Did each of those. For now I will use localhost.


> What is happening when you try to use any of this? Do you get an error
> message? What is logged in the SMTP log? What is happening?

I get an error message:


Unable to realy for xxx@yyy.com 504.5.7.4


> Depending on your SMTP settings, you may need to allow relaying. I don't
> think it is allowed by default, which means that you cannot send emails.

Relaying is not allowed by default, but I don't think I am relaying. I am
sending the email from the server that hosts the SMTP server. In any case
I wnet into the smtp properties and told it to use windows authentication,
and according to that access restrictions will not be enforced if a windows
accout is used to authenticate. I then went into the smtp application and
told it to use a local account as username and password - this had no
effect.

> Perhaps that is the problem? Perhaps you can establish a connection, but
> do not authenticate propery so you cannot send emails?

Authentication/relayingdoes seem to be the problem.

> What settings do you have regarding relaying and authentication?

See above.


OK - I added the localhosts ip address, the pop and smpt ip address of the
email address I am trying to mail to (I know that should not be needed, but
I'm just trying stuff) nad I still get the "unable to relay" message.

I thought relaying was when a remote smtp client was trying to use the
local smtp to realy messages. That is not what I'm doing here, so why
am I getting an "unalbe to ralay ffrom xxx@yyy.com, where xxx.yyy.com
is the email address I am trying to send to?

Re: sending mail with virtual smtp server

am 11.09.2007 06:21:19 von Kristofer Gafvert

You are relaying.

Permissions seems to be the problem. Since you get the error messages, we
know that you can establish a connection, so the server name is correct.

Remember you have two things to check; authentication and relaying. You
can allow authentication but still not allow relaying.

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


kpg* wrote:

>"Kristofer Gafvert" wrote in
>news:xn0fb1lid000001e@news.microsoft.com:
>
>Thanks for the reply. Answers in-line:
>
>
>>For SMTP server name you can use localhost, IP address, domain name and
>>whatever you can use to access the SMTP server.
>
>Did each of those. For now I will use localhost.
>
>
>>What is happening when you try to use any of this? Do you get an error
>>message? What is logged in the SMTP log? What is happening?
>
>I get an error message:
>
>
>Unable to realy for xxx@yyy.com 504.5.7.4
>
>
>>Depending on your SMTP settings, you may need to allow relaying. I don't
>>think it is allowed by default, which means that you cannot send emails.
>
>Relaying is not allowed by default, but I don't think I am relaying. I am
>sending the email from the server that hosts the SMTP server. In any case
>I wnet into the smtp properties and told it to use windows authentication,
>and according to that access restrictions will not be enforced if a windows
>accout is used to authenticate. I then went into the smtp application and
>told it to use a local account as username and password - this had no
>effect.
>
>>Perhaps that is the problem? Perhaps you can establish a connection, but
>>do not authenticate propery so you cannot send emails?
>
>Authentication/relayingdoes seem to be the problem.
>
>>What settings do you have regarding relaying and authentication?
>
>See above.
>
>
>OK - I added the localhosts ip address, the pop and smpt ip address of the
>email address I am trying to mail to (I know that should not be needed, but
>I'm just trying stuff) nad I still get the "unable to relay" message.
>
>I thought relaying was when a remote smtp client was trying to use the
>local smtp to realy messages. That is not what I'm doing here, so why
>am I getting an "unalbe to ralay ffrom xxx@yyy.com, where xxx.yyy.com
>is the email address I am trying to send to?

Re: sending mail with virtual smtp server

am 12.09.2007 18:19:17 von Oliver Weichhold

"Kristofer Gafvert" wrote in
news:xn0fb2ch7000001f@news.microsoft.com:

> You are relaying.
>
> Permissions seems to be the problem. Since you get the error messages,
> we know that you can establish a connection, so the server name is
> correct.
>
> Remember you have two things to check; authentication and relaying.
> You can allow authentication but still not allow relaying.
>

I went into the SMTP virtual server properties dialog and set the
following:

General: No changes except enable logging

Access - Authentication: Anonymous Access and Integrated Windows
Authentication checked

Access - Relay - select allow all except for: with an empty list
and checked allow all computers which successfully authenticate
to relay regardless of the ;ist above

I went into Outlook Express and created a mail account.

POP3 and SMTP server: localhost
Username : a user on the sever with admin rights
Password: password for above user

I composed a message and sent it to our ISP hosted email address.

Outlook Express moves message to the sent folder.

I check the BAD Mail folder and see there is a delivery failure
notification that the mail server attempted to deliver - it could
not I assume because I am not running POP3? No mater, this is a
side effect of the process failing.

Here is the SMTP log:

#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2007-09-12 15:49:42
#Fields: time c-ip cs-method cs-uri-stem sc-status
15:49:42 127.0.0.1 HELO - 250
15:49:42 127.0.0.1 MAIL - 250
15:49:42 127.0.0.1 RCPT - 250
15:49:42 127.0.0.1 DATA - 250
15:49:42 127.0.0.1 QUIT - 240
15:49:42 65.254.254.50 - - 0
15:49:42 65.254.254.50 EHLO - 0
15:49:42 65.254.254.50 - - 0
15:49:42 65.254.254.50 MAIL - 0
15:49:42 65.254.254.50 - - 0
15:49:42 65.254.254.50 QUIT - 0

The ip address 65.254.254.50 seems to be the mail server hosting
the email address I tried to send the message to. I tried other
email addresses also with same result.

To summarize: I turned on relaying (or at least turned off any
restriction to relaying) and I cannot send an email from outlook
express.

Like I mentioned before, I can send mail by dropping a message in
the "Pickup" folder on the server, so I know that the server can
indeed send mail. That I am having trouble getting other program
to do it I find mystifying.

I'll accept you explanation that I am indeed relaying, and I do think
this is the problem somehow, but I don't see how I could configure
the server to be any more open than it is.

kpg

Re: success

am 12.09.2007 18:53:02 von Oliver Weichhold

I got it to work, here's how:

I turned on Allow Anonymous, Basic Authentication,
set 127.0.0.1 as the only allowed relay address,
turned off Integraded Windows Authentication, and
turned off allow relaying for any computer that
authenticates.

In the email program I left the username and
password blank and set the SMTP server to localhost.


Leaving the user/pw blank in combination with
allowing bacis authentication seemd to do the trick.

The other changes are intended to secust the server
as much as possible.

So there was (and still is) an authentication problem
that I have not figured out (and will not try to).
Using Basic auth bypassed it. Good enough.

Thanks for your help.
kpg