Skip to content

Instantly share code, notes, and snippets.

@jedipunkz
Last active December 20, 2015 22:48
Show Gist options
  • Save jedipunkz/6207781 to your computer and use it in GitHub Desktop.
Save jedipunkz/6207781 to your computer and use it in GitHub Desktop.
Emacs + Mew で Gmail 読み書き
Emacs + Mew で Gmail を読み書きする方法
====
Gmail を Emacs + Mew で読み書きする方法をメモしておきます。Gmail はブラウザで
読み書き出来るのに!と思われるかもしれませんが、Emacs で文章が書けるのは素晴ら
しいことです。:D
対象 OS
----
* Debian Gnu/Linux
* Ubuntu
手順
----
Emacs, Mew, stunnel4 をインストールします。Emacs は好きな物を入れてください。
% sudo apt-get install emacs24-nox stunnel4 mew-bin ca-certificates
openssl コマンドで mail.pem を生成します。生成したものを /etc/stunnel 配下に設
置します。
% openssl req -new -out mail.pem -keyout mail.pem -nodes -x509 -days 365
% sudo cp mail.pem /etc/stunnel/
stunnel はインストール直後、起動してくれないので ENABLE=1 に修正します。
% sudo ${EDITOR} /etc/default/stunnel4
ENABLE=1 # 0 -> 1 へ変更
stunenl.conf のサンプルを /etc/stunnel 配下に設置します。
% sudo cp /usr/share/doc/stunnel4/examples/stunnel.conf-sample /etc/stunnel/stunnel.conf
$HOME/.mew.el ファイルを生成します。自分のアカウント情報などを入力します。
; Stunnel
(setq mew-prog-ssl "/usr/bin/stunnel4")
; IMAP for Gmail
(setq mew-proto "%")
(setq mew-imap-server "imap.gmail.com")
(setq mew-imap-user "example@gmail.com")
(setq mew-imap-auth t)
(setq mew-imap-ssl t)
(setq mew-imap-ssl-port "993")
(setq mew-smtp-auth t)
(setq mew-smtp-ssl t)
(setq mew-smtp-ssl-port "465")
(setq mew-smtp-user "example@gmail.com")
(setq mew-smtp-server "smtp.gmail.com")
(setq mew-fcc "%Sent") ; 送信メイルを保存する
(setq mew-imap-trash-folder "%[Gmail]/ゴミ箱")
(setq mew-use-cached-passwd t)
(setq mew-ssl-verify-level 0)
$HOME/.emacs.d/init.el に Mew の記述を追記します。
(setq load-path (cons "/usr/local/share/emacs/site-lisp/mew/" load-path))
(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
(setq mew-fcc "+outbox") ; 送信メールを保存
(setq exec-path (cons "/usr/bin" exec-path))
Emacs + Mew を起動します。
% emacs -e mew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment