2007-12-28
■[comp] Mew 3.3 + stunnel
というわけで [2007-12-03],正月休みを待たずに早速入れてみた.何も考えずに make && make install でおk.
.mew.el もそのまま使えている.いい感じだ.
stunnel に関しては,
(setq mew-smtp-ssl t) (setq mew-ssl-cert-directory "/usr/local/etc/stunnel/") (setq mew-prog-ssl "/usr/local/sbin/stunnel") (setq mew-smtp-user "username") (setq mew-smtp-server "smtp.example.org") (setq mew-smtp-ssl-port "465") (setq mew-ssl-verify-level 0) (setq mew-ssl-verify-version 0)
みたいな感じでうまくいった.Mew 自身から stunnel で直接叩けるのは確かにありがたい.
ちなみに mew-ssl-verify-level と mew-ssl-verify-version を 0 にしないと,なぜか
(Cannot create to the SSL connection)
が出るほか,*Mew Debug* でも
VERIFY ERROR
が出てうまく接続できなかったので注意.
あと,mhc が mew-3.3 で廃止された関数 mew-match を使ってるせいでエラー吐いた.ので,やっつけで以下のように修正してみた (最新版を取って来れば済む話だけど,最新版の使い勝手があまり好きではないので).なぜかバイトコンパイルしたらエラーが出るので,そのまま使う.
--- mhc-mew.el.orig Mon Feb 18 19:46:44 2002
+++ mhc-mew.el Wed Dec 26 21:20:13 2007
@@ -50,6 +50,9 @@
(add-hook 'mew-virtual-mode-hook 'mhc-mode)
(add-hook 'mew-quit-hook 'mhc-exit))
+(if (fboundp 'mew-match)
+ (defalias 'mhc-mew/match-string 'mew-match)
+ (defalias 'mhc-mew/match-string 'match-string))
;; Backend methods:
@@ -260,7 +263,8 @@
(when (and ct (string-match "^multipart/" ct)
(or (string-match "boundary=\"\\([^\"]+\\)\"" ct)
(string-match "boundary=\\(.+\\)" ct)))
- (setq boundary (regexp-quote (mew-match 1 ct)))
+; (setq boundary (regexp-quote (mew-match 1 ct)))
+ (setq boundary (regexp-quote (mhc-mew/match-string 1 ct)))
(let ((case-fold-search nil))
(unless (and boundary
(re-search-forward (concat "^--" boundary "$") nil t)
@@ -365,9 +369,12 @@
(setq tmpstr (substring string (match-end 0)))
(setq ret (concat ret
(substring string 0 (match-beginning 0))
- (mew-header-decode (mew-match 1 string)
- (mew-match 2 string)
- (mew-match 3 string))))
+; (mew-header-decode (mew-match 1 string)
+; (mew-match 2 string)
+; (mew-match 3 string))))
+ (mew-header-decode (mhc-mew/match-string 1 string)
+ (mhc-mew/match-string 2 string)
+ (mhc-mew/match-string 3 string))))
(setq string tmpstr)))
ret))
関連記事: