5分钟教你配置命令行界面的163邮箱客户端

网易163免费邮箱相关服务器信息:



mutt 是命令行下的邮件客户端,它仅是管理邮件的组织编辑,邮件的发送和接收需要调用对应的程序。

这里用的分别是getmail 和 msmtp.


步骤如下
=====


1. 安装mutt, getmail, msmtp

======================

$ sudo yum -y install mutt getmail msmtp


2. Build Mail Dir

==================
  Create ~/Mail directory:
  $ mkdir -m 700 ~/Mail/inbox/{,tmp,new,cur}


3. Configure getmail

=====================
  Reference:
  $ mkdir ~/.getmail
  $ cd ~/.getmail
  $ vi getmailrc.163


  [retriever]
  type = SimplePOP3SSLRetriever
  server = pop.163.com
  port = 995
  username = username
  password = password


  [destination]
  type = Maildir
  path = ~/Mail/inbox/


  [options]
  verbose = 0
  # don't delete messages on server.
  delete = false
  # don't retrieve all available message.
  read_all = false
  message_log = ~/.getmail/getmail.log


4. Config ~/.msmtprc

=====================


  $ touch ~/.msmtprc
  $ chmod 600 ~/.msmtprc

  $ vi ~/.msmtprc


account 163
tls on
tls_certcheck off
tls_starttls off
auth on
host smtp.163.com
user username
from username@163.com
password password
port 465

5. add the following lines to ~/.muttrc

========================================


  set folder=~/Mail
  mailboxes +inbox
  mailboxes +linux
  set sendmail="/usr/bin/msmtp"
  # the mail_address name displayed on the mail list.
  set from="mail_address"
  set pager_stop=yes
  set beep=no
  set signature="~/.signature"
  set copy
  set edit_headers
  set fast_reply
  set help
  set include=yes
  bind index \cr search-opposite
  bind index \cs search-next
  bind pager \cr search-opposite
  bind pager \cs search-next
  bind pager \er read-thread
  bind index \er read-thread
  macro index G "!getmail -r ~/.getmail/getmailrc.163\n" "Invoke getmail"
  # append address to Cc.
  my_hdr Cc: address

注:查看muttrc的选项可以使用 man muttrc,

比如 editor 选项可以修改对应的编辑器。


6. getmail

===========


  Use cron or other programs to run getmail to check out mail.


  getmail command
  $ getmail -r ~/.getmail/getmailrc.163


  fetch the mail every two minutes.
  $ crontab -e
  */2 * * * * getmail -r ~/.getmail/getmailrc.163


  mailbox can't be processed in one config file. But mulitple config
  file can be processed.


7. run mutt

============

  $ mutt -y


注:这里指定列出所有 MailBox, 如果仅仅是 ~/Mail/inbox的话,可以使用

  $ mutt -f ~/Mail/inbox/

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值