Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail relay fails off one server

    Symptoms

    My Database Server (DB1) can send email messages via a relay through the Mail server (Mail1) (Exchange 2003)
    My Web Server (Web1) cannot send mail messages via the same relay mechanism but can send 'local' mail

    Background
    I have a four-legged firewall with each of the above on different legs. None of the machines are in the same domain.

    I have setup relaying on Mail1's SMTP protocol to include only subnets
    10.195.53.0 (255.255.255.0) Web1's
    10.195.52.0 (255.255.255.0) DB1's
    10.195.50.0 (255.255.255.0) Mail1's

    Analysis
    The email mechanism works and connects - because both relay and local mails can be sent from DB1
    The email mechanism connects from Web1 - because local mails can be sent from Web1
    The firewall is not at fault because the email mechanism works for Web1 - it's just relays that are rejected
    Conclusion - something to do with the Exchange or Mail1 server security configuration - but what?

    For testing purposes I use the following vbs script which will run without parameters and sends both a local and relay message.
    Andrew <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    <font face="Comic Sans MS">
    ' Usage of the email subroutine
    ' cscript "C:NZTCScriptsemail.vbs" "To" "From" "Subject" "Bodytext" "AttachmentPath"
    '
    ' "To" defaults to domain @teacherscouncil.govt.nz unless it is a fully qualified address
    ' use "" to represent null text, or no attachment

    Dim objargs
    Dim sTo
    Dim sFrom
    Dim sSubject
    Dim sTextBody
    Dim sAttach

    Set objArgs = WScript.Arguments
    If objArgs.Count > 4 then
    email objArgs(0), objArgs(1), objArgs(2), objArgs(3), objArgs(4)
    else
    email "me@a.site.to.relay.to","Unknown","Invalid email call - arguments count was " & objArgs.Count, "Time " & Now(), ""
    email "me@local.site","Unknown","Invalid email call - arguments count was " & objArgs.Count, "Time " & Now(), ""
    end if

    '************************************************* ************************************

    Sub email(sTo, sFrom, sSubject, sTextBody, sAttach)

    Const cdoBasic = 1 'Use basic (clear-text) authentication.
    Const cdoSendUsingPort = 2
    Const Domain = "@local.site"
    Const SMTPServer = "10.195.50.2"
    Dim iMsg
    Dim iConf

    On Error Resume Next

    ' Create message and configuration objects
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")


    'Apply settings to the configuration object
    With iConf.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
    .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "asecret"
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPserver
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

    .Update
    End With

    'Apply the settings to the message object
    With iMsg
    Set .Configuration = iConf
    If InStr(1, sTo, "@") > 0 Then .To = sTo Else .To = sTo & Domain
    If InStr(1, sFrom, "@") > 0 Then .From = sFrom Else .From = sFrom & Domain
    .Subject = sSubject
    .TextBody = sTextBody
    If sAttach <> "" Then .AddAttachment sAttach
    .Send
    End With
    ' cleanup mail objects
    Set iMsg = Nothing
    Set iConf = Nothing


    End Sub

    </font face=comic>

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Mail relay fails off one server

    Your relay security settings for both DB1 and Web1 should be in the same configuration dialog, probably for your SMTP Virtual Server(s). If you turn up the logging for the virtual server, does the IP address for Web1 seem to be what is expected?

  3. #3
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail relay fails off one server

    Thanks - that's a good place to look.

    I misinterpretted your mail to start off with, but that triggered another thought. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Web1 is running SMTP as a part of IIS (I'd never intended using it) - perhaps looking into that will give me some entertainment over the weekend.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •