付録D. シナリオ (Scenarios)
この付録は、プロトコル操作を説明するための典型的なSMTPトランザクションシナリオを提示する。
D.1. 典型的なSMTPトランザクションシナリオ (A Typical SMTP Transaction Scenario)
シナリオ: [email protected] が [email protected] にメールを送信する
# 接続確立
C: <server.exampleのポート25へのTCP接続を確立>
S: 220 server.example ESMTP Postfix
# クライアントグリーティング
C: EHLO client.example
S: 250-server.example
S: 250-SIZE 52428800
S: 250-8BITMIME
S: 250-STARTTLS
S: 250 HELP
# メールトランザクション
C: MAIL FROM:<[email protected]>
S: 250 2.1.0 Ok
C: RCPT TO:<[email protected]>
S: 250 2.1.5 Ok
# メッセージコンテンツ
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: Alice <[email protected]>
C: To: Bob <[email protected]>
C: Subject: Hello
C: Date: Wed, 24 Dec 2024 10:00:00 +0000
C:
C: Hi Bob,
C:
C: This is a test message.
C:
C: Best regards,
C: Alice
C: .
S: 250 2.0.0 Ok: queued as A1B2C3D4E5
# セッション終了
C: QUIT
S: 221 2.0.0 Bye
D.2. 中止されたSMTPトランザクションシナリオ (Aborted SMTP Transaction Scenario)
シナリオ: 送信者が途中でトランザクションを中止する
S: 220 server.example ESMTP
C: EHLO client.example
S: 250 server.example
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 550 5.1.1 User unknown
# 送信者が中止してやり直すことを決定
C: RSET
S: 250 Ok
# 新しいトランザクションを開始
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: DATA
S: 354 Start mail input
C: (メッセージコンテンツ)
C: .
S: 250 Ok: queued as XYZ123
C: QUIT
S: 221 Bye
D.3. リレーされたメールシナリオ (Relayed Mail Scenario)
シナリオ: [email protected] から [email protected] へのメールが relay.example 経由で送信される
ステップ1: origin.example → relay.example
C: EHLO origin.example
S: 250 relay.example
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok (リレーが転送を受け入れる)
C: DATA
S: 354 Start mail input
C: (メッセージ)
C: .
S: 250 Ok: queued for relay
ステップ2: relay.example → final.example
# relay.exampleが今度はクライアントとして機能
C: EHLO relay.example
S: 250 final.example
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: DATA
S: 354 Start mail input
C: Received: from origin.example by relay.example; ...
C: (元のメッセージ)
C: .
S: 250 Ok: delivered to bob
C: QUIT
S: 221 Bye
D.4. 検証と送信のシナリオ (Verifying and Sending Scenario)
シナリオ: クライアントが送信前にアドレスを検証する
S: 220 server.example ESMTP
C: EHLO client.example
S: 250 server.example
# 受信者が存在するか検証
C: VRFY bob
S: 250 Bob Smith <[email protected]>
# メールを送信
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: DATA
S: 354 Start mail input
C: (メッセージ)
C: .
S: 250 Ok
C: QUIT
S: 221 Bye
代替: VRFYがセキュリティのために無効化されている場合
C: VRFY bob
S: 252 2.5.2 Cannot VRFY user, but will accept message
# クライアントはそれでも続行する
C: MAIL FROM:<[email protected]>
S: 250 Ok
...