IIS and SMTP - Firewall Rules for CDO

This is Interesting: Free IT Magazines  
Home > Archive > IIS and SMTP > March 2005 > Firewall Rules for CDO





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Firewall Rules for CDO
William Tasso

2005-03-21, 6:02 pm

Hello

I have a trivial CDO example script (below) which works perfectly. A
colleague using my script as a base always gets error: "The transport
failed to connect to the server." The only differences I can see are
these calls...


[**** start snippet

Const cdoSendUsingMethod =
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer =
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort =
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout =
"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate =
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName =
"http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword =
"http://schemas.microsoft.com/cdo/configuration/sendpassword"

Dim Fields ' As ADODB.Fields
Set Fields = objConfig.Fields

' Set configuration fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort ' send method
.Item(cdoSMTPServerPort) = 25 ' smtp port #
.Item(cdoSMTPConnectionTimeout) = 10 ' Connection
Timeout
.Item(cdoSMTPAuthenticate) = cdoBasic ' basic
authentication
.Item(cdoSMTPServer) = "mail.example.com" ' a real
smtp server
.Item(cdoSendUserName) = "valid@example.com" ' a real user
name
.Item(cdoSendPassword) = "password" ' a real
password
.Update
End With

end snippet ****]



I'm clutching at straws now and starting to wonder if there's a rule
needed on the firewall to allow these outgoing calls. Any clues
appreciated.




[********** Trivial CDO Mail Script **********]

<!--METADATA TYPE="typelib"
NAME="CDO for Windows 2000 Library"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
-->
<%
' mail-cdo-sample.asp
option explicit

dim sMessage ' As string
sMessage = "Contact has been made." & vbCrLf & "This is a test message
from the cdo script." & vbCrLf

Dim objConfig ' As CDO.Configuration
Set objConfig = Server.CreateObject("CDO.Configuration")

Dim Fields ' As ADODB.Fields
Set Fields = objConfig.Fields

' Set configuration fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort ' send method
.Item(cdoSMTPServerPort) = 25 ' smtp port #
.Item(cdoSMTPConnectionTimeout) = 10 ' Connection
Timeout
.Item(cdoSMTPAuthenticate) = cdoBasic ' basic
authentication

.Item(cdoSMTPServer) = "mail.example.com" ' a real smtp server
.Item(cdoSendUserName) = "valid@example.com" ' a real user name
.Item(cdoSendPassword) = "password" ' a real password

.Update
End With
Set Fields = Nothing

Dim objMessage ' As CDO.Message
Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig
Set objConfig = Nothing

With objMessage
.To = "mailbox@example.com"
.From = "valid@example.com"
.ReplyTo = "valid@example.com"
.Subject = "test from cdo"
.TextBody = sMessage
.Send
End With

Set objMessage = Nothing

%>

Thanks for looking

--
William Tasso
Jeff Cochran

2005-03-21, 6:02 pm

Port 25 on the firewall has to be open, but that's the only place the
firewall would come into play. Have you looked at the SMTP log files?

Jeff

On Mon, 21 Mar 2005 18:23:32 -0000, "William Tasso"
<spamblocked@tbdata.com> wrote:

>Hello
>
>I have a trivial CDO example script (below) which works perfectly. A
>colleague using my script as a base always gets error: "The transport
>failed to connect to the server." The only differences I can see are
>these calls...
>
>
>[**** start snippet
>
>Const cdoSendUsingMethod =
>"http://schemas.microsoft.com/cdo/configuration/sendusing"
>Const cdoSendUsingPort = 2
>Const cdoSMTPServer =
>"http://schemas.microsoft.com/cdo/configuration/smtpserver"
>Const cdoSMTPServerPort =
>"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
>Const cdoSMTPConnectionTimeout =
>"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
>Const cdoSMTPAuthenticate =
>"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
>Const cdoBasic = 1
>Const cdoSendUserName =
>"http://schemas.microsoft.com/cdo/configuration/sendusername"
>Const cdoSendPassword =
>"http://schemas.microsoft.com/cdo/configuration/sendpassword"
>
> Dim Fields ' As ADODB.Fields
> Set Fields = objConfig.Fields
>
> ' Set configuration fields we care about
> With Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort ' send method
> .Item(cdoSMTPServerPort) = 25 ' smtp port #
> .Item(cdoSMTPConnectionTimeout) = 10 ' Connection
>Timeout
> .Item(cdoSMTPAuthenticate) = cdoBasic ' basic
>authentication
> .Item(cdoSMTPServer) = "mail.example.com" ' a real
>smtp server
> .Item(cdoSendUserName) = "valid@example.com" ' a real user
>name
> .Item(cdoSendPassword) = "password" ' a real
>password
> .Update
> End With
>
>end snippet ****]
>
>
>
>I'm clutching at straws now and starting to wonder if there's a rule
>needed on the firewall to allow these outgoing calls. Any clues
>appreciated.
>
>
>
>
>[********** Trivial CDO Mail Script **********]
>
><!--METADATA TYPE="typelib"
> NAME="CDO for Windows 2000 Library"
> UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
> -->
><%
>' mail-cdo-sample.asp
>option explicit
>
>dim sMessage ' As string
>sMessage = "Contact has been made." & vbCrLf & "This is a test message
> from the cdo script." & vbCrLf
>
>Dim objConfig ' As CDO.Configuration
>Set objConfig = Server.CreateObject("CDO.Configuration")
>
>Dim Fields ' As ADODB.Fields
>Set Fields = objConfig.Fields
>
>' Set configuration fields we care about
>With Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort ' send method
> .Item(cdoSMTPServerPort) = 25 ' smtp port #
> .Item(cdoSMTPConnectionTimeout) = 10 ' Connection
>Timeout
> .Item(cdoSMTPAuthenticate) = cdoBasic ' basic
>authentication
>
> .Item(cdoSMTPServer) = "mail.example.com" ' a real smtp server
> .Item(cdoSendUserName) = "valid@example.com" ' a real user name
> .Item(cdoSendPassword) = "password" ' a real password
>
> .Update
>End With
>Set Fields = Nothing
>
>Dim objMessage ' As CDO.Message
>Set objMessage = Server.CreateObject("CDO.Message")
>
>Set objMessage.Configuration = objConfig
>Set objConfig = Nothing
>
>With objMessage
> .To = "mailbox@example.com"
> .From = "valid@example.com"
> .ReplyTo = "valid@example.com"
> .Subject = "test from cdo"
> .TextBody = sMessage
> .Send
>End With
>
>Set objMessage = Nothing
>
>%>
>
>Thanks for looking


j1c

2005-03-21, 6:02 pm

can she/he:
telnet their.mailserver.com 25

from their workstation? if not, that would likely be firewall related

Jeff Cochran

2005-03-22, 2:51 am

On 21 Mar 2005 14:15:43 -0800, "j1c" <just1coder@yahoo.ca> wrote:

>can she/he:
>telnet their.mailserver.com 25
>
>from their workstation? if not, that would likely be firewall related


Or the ISP blocks port 25.

Jeff
Derek vd Merwe

2005-03-31, 3:00 am

Hi,

Depending on your SMTP server maybe look at your DNS rules on the Firewall.
Microsoft SMTP uses TCP 53 and not UDP 53 for it DNS lookups.
More information can be found reading the following article: PSS ID Number:
263237

--

Regards,
Derek vd Merwe

_____________________________________
"William Tasso" <spamblocked@tbdata.com> wrote in message
news:op.snz2pi0g3jnr2w@jupiter.cavern.tbdata.com...
> Hello
>
> I have a trivial CDO example script (below) which works perfectly. A
> colleague using my script as a base always gets error: "The transport
> failed to connect to the server." The only differences I can see are
> these calls...
>
>
> [**** start snippet
>
> Const cdoSendUsingMethod =
> "http://schemas.microsoft.com/cdo/configuration/sendusing"
> Const cdoSendUsingPort = 2
> Const cdoSMTPServer =
> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
> Const cdoSMTPServerPort =
> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
> Const cdoSMTPConnectionTimeout =
> "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
> Const cdoSMTPAuthenticate =
> "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
> Const cdoBasic = 1
> Const cdoSendUserName =
> "http://schemas.microsoft.com/cdo/configuration/sendusername"
> Const cdoSendPassword =
> "http://schemas.microsoft.com/cdo/configuration/sendpassword"
>
> Dim Fields ' As ADODB.Fields
> Set Fields = objConfig.Fields
>
> ' Set configuration fields we care about
> With Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort ' send method
> .Item(cdoSMTPServerPort) = 25 ' smtp port #
> .Item(cdoSMTPConnectionTimeout) = 10 ' Connection
> Timeout
> .Item(cdoSMTPAuthenticate) = cdoBasic ' basic
> authentication
> .Item(cdoSMTPServer) = "mail.example.com" ' a real smtp
> server
> .Item(cdoSendUserName) = "valid@example.com" ' a real user
> name
> .Item(cdoSendPassword) = "password" ' a real
> password
> .Update
> End With
>
> end snippet ****]
>
>
>
> I'm clutching at straws now and starting to wonder if there's a rule
> needed on the firewall to allow these outgoing calls. Any clues
> appreciated.
>
>
>
>
> [********** Trivial CDO Mail Script **********]
>
> <!--METADATA TYPE="typelib"
> NAME="CDO for Windows 2000 Library"
> UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
> -->
> <%
> ' mail-cdo-sample.asp
> option explicit
>
> dim sMessage ' As string
> sMessage = "Contact has been made." & vbCrLf & "This is a test message
> from the cdo script." & vbCrLf
>
> Dim objConfig ' As CDO.Configuration
> Set objConfig = Server.CreateObject("CDO.Configuration")
>
> Dim Fields ' As ADODB.Fields
> Set Fields = objConfig.Fields
>
> ' Set configuration fields we care about
> With Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort ' send method
> .Item(cdoSMTPServerPort) = 25 ' smtp port #
> .Item(cdoSMTPConnectionTimeout) = 10 ' Connection
> Timeout
> .Item(cdoSMTPAuthenticate) = cdoBasic ' basic
> authentication
>
> .Item(cdoSMTPServer) = "mail.example.com" ' a real smtp server
> .Item(cdoSendUserName) = "valid@example.com" ' a real user name
> .Item(cdoSendPassword) = "password" ' a real password
>
> .Update
> End With
> Set Fields = Nothing
>
> Dim objMessage ' As CDO.Message
> Set objMessage = Server.CreateObject("CDO.Message")
>
> Set objMessage.Configuration = objConfig
> Set objConfig = Nothing
>
> With objMessage
> .To = "mailbox@example.com"
> .From = "valid@example.com" .ReplyTo = "valid@example.com"
> .Subject = "test from cdo"
> .TextBody = sMessage
> .Send
> End With
>
> Set objMessage = Nothing
>
> %>
>
> Thanks for looking
>
> --
> William Tasso



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com