• 2007-12-13

    Emacs 23 -Gnus 邮件,新闻组,RSS - [Emacs]

     原来一直在用thunderbird,用的也不错,不过gnus也很方便,呵呵

     版本
     emacs23 ,gnus目前是emacs自带的但是一直无法收邮件,所以去主页下了个最新的,
     配置成功,可以收发gmail.

     下载后解压 ./configure&make  ,之后我把此文件夹放到.emacs.d/site-lisp,这个
      自己可以随意放,下面目录对应就可以了

     在.emacs中加入
     (setq load-path (cons (expand-file-name "~/.emacs.d/site-lisp/ngnus-0.6/lisp")
    load-path))
    (require 'gnus-load)

     创建自己的~/.gnus.el,其实也可以放在.emacs中,但是建议分开来
     内容如下
     ;;; .gnus.el --- gnus configure file

    ;; Copyright (C) 2007  fxl

    ;; Author: fxl <fxlzju@gmail.com>
    ;; Keywords: mail, news,

    ;; for newsgroup
    (setq gnus-select-method '(nntp "news.cn99.com"))

    ;; for mail
    (setq gnus-secondary-select-methods '((nnfolder "")))


    (setq gnus-use-cache 'passive)

    (gnus-add-configuration '(article
                              (vertical 1.0
                                        (summary .4 point)
                                        (article 1.0))))

    (setq gnus-thread-sort-functions
          '(
            (not gnus-thread-sort-by-date)
            (not gnus-thread-sort-by-number)
            ))

    ;; chinese font set
    (setq gnus-default-charset 'chinese-iso-8bit
       gnus-group-name-charset-group-alist '((".*" . chinese-iso-8bit))
       gnus-summary-show-article-charset-alist
           '((1 . chinese-iso-8bit)
             (2 . gbk)
             (3 . big5)
             (4 . utf-8))
           gnus-newsgroup-ignored-charsets
           '(unknown-8bit x-unknown iso-8859-1))

    ;; only see the text plain if sended with html format
    (eval-after-load "mm-decode"
      '(progn
         (add-to-list 'mm-discouraged-alternatives "text/html")
         (add-to-list 'mm-discouraged-alternatives "text/richtext")))

    (setq gnus-default-subscribed-newsgroups
      '("gnu.emacs.help"
        "cn.comp.os.linux"))

    (setq user-full-name "yourname") ;; 外发的邮件采用这个名字
    (setq user-mail-address "your@gmail.com")
    ;; save the mail on web server
    (setq pop3-leave-mail-on-server t)
    (setq mail-sources
      '((pop :server "pop.gmail.com"
             :port 995
             :user "your@gmail.com"
             :connection ssl
             :leave t)))


    (setq gnus-message-archive-group
          '((if (message-news-p)
              "nnfolder:mail.sent.news"
              "nnfolder:mail.sent.mail")))

    (setq message-send-mail-function 'smtpmail-send-it)
    (setq smtpmail-default-smtp-server "smtp.gmail.com")
    (setq smtpmail-smtp-service 587)
    (setq smtpmail-starttls-credentials
      '(("smtp.gmail.com"
         587
         nil
         nil)))
    (setq smtpmail-auth-credentials
      '(("smtp.gmail.com"
         587
         "your@gmail.com"
         nil)))

    (setq gnus-posting-styles
          '((".*"
             (name "name")
             (face "")
             (address "your@gmail.com")
             (organization "cesc")
             (signature-file "~/Mail/signature")
         )))

      执行 M-x gnus 就可以拉,开始收邮件,更多信息可以google 或者 C-h i->Gnus 帮助

    收藏到:Del.icio.us