SMTP connection using telnet
August 2008
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
About
This site is an effort to share some of the base knowledge I have gathered through all this years working with Linux, FreeBSD, OpenBSD, Python or Zope, among others. So, take a look around and I hope you will find the contents useful.
Recent Entries
Recent Comments
Re: Aprender Python(foz : 08/20 00:03)
Re: bogofilter and the importance of HAM(Wu : 08/19 14:08)
Re: bogofilter and the importance of HAM(Juanjo : 08/18 19:52)
Re: From scripting to object-oriented Python programming(r0sk : 08/14 17:13)
Re: First Codigo23 sprint(r0sk : 08/13 22:54)
Re: I'll be at the djangocon(Wu : 08/11 16:21)
Will try(Milan Andric : 08/09 04:42)
Re: Problem with ssl in Python 2.5(Wu : 08/06 01:45)
Re: I'll be at the djangocon(Wu : 08/06 01:43)
Re: I'll be at the djangocon(pAvL0 : 08/05 19:59)
Other Weblogs
Recent Trackbacks
Categories
OpenBSD (7 items)
BSD (0 items)
FreeBSD (4 items)
Linux (0 items)
Security (3 items)
Python (7 items)
Zope (8 items)
Daily (36 items)
e-shell (3 items)
Hacks (4 items)
PostgreSQL (1 items)
OSX (6 items)
Nintendo DS (0 items)
enlightenment (0 items)
Apache (1 items)
Nintendo Wii (0 items)
Django (4 items)
Music (5 items)
Archives

Syndicate this site (XML)

RSS/RDF 0.91

10 julio
2008

SMTP connection using telnet

another reminder for my damaged brain...

Did you ever need to test a SMTP server quickly?

If the answer is yes, probably you had hear something about using telnet to send emails directly.

I've used this trick a thousand times myself, but I always forget the correct commands and the order I have to provide them to the SMTP server.

Transcription follows:

[Fenris] ~> telnet mail.e-shell.org 25
Trying 212.89.9.184...
Connected to mail.e-shell.org.
Escape character is '^]'.
220 [ ESMTP Codigo23 mail server ] - [ Will Hack Unix for food ]
ehlo localhost
250-Frey.e-shell.org Hello cm82227.red.mundo-r.com [213.60.82.227], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 5242880
250-DSN
250-STARTTLS
250-DELIVERBY
250 HELP
mail from: you@yahoo.com
250 2.1.0 you@yahoo.com... Sender ok
rcpt to: jarjarthisisnotmymail@e-shell.org
250 2.1.5 jarjarthisisnotmymail@e-shell.org... Recipient ok
data
354 Enter mail, end with "." on a line by itself
This is a sample mail sent to you via telnet!
.
250 2.0.0 m6AB3LDP071599 Message accepted for delivery

Explanation:

1- Connect to the server using telnet:

telnet mail.e-shell.org 25

2- Say hello to the server:

ehlo localhost

3- Tell the server who is sending the email:

mail from: you@yahoo.com

4- Then tell it the destination address:

rcpt to: jarjarthisisnotmymail@e-shell.org

5- Finally tell the server you are about to write the message contents:

data

NOTE: If you want to add a subject to your mail, just add a line like:

Subject: this is my subject

at the beginning of the body. You will need to press enter twice for it to work properly.

6- Once you are done, push enter, then add a single dot (.) and push enter again.

7- Mail sent!

(Anyone who can teach us how to do that using netcat??)

Posted by wu at 13:11 | Comments (0) | Trackbacks (0)
<< Noticias en prensa escrita | Main | Debugging your webapp, the funny way >>
Comments
There are no comments.
Trackbacks
Please send trackback to:http://blog.e-shell.org/81/tbping
There are no trackbacks.
Post a comment