Personal tools
You are here: Home ブログ matsuyama Emacs + Mew + Fetchmail + Procmailなメール環境
Document Actions

Emacs + Mew + Fetchmail + Procmailなメール環境

Fetchmailとはその名のとおりメールサーバーからメールをダウンロードするプログラムであり、Procmailは入力されたメールをユーザー指定のフィルタによって配分するプログラムです。これまでは個人でメールを受信するにしても面倒なローカルサーバーをたてたりしていましたが、FetchmailとProcmailを組合せることにより、ローカルサーバーをたてることなしにMaildir形式でメールを取り込むことができるようになりました。最小の設定は以下のようになります。

~/.fetchmailrc:

defaults
  protocol pop3
  keep # keep mails on the server
  no mimedecode
  mda "/usr/bin/procmail"

poll pop.example.com
  username example
  passward example

~/.procmailrc:

MAILDIR=$HOME/.maildir

これで

% fetchmail

とすれば.maildirにメールを取り込むことができます。次にMewの設定をします。

~/.emacs:

(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
(setq mew-name "example")
(setq mew-user "example")
(setq mew-mail-domain "example.com")
(setq mew-smtp-server "smtp.example.com")
(setq mew-mailbox-type 'mbox)
(setq mew-mbox-command "incm")
(setq mew-mbox-command-arg "-u -d /home/example/.maildir")

これで、EmacsからM-x mewでMaildirにあるメールを閲覧することができます。Maildirにメールを取り込むにはその都度fetchmailする必要がありますが、一々ターミナルに移動するのが面倒でしたら

~/.emacs:

(defun fetchmail ()
  (interactive)
  (shell-command "fetchmail")
)

を定義しておけばいいでしょう。shell-commandのあとにmewを呼び出すとbetterかもしれません。

Category(s)
linux
emacs
The URL to Trackback this entry is:
http://dev.ariel-networks.com/Members/matsuyama/emacs-mew-fetchmail-procmail306a30e130fc30eb74b05883/tbping
Add comment

You can add a comment by filling out the form below. Plain text formatting.

(Required)
(Required)
(Required)
(Required)
(Required)
This helps us prevent automated spamming.
Captcha Image


Copyright(C) 2001 - 2006 Ariel Networks, Inc. All rights reserved.