• Mail relay fails off one server

    Author
    Topic
    #438505

    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 confused

    ‘ 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

    Viewing 0 reply threads
    Author
    Replies
    • #1045800

      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?

      • #1045810

        Thanks – that’s a good place to look.

        I misinterpretted your mail to start off with, but that triggered another thought. grin
        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.

    Viewing 0 reply threads
    Reply To: Mail relay fails off one server

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: