Linux Box Admin
Trusted Remote Administration
logo

Tilde
What's new
Articles
Micro HowTos
About
Contact







SMTP test
(13 votes)
Wednesday, 07 March 2007
   
    SMTP test    
     
       
 
To test SMTP from the command line:
  1. telnet host-to-test 25 (connect to port 25 on mail server)
  2. HELO sending-host
  3. MAIL FROM: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
  4. RCPT TO: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
  5. DATA
    (enter one blank line after DATA)
  6. Subject: test
    To: to-user
    From: from-user
    (enter one blank line after From:) test text for email
    . (enter a single period by itself on the last line)
  7. QUIT

To test SMTP with SMTP AUTH (no TLS/SSL) from the command line:

First, use a perl script to compute the Base64 encoded user ID and password needed to authenticate to the mail server. This requires the MIME::Base64 module.
perl -MMIME::Base64 -e 'print encode_base64("\000userid\000password")'

The output looks something like this:
AHVzZXJpZABwYXNzd29yZA==
Copy the output string so it can be pasted into the AUTH step below.

  1. telnet host-to-test 25 (connect to port 25 on mail server)
  2. HELO sending-host
  3. AUTH PLAIN Base64-encoded ID/password
  4. MAIL FROM: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
  5. RCPT TO: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
  6. DATA
    (enter one blank line after DATA)
  7. Subject: test
    To: to-user
    From: from-user
    (enter one blank line after From:) test text for email
    . (enter a single period by itself on the last line)
  8. QUIT
   
       
         
 

Copyright © 2006,2007 Linux Box Admin.

 
My NHL fan blog