在終端下寄信
>>> echo 'Hello' | mutt -e 'my_hdr From: hello@rd <hello@rd>' -s "WK" hello@gmail.com -a <attach_file>
這時候 可能會出現 pinetry 圖形 提示你輸入 OpenPGP passphrase
archlinux mutt 官方提供的 mutt 套件 支援 IMAP, POP3, SMTP 不需要搭配其他軟體,就能完成收發信的工作。
照官方 wiki 的介紹設定 就可以讓 mutt 與 gmail 整合運作。
在 .muttrc 裡, 如果沒有設定密碼,在啟動 mutt 時會要求你輸入密碼。
gpg 對密碼加密
有一點需要注意,如果需要寄信, 在 .muttrc 必須設定 gmail 的密碼 才能順利地寄信。
如果不希望密碼是以 明碼 的方式存在 .muttrc 可以先用 gpg 先對 gmail 密碼加密 .muttrc Passwords management gpg
$ vi ~/.my-pwds
set my_pw_personal = ****
set my_pw_work = ****
$ gpg -e -r 'your-name' ~/.my-pwds
# 此時會在你的家目錄內產生 ~/.my-pwds.gpg
$ shred -xu ~/.my-pwds
Mail Server/Client 運作基本流程與協定
對於郵件的處理 一般被區分成幾個部分
- MUA: mail user agent (email client)
- MTA: mail transport agent (SMTP server)
- MRA: mail retrieval agent (POP/IM)
General overview of the mail processing chain
MUA
- Mutt
- Thunderbird
MTA
- exim
- postfix
- sendmail
- qmail
SMTP client
- msmtp
IMAP
- offlineimap
- getmail
- fetchmail