Emacs gnus 的日常使用

Table of Contents

读取Gmail邮件

主要架构: offlineimap同步邮件, gnus读邮件

offlineimap配置

  1. mac安装: brew install offlineimap
  2. 配置 ~/.offlineimaprc
[general]
ui = ttyui
accounts = Gmail

[Account Gmail]
localrepository = Gmail-Local
remoterepository = Gmail-Remote

[Repository Gmail-Local]
type = Maildir
localfolders = ~/lx/Gmail

[Repository Gmail-Remote]
type = Gmail
remoteuser = 邮箱
remotepass = 密码
realdelete = no
maxconnections = 3
# 下面这行使用与OS X系统
sslcacertfile = /usr/local/etc/openssl/cert.pem
  1. 同步命令: offlineimap -o 第一次运行这个命令有可能会报错, 显示 "Gmail SMTP debug: error “please log in via your web browser" 这样的内容, 可以去https://www.google.com/settings/security/lesssecureapps 打开enable on这个选项, 就可以了. 第一次同步可能很长时间, 尤其是对国人来说. 耐心等候啦.

配置

  ;; Gnus配置
(setq gnus-select-method
   '(nnmaildir "Gmail" (directory "~/lx/Gmail")))

订阅RSS

在Gnus页面可以使用快捷键"G R"来订阅RSS.通过"u"取消订阅.

订阅atom文件

gnus对于atom类型的RSS支持不好, 可以通过在以下方式解决

  1. Install xsltproc (Debian: apt-get install xsltproc)
  2. Get the file atom2rss.xsl from http://atom.geekhood.net/ and save it.
  3. Put the following code into your .gnus:

    (require 'mm-url)
    (defadvice mm-url-insert 
       (after DE-convert-atom-to-rss () )  
       "Converts atom to RSS by calling xsltproc."  
       (when 
          (re-search-forward
             "xmlns=\"http://www.w3.org/.*/Atom\"" 
              nil t)
          (goto-char (point-min))    
          (message "Converting Atom to RSS... ")    
          (call-process-region 
             (point-min) 
             (point-max) 
             "xsltproc" 
             t t nil 
             (expand-file-name 
                "~/.emacs.d/atom2rss.xsl") "-")    
          (goto-char (point-min))    
          (message 
             "Converting Atom to RSS... done")))
    (ad-activate 'mm-url-insert)
    

gnus 快捷键

  说明
C-u N ret 在目录上使用,显示目录(N封)所有邮件
c 标记未读为已读
C 标记所有为已读
l 只显示有未读邮件的group
L 显示所有group
B DEL 永久删除
B m 移动邮件
E 设置邮件为Expirable
u 标记重要邮件
u放到link上 复制链接地址

Created At <2015-12-21 Mon 23:25> by Luis Xu. Email: xuzhengchaojob@gmail.com