Intro to Socket basics




SMTP client:

-bash-3.2$ telnet 25


Connected to

Escape character is '^]'.

220 ESMTP Sendmail 8.14.3/8.14.2; Fri, 8 Jan 2010 14:13:46 -0500

helo Z

250 Hello [], pleased to meet you

mail from:<>

250 2.1.0 <>... Sender ok

rcpt to:<>

250 2.1.5 <>... Recipient ok


354 Enter mail, end with "." on a line by itself

helo, this is a test.


250 2.0.0 o08JDkHp008049 Message accepted for delivery

Here "helo Z" can be replaced to "helo [your machine's DNS name or IP address]" which conforms to the RFC specification. Some server may reject your email if you do not follow this rule.

"mail from:<>" can be replaced with "mail from:<ANY EMAIL ADDRESS>". This is a known problem with SMTP protocol. Most servers nowadays have some mechanisms to protect against it, but clearly this server does not.

"rcpt to:<>" can be replaced with "rcpt to:<>". It has to be because is the mail server serving only accounts with

Please do not abuse it, e.g. send me spam messages :)

DNS lookup program:

-bash-3.2$ dig


; IN A

;; ANSWER SECTION: 241754 IN CNAME 65 IN A 65 IN A 65 IN A 65 IN A 65 IN A 65 IN A dig is a built-in command line tool on *nix platform. Check "man dig" for the manual page.

Wireshark packets capture program:

Wireshark Homepage It's a very useful tool that helps learn computer network a lot.