Q. 電子メールはどうして届くの?
A. 電子メールを配送する方法である, SMTP プロトコルは RFC 821 で定義されている. これを実例を用いて, 解説しよう.
bash$ telnet localhost smtp Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 yama2 ESMTP Sendmail 8.9.3/8.9.3; Sun, 18 Mar 2001 20:53:25 +0900 (JST) helo yama2.math.kobe-u.ac.jp 250 yama2 Hello localhost [127.0.0.1], pleased to meet you mail from: <taka@math.kobe-u.ac.jp> 250 <taka@math.kobe-u.ac.jp>... Sender ok rcpt to: <nobuki@math.kobe-u.ac.jp> 250 <nobuki@math.kobe-u.ac.jp>... Recipient ok data 354 Enter mail, end with "." on a line by itself To: nobuki@math.kobe-u.ac.jp From: taka@math.kobe-u.ac.jp This is a test mail. . 250 UAA00422 Message accepted for delivery QUIT 221 yama2 closing connection Connection closed by foreign host.
うけとられたメール.
--MAB69108.984887372/durian.math.sci.kobe-u.ac.jp--
From taka@math.kobe-u.ac.jp Sun Mar 18 20:52:59 2001
Received: from durian.math.sci.kobe-u.ac.jp (durian.math.sci.kobe-u.ac.jp [10.1.254.3])
by orange.math.sci.kobe-u.ac.jp (8.9.3/3.7W) with ESMTP id UAA17807
for <nobuki>; Sun, 18 Mar 2001 20:52:58 +0900 (JST)
Received: from yama2 (h140.p048.iij4u.or.jp [210.130.48.140])
by durian.math.sci.kobe-u.ac.jp (8.9.3/3.7W) with ESMTP id UAA70071
for <nobuki@math.kobe-u.ac.jp>; Sun, 18 Mar 2001 20:52:58 +0900 (JST)
Received: from yama2.math.kobe-u.ac.jp (localhost [127.0.0.1])
by yama2 (8.9.3/8.9.3) with SMTP id UAA00422
for <nobuki@math.kobe-u.ac.jp>; Sun, 18 Mar 2001 20:53:46 +0900 (JST)
(envelope-from taka@math.kobe-u.ac.jp)
Date: Sun, 18 Mar 2001 20:53:46 +0900 (JST)
From: taka@math.kobe-u.ac.jp
Message-Id: <200103181153.UAA00422@yama2>
To: nobuki@math.kobe-u.ac.jp
This is a test mail.
メールの本文は RFC822 にさだめられたフォーマットでないといけない.