• Advertisement
Join the IT Notebook

Any - Sendmail 8.x+ - Testing inbound SMTP connections

Any software title released with a GNU/Linux distribution. Articles are posted in "Linux Distribution - Software Title - Subject" format.

Any - Sendmail 8.x+ - Testing inbound SMTP connections

Postby lmmtux » Tue Aug 28, 2012 3:32 pm

These instructions were meant to be used for Sendmail, but can be used with any operating system and any SMTP compliant mail server. Using a simple telnet program, you can connect to any mail server and execute commands to test that it is answering incoming connections, as well as testing to see if it will relay email.

To test using telnet:

  1. On your client PC (preferably a separate PC that can make connections to your mail server), open a telnet session to your mail server by using this command:
    Code: Select all
    telnet yourmailserver.com 25

    Where "yourmailserver.com" is the full name of your mail server. 25 is the SMTP port number which should always be used.
    You should see a reply similar to this:
    Trying ???.???.???.???...
    Connected to yourmailserver.com.
    Escape character is '^]'.
    220 mail.domain.ext ESMTP Sendmail
  2. Issue the next command greet the server:
    Code: Select all
    HELO mypcname.com

    Where "mypcname.com" is the full host name of the computer you are running telnet on.
    You should see a reply similar to this:
    250 yourmailserver.com Hello mypcname.com [x.x.x.x], pleased to meet you
  3. Issue the next command to tell the server what the From Address will be used:
    Code: Select all
    MAIL FROM: emailaddress@mydomain.com

    Where "emailaddress@mydomain.com" is the email address you wish to test sending "from". Note: the From Address can be any address since SMTP email is anonymous. However, the server may reject it.
    If successful, you should see a reply similar to this:
    250 2.1.0 emailaddress@mydomain.com... Sender ok
  4. Issue the next command to tell the server who you want to send to:
    Code: Select all
    RCPT TO: recipientaddress@otherdomain.com

    Where "recipientaddress@otherdomain.com" is the email address you wish to send to.
    If the server is OK with this, it should reply similar to this:
    250 2.1.0 recipientaddress@otherdomain.com... Recipient ok
  5. Issue this command to start the message text:
    Code: Select all
    DATA
  6. Optional: If you wish to have a subject specified, issue this command and press Enter twice after it:
    Code: Select all
    Subject: Your message subject

    You can make up your own subject to use.
  7. Now type in your message text.
  8. When finished with the message text, press Enter.
  9. Place a single dot (.) on its own line, and press Enter again. You should see a reply similar to this:
    250 2.0.0 ???????? Message accepted for delivery
  10. You can either close your telnet window at this point or issue the "quit" command.
lmmtux
 
Posts: 55
Joined: Mon Jul 30, 2012 9:40 pm
Reputation: 0

Return to Linux

cron