日本語資料としては「Studying HTTP」を良く参照させて貰っている。
Windowsのコマンドプロンプトから叩く例:
DOS> telnet Microsoft Telnet> set localecho ローカル エコー: オン Microsoft Telnet> o ( to ) www.google.com 80 接続中: www.google.com... GET / HTTP/1.1 Host: www.google.com HTTP/1.1 302 Found Location: http://www.google.co.jp/ ... Microsoft Telnet> q
途中、表示が著しく崩れたりするので注意。
telnet例
$ telnet smtp.example.com 25 220 smtp.example.com ESMTP Postfix > HELO relay.example.org 250 Hello relay.example.org, I am glad to meet you > MAIL FROM:<bob@example.org> 250 Ok > RCPT TO:<alice@example.com> 250 Ok > RCPT TO:<theboss@example.com> 250 Ok > DATA 354 End data with <CR><LF>.<CR><LF> > From: "Bob Example" <bob@example.org> > To: Alice Example <alice@example.com> > Cc: theboss@example.com > Date: Tue, 15 Jan 2008 16:02:43 -0500 > Subject: Test message > (空行改行) > Hello Alice. > This is a test message with 5 headers and 4 lines in the body. > Your friend, > Bob > . 250 Ok: queued as 12345 > QUIT 221 Bye
APOPではない平文パスワードでの例
$ telnet pop3.example.com 110 +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us> > USER foo +OK User accepted > PASS bar +OK Pass accepted > STAT +OK 2 320 > LIST +OK 2 messages (320 octets) 1 120 2 200 . > RETR 1 +OK 120 octets ... > DELE 1 +OK message 1 deleted > QUIT +OK dewey POP3 server signing off (maildrop empty)
Linux系のPOP3メールサーバは、inetd/xinetd経由で起動される構成になっている場合が多い。
上手く接続できない場合は、/etc/inetd.conf または /etc/xinetd.conf/ディレクトリ以下の設定ファイルも確認してみると良い。