swaks – Swiff army nife for SMTP

If you are having issues with the SMTP Server, then sometimes you just wish you had a swiss army knife to test the same and then you would not have to spend your precious time on some silly mistake that you may have made. Your wish is now fulfilled.

Swiss Army Knife SMTP: A command line SMTP tester.  Swaks can test various aspects of your SMTP server, including TLS and AUTH.

swaks can be easily installed with :

sudo yum install swaks

To begin with, if you want to test the localhost then simply enter swaks, you will be asked for \”to\” address. And then there will be a attempt to send the mail. And you can see the messages on the console. Here\’s an example:

To: =========================
=== Trying localhost:25…
=== Connected to ===============.
<-  220 amit.themafia.info ESMTP Exim 4.69 Sun, 07 Mar 2010 10:24:25 +0530
-> EHLO amit.themafia.info
<-  250-amit.themafia.info Hello
======================
<-  250-SIZE 52428800
<-  250-PIPELINING
<-  250-STARTTLS
<-  250 HELP
-> MAIL FROM
:===========================
<-  250 OK
-> RCPT TO
:================
<-  250 Accepted
-> DATA
<-  354 Enter message, ending with \”.\” on a line by itself
-> Date: Sun, 07 Mar 2010 10:24:25 +0550
-> To:=====================
-> From: ===================================
-> Subject: test Sun, 07 Mar 2010 10:24:25 +0550
-> X-Mailer: swaks v20061116.0 jetmore.org/john/code/#swaks
->
-> This is a test mailing
->
-> .
<-  250 OK id=1No8VV-0003bT-EC
-> QUIT
<-  221 amit.themafia.info closing connection
=== Connection closed with remote host.

For my own security, I have removed my email address and other things. Now, coming to other things.

Here are few of the options that you may find useful

-s ==> server

-f ==> from

-t ==> to

-l ==> input file

-d ==> data

–attach

-h ==> header

–protocol

HELO            AUTH    TLS     PORT
————————————————–
SMTP    HELO                            smtp  / 25
SSMTP   EHLO->HELO              -tlsc   smtps / 465
SSMTPA  EHLO->HELO      -a      -tlsc   smtps / 465
SMTPS   HELO                    -tlsc   smtps / 465
ESMTP   EHLO->HELO                      smtp  / 25
ESMTPA  EHLO->HELO      -a              smtp  / 25
ESMTPS  EHLO->HELO              -tls    smtp  / 25
ESMTPSA EHLO->HELO      -a      -tls    smtp  / 25
LMTP    LHLO                            lmtp  / 24
LMTPA   LHLO            -a              lmtp  / 24
LMTPS   LHLO                    -tls    lmtp  / 24
LMTPSA  LHLO            -a      -tls    lmtp  / 24

You can check other options in the man page or the help.

\"Reblog

14 thoughts on “swaks – Swiff army nife for SMTP”

  1. Hi there, I observe that your case is rather great as it contains a good deal of accurate information. Anyway, was wondering whether you would love to exchange web links with my web portal, as I am looking to compile more contacts to further enlarge and gain better web exposure for my web portal. I do not mind you placing my contacts at the homepage, just having this web links on this page is more than adequate. Anyway, would you please reach me at my web portal if you are keen in exchanging links with me, I would really appreciate that. Thank you to you and hopefully to get a reply from you as soon as possible!

  2. I enjoy your style, the particular fact that your website is a little bit distinctive tends to make it so useful, I get completely fed up of discovering same-old-same-old almost all almost daily. I have I merely happened on this web page by you Thank you.

  3. I see really quite a number of blogs that look interesting and really worth a read. There is absolutely nothing worse than sifting through countless blah blah blogs simply to find a couple that hold ones interest. Thanks. Good job!

  4. Very good information and facts, many thanks to the author. The idea is puzzling to me today, but in general, the usefulness and importance is overwhelming. Very much thanks once again and all the best .!