email 送信的網路協定是 SMTP (Simple Mail Transfer Protocol),在 1980 年代只有 ASCII 純文字,後續有 MIME、Secure STMP over TLS 等擴充,目前 RFC 是 RFC5321。
client ---TCP--> server
port 25、465、587 for TLS
是否加密可透過 negotiation 或 STARTTLS
使用 Gmail 帳號當 STMP server 為例
https://myaccount.google.com/lesssecureapps 啟用「less secure apps access」。(似乎不需要)- Mail Username: Gmail 帳號
- Mail Password: 如果有啟用兩段式認證,需要到 https://myaccount.google.com/apppasswords 產生送信時認證用的密碼。
- SMTP Server: smtp.gmail.com
- Use STARTTLS: Checked (連線一開始用明文,然後轉換成加密)
- SMTP Port: 587
- From Email Address: Also my personal Gmail email address
- To Address: My work email address
送信指令
- swaks (Swiss Army Knife SMTP) 是 Perl 寫的指令行工具,支援 STARTTLS 及認證。
- busybox sendmail
- sendmail
- mutt
- ssmtp
- telnet
- nc
https://www.netburner.com/learn/smtp-for-your-embedded-devices/
email 寄信整體流程
sending MUA –SMTP→ [ MSA → sending MTA] → receiving MTA] –SMTP→ MDA → Mailstore -POP/IMAP→ MUA
MUA: Message User Agent, 如
MSA: Message Submission Agent
SMTP (RFC 5321) 負責 message transport,只看信封或在上面加郵戳,不看信件內容。;而 RFC 5322 定義訊息內容本身。
沒有留言:
張貼留言