GNU/Linux 下超酷又灵活的 Email 系统
来自Jack's Lab
目录 |
1 概述
简单地说就是:fetchmail 从邮件服务器取邮件到本地,经 procmail 过滤分捡后写入相应的 mailbox 文件,邮件客户端 Mutt 读取 mailbox 文件并与用户交互,使用 ssmtp 联系邮件服务器发邮件
fetchmail + procmail + Mutt + Exim4 的方案个人用了 7 年多,效率高,非常适合 Hacker/Geeker
近来发现 sSMTP 更好用,配置简单,风格和 fetchmail 类似,很自然地切到了 sSMTP
2 fetchmail 取邮件
fetchmail 的默认配置文件位于当前用户主目录下,即:$HOME/.fetchmailrc,没有可自己建一个
例如,我的 gmail 账户的 $HOME/.fetchmailrc 例子:
set postmaster "comcat" set bouncemail set no spambounce set properties "" set daemon 60 poll imap.gmail.com protocol IMAP port 993 auth password user "YOUR_GMAIL_USERNAME@gmail.com" there with password 'YOUR_GMAIL_PASSWD' is 'comcat' here options no fetchall keep ssl mda "/usr/bin/procmail -f %F -d %T"
3 procmail 分捡邮件
4 Mutt 读邮件
5 sSMTP 发邮件
$ sudo apt-get install ssmtp $ vim /etc/ssmtp/ssmtp.conf
# The place where the mail goes. The actual machine name is required no # MX records are consulted. Commonly mailhosts are named mail.domain.com Root=postmaster # Redirect mail for root@ to postmaster@ Mailhub=smtp.gmail.com:587 # TLS AuthUser=YOUR_GMAIL_USERNAME # Your DreamHost mail account AuthPass=YOUR_GMAIL_PASSWORD # The password for the mail account UseTLS=YES # Secure connection (SSL/TLS) UseSTARTTLS=YES rewriteDomain=jackslab.org # The host the mail appears to be coming from, seems like gmail can not be rewrited hostname=jackslab.org # The name of this host FromLineOverride=YES # Allow the user to specify their own From: address, seems like gmail is not allow