跳到主要內容

smtp protocol 簡介

SMTP Protocol
(sonet.all@gmail.com)





1.  Find MX Record




nslookup


> set q=mx
> program.com.tw


Server: 127.0.1.1
Address: 127.0.1.1#53


Non-authoritative answer:
program.com.tw mail exchanger = 5 se2.program.com.tw.
program.com.tw mail exchanger = 10 mail.program.com.tw.


<>


nslookup -q=mx yahoo.com
nslookup -q=mx google.com




2. SMTP Protocol (Simple Mail Transfer Protocol)






b. Example of the SMTP Procedure


S: EHLO program.com.tw
R: 250-se2.program.com.tw
    250-PIPELINING
    250-8BITMIME
    250 SIZE 52428800


S: MAIL FROM:
R: 250 OK


S: RCPT TO:
R: 250 OK


S: RCPT TO:
R: 504 Authentication failed for SMTP service. --> (system logout)


S: RCPT TO:
R: 550 User (test_account@program.com.tw) unknown.


S: DATA
R: 354 Start mail input; end with .
           
From: luke@program.com.tw
To: TEST
Subject: [測試信件]
Content-Type: text/plain; charset="utf-8"


您好,
=============================================
.  <-- n.="" n="" r="" span="">
R: 250 OK



3. MIME(Multipurpose Internet Mail Extensions)






MIME-Version: 1.0
Received: by 10.52.168.69 with HTTP; Wed, 17 Apr 2013 20:07:28 -0700 (PDT)
Date: Thu, 18 Apr 2013 11:07:28 +0800
Delivered-To: sonet.all@gmail.com
Message-ID:
Subject: for demo
From: =?UTF-8?B?6Jab5YWx5ZKMKGx1a2Up?=
To: =?UTF-8?B?6Jab5YWx5ZKMKGx1a2Up?=
Content-Type: multipart/mixed; boundary=
20cf307cfbe2188ff404da99e72b
--20cf307cfbe2188ff404da99e72b
Content-Type: multipart/alternative; boundary=20cf307cfbe2188ff004da99e729
--20cf307cfbe2188ff004da99e729
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64

5ris6Kmm5aS+5qqUDQoNCi0tIA0KDQp+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+DQogICBCMkMg6Zu75a2Q55m856WoIOWKoOWAvOacjeWLmeS4reW/gyAgKOW+rueoi+W8j+acg+WToSkNCg0KTGlmZSsg6IGw5piO5oiR55qE5raI6LK755Sf5rS777yBaHR0cDovL3d3dy5saWZlcGx1cy50dw0Kfn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fg0K
--20cf307cfbe2188ff004da99e729
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: base64

PGRpdiBkaXI9Imx0ciI+PGRpdj48YnI+PC9kaXY+5ris6Kmm5aS+5qqUPGJyIGNsZWFyPSJhbGwiPjxkaXY+PGJyPjwvZGl2Pi0tIDxicj48ZGl2Pjxicj48L2Rpdj48ZGl2Pn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn48L2Rpdj48ZGl2PsKgIMKgQjJDwqDpm7vlrZDnmbznpagg5Yqg5YC85pyN5YuZ5Lit5b+DIMKgKOW+rueoi+W8j+acg+WToSnCoDwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+TGlmZSsg6IGw5piO5oiR55qE5raI6LK755Sf5rS777yBPGEgaHJlZj0iaHR0cDovL3d3dy5saWZlcGx1cy50dy8iIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3LmxpZmVwbHVzLnR3PC9hPjwvZGl2Pg0KPGRpdj5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+PC9kaXY+DQo8L2Rpdj4NCg==
--20cf307cfbe2188ff004da99e729--
--20cf307cfbe2188ff404da99e72b
Content-Type: application/octet-stream; name="=?UTF-8?B?5ZyW6KGoMS5kaWF+?="
Content-Disposition: attachment; filename="=?UTF-8?B?5ZyW6KGoMS5kaWF+?="
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hfncm3cs0

H4sIAAAAAAACA+1dzXLbRhK++ylYzHGVEeZ/JoqdchSn4qqN44qVbDYXFURCFDYQoAUh2/JhL3vdF9in2Lfa2sfY6RnKFklAIgkMTNjDVBKTHk5jwO4PX/f0dH/9zdvLbPQ6KedpkT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lm12fgcSXjncHKfeiIVhPzMjaeT+NyaojXt8XbO5wrWnAu3JZzkQgZBiER5h5ZlxHCnBRgXcT8USPBfTKjtsvahBtJJJefAAA=
--20cf307cfbe2188ff404da99e72b--


4. Mail to another host or mail to gmail




a. MTA (Message transfer agent)


# perl -MMIME::Base64 -e 'print encode_base64("steveweb")'
c3RldmV3ZWI=


# perl -MMIME::Base64 -e 'print encode_base64("123")'
MTIz


S: EHLO program.com.tw
R: 250-mail.program.com.tw
    250-PIPELINING
    250-8BITMIME
    250-AUTH=LOGIN
    250-AUTH LOGIN
    250-STARTTLS
    250 SIZE 1004288000


S: AUTH LOGIN
R: 334 VXNlcm5hbWU6


S: c3RldmV3ZWI=
R: 334 UGFzc3dvcmQ6


S: MTIz
R: 235 Authentication successful.


S: mail from: steveweb@program.com.tw <- span="">
R: 250 Sender <steveweb@program.com.tw> OK


S: rcpt to: sonet.all@gmail.com <- span="">
R: 250 Recipient <sonet.all@gmail.com> OK


S: data
R: 354 Start mail input; end with .
           
From: luke@program.com.tw
To: TEST
Subject: [測試信件]
Content-Type: text/plain; charset="utf-8"


您好,
=============================================
.  <-- n.="" n="" r="" span="">


QUIT



b. Secure SMTP over Transport Layer Security   


 The following dialog illustrates how a client and server can start a
  TLS session:

  S:
  C:
  S: 220 mail.imc.org SMTP service ready
  C: EHLO mail.example.com
  S: 250-mail.imc.org offers a warm hug of welcome
  S: 250-8BITMIME
  S: 250-STARTTLS
  S: 250 DSN
  C: STARTTLS
  S: 220 Go ahead
  C:
  C & S:
  C & S:
  C: EHLO mail.example.com
  S: 250-mail.imc.org touches your hand gently for a moment
  S: 250-8BITMIME
  S: 250 DSN



留言

這個網誌中的熱門文章

怎麼在網路上註冊成為youbike 會員?

新版官網請參考  怎麼在網路上註冊成為youbike 會員?   http://rd-program.blogspot.tw/2014/04/youbike.html 網路的申請步驟類似,下面將以網路申請來說明申請步驟:申請的時候需要準備悠遊卡、或晶片信用卡,以及手機門號。 1. 請先登入ubike網址: http://www.youbike.com.tw/ ,登入後選擇【正體中文】,要選英文也可以啦! 2. 在螢幕的右上角選擇【註冊】。 3.點擊【開始註冊】。 4. 點擊【同意】。(沒有其他選擇?) 5. 輸入您的【手機號碼】以及【認證碼】,然後按【送出】。這時候手機會收到ubike傳來的簡訊,通之驗證碼,有四個阿拉伯數字。 6. 輸入帳號(手機號碼)、驗證碼(ubike傳到手機的簡訊)、密碼,然後按【下一步】。 7. 還沒完成喔!這裡告訴你如何租車及還車的步驟。把螢幕拉到最下面,記得勾選【我已清楚瞭解租還車步驟】,然後按【下一步】。 8. 選擇悠遊卡或是晶片信用卡,然後輸入卡片號碼,卡片號碼請參卡畫面又下方的提示位置,請注意有些卡號可能已經模糊不清,可能無法輸入。每隻手機不只可以輸入一個卡號。 9. 填寫個人姓名及Email帳號,如果不想收到相關訊息就把前面的打勾取消。按【確認】按鈕。 10. 恭喜您註冊成功,可已開始使用YouBike了。

Youbike 線上註冊會員

Youbike 線上註冊會員 https://www.youbike.com.tw/cht/f61.html youbike sitemap   網站內容快速連結  場站地圖 場站列表 服務中心資訊 預計設站地點 媒體報導 活動情報 緊急通知 營運資訊 營運成果 關於YouBike 大事記 設備介紹 租還方式 費率說明 安全騎乘 分類列表 失物招領 YouBike協尋 加入會員 會員資料管理 YouBike電子報 騎乘記錄查詢 合作夥伴 友站連結 一般文件 APP 隱私權政策 連絡我們

107年資訊月傑出資訊人才獎

應景照片 微程式技術長薛共和,從賴清德院長手中接下資訊月「傑出資訊人才獎」