Issues with sending SMTP Mail WIndows Server 2008 and Smartermail

Answered Issues with sending SMTP Mail WIndows Server 2008 and Smartermail

  • Sunday, February 17, 2013 7:36 AM
     
     

    Hi,

    I have setup a VMWare network of servers locally. I have installed DNS and AD services on one of the server. I have also added smtp services using smartermail server on the same server. I am able to telnet to port 25 of that server successfully. But I am not able to send email using the powershell scripts as shown below

    $smtp = New-Object Net.Mail.SmtpClient("dc.contoso.com")
    $smtp.Send("user1@contoso.com","user2@contoso.com","Test Email","This is a test") but i get this error

    "Exception calling "Send" with "4" argument(s): "The operation has timed out."
    At line:1 char:11
    + $smtp.Send <<<< ("user1@contoso.com","user2@contoso.com","Test Email","This is a test")
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException"

    Also I am unable to do a nslookup on that server itself for the local address and it is getting timed out.


    C:\Users\Administrator>nslookup dc.contoso.com
    DNS request timed out.
        timeout was 2 seconds.
    Server:  UnKnown
    Address:  192.168.1.1

    Name:    dc.contoso.com
    Address:  192.168.1.1

    But I am able to ping and telnet successfully

    C:\Users\Administrator>ping dc.contoso.com

    Pinging dc.contoso.com [::1] with 32 bytes of data:
    Reply from ::1: time<1ms
    Reply from ::1: time<1ms
    Reply from ::1: time<1ms
    Reply from ::1: time<1ms

    Ping statistics for ::1:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 0ms, Maximum = 0ms, Average = 0ms

    telnet dc.contoso.com 25

    220 dc.contoso.com

    =============================================

    Please help me as I have broken my head on this from long but not able to fix it.

All Replies

  • Sunday, February 17, 2013 3:27 PM
     
     Answered Has Code

    Hello Arnab_Deb,
    you can establish telnet session, but did you also try to complete entire session ? I mean:

    TELNET dc.contoso.com 25
    HELO localhost or EHLO locahost
    MAIL FROM:<user1@contoso.com>
    RCPT TO:<user2@contoso.com>
    DATA
    SUBJECT: Test e-mail
    This is a test
    <CRLF>.<CRLF>

    Reference: XFOR: Telnet to Port 25 to Test SMTP Communication

    Does it work ? Or do you get some delivery error ?

    Bye,
    Luca


    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.



  • Sunday, February 17, 2013 7:54 PM
     
     

    Thank You so much Luca for replying. This is what I am getting after executing this:

    220 dc.contoso.com
    HELO localhost
    250 dc.contoso.com Hello [192.168.1.1]
    MAIL FROM:<user1@contoso.com>
    RCPT TO:<user2@contoso.com>
    503 Bad sequence of commands

  • Monday, February 18, 2013 8:03 AM
     
     

    Hi Arnab_Deb,
    did you cut & paste code above or did you write entire string by new ?
    Note: when you write SMTP sequential commands throuth SMTP session, don't make bad spelling, otherwise you have to start a new telnet session and repeat all commands. 

    This is what error means:

    503 Error: Server encountered bad sequence of commands - Indicates (probable) that your ISP mail server did not recognized a command sent that is erroneous. Some temporary event prevents the successful sending of the message or an intermittent drop in network line connection that caused your mail client to send erroneous command and sending in the future may be successful.

    If you are sure you didn't make any writing errors, maybe the issue isn't at client side (PowerShell script) but SMTP Server side.

    Bye,
    Luca


    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.



    • Edited by Luca Fabbri Monday, February 18, 2013 10:01 PM
    •  
  • Thursday, February 21, 2013 7:35 PM
     
     

    Hi Luca,

    Sorry for the delay.

    I tried entering the commands one at a time but still no luck. I think it is something to do with the timeout issues at DNS level

  • Thursday, February 21, 2013 8:41 PM
     
     

    Hello Arnab_Deb,
    from your post I'm seeing nslookup resolved server name correctly:

    C:\Users\Administrator>nslookup dc.contoso.com
    DNS request timed out.
        timeout was 2 seconds.
    Server:  UnKnown
    Address:  192.168.1.1

    Name:    dc.contoso.com
    Address:  192.168.1.1

    Do you have Reverse Lookup Zone configured into your DNS ? I'm reading into SmarterMail 4.x Help (I don't know which version you use) that:

    Configure DNS for the Domain

    There are three major things to set up on your DNS server for each site you add to SmarterMail:
    An A Record, an MX Record, and a Reverse DNS Record. How you set these up is dependant on who hosts your DNS, and what DNS software is used.
    Check your DNS server documentation for instructions on how to set up the following records (replace example.com with the proper domain name).

    What about ?

    Bye,
    Luca


    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

  • Sunday, February 24, 2013 5:12 PM
     
     

    Hi Luca,

    Thanks a lot for all your effort.

    I was able to fix this temporarily by changing the Network of the AD from NAT to VMNet8 (which is also a NAT). Using the Virtual Network editor, I was able to change the DNS timeout value which fixed this issue but then I did a lot of other changes and this again seems to have broken and I am not at all able to fix it again. I have manually hardcoded the IP for all servers and not used DHCP. I also used the method here to clear the IP tables but no use (It did fixed ny issue of me unable to ping). http://www.corenetworkz.com/2011/08/ping-transmit-failed-general-failure.html

    Now all myy servers are connected in VMNet8 configuration. I am using smartermail version 10.

    If I can just now how to change the DNS timeout value from the default 2 seconds to my own custom value, I think then this issue will be solved. Please note it is just a test environment for my own learning of setting up a sharepoint farm. I just want to connect my sql, and sharepoint servers with the AD (which also has DNS and SMTP services) and I have done that. All servers can contact each other but it is not able to send mail using powershell or using HELO commands.

    Only issue is that I am not able to send the email using the smtp services because of the DNS timeout value and I am sure of it. I do not know how to configure a reverse DNS as well so I have not done it.

  • Sunday, February 24, 2013 8:33 PM
     
     

    Hello Arnab_Deb,
    if yours is a test environment, than you could try to change timeout value for DNS queries (link: DNS Clients and Timeouts (part 2)).

    Note: If you get DNS queries timeout means something wrong on DNS Server configuration or missing Reverse Lookup Zone (TechNet Forum: DNS nslookup error timeout was 2 second) - did you configure it or not ?

    Bye,
    Luca


    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


    • Edited by Luca Fabbri Sunday, February 24, 2013 8:34 PM
    •