在Windows下让Mew 6.7兼容stunnel 5.x
Mew号称支持stunnel 5.x,但实际是有bug的。emacswiki上的解决方案是注释掉mew-ssl.el
里Windows平台不支持的属性,作者自己也说是quick’n’dirty。我认为比较优雅的方式是把注释后的函数写到mew.el
文件里,就是下面的函数。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| (defun mew-ssl-options (case server remoteport localport tls) (setq server (mew-ssl-server server)) (if (= mew-ssl-ver 3) (let (args) (setq args `("-c" "-f" "-a" ,(expand-file-name (mew-ssl-cert-directory case)) "-d" ,(format "%s:%d" mew-ssl-localhost localport) "-v" ,(number-to-string (mew-ssl-verify-level case)) "-D" "debug" "-P" "" "-r" ,(format "%s:%d" server remoteport) ,@mew-prog-ssl-arg)) (if tls (setq args (cons "-n" (cons tls args)))) args) (let ((file (mew-make-temp-name))) (with-temp-buffer (insert "client=yes\n") (insert (format "verify=%d\n" (mew-ssl-verify-level case))) (insert "debug=debug\n") (if (and mew-ssl-libwrap (or (>= mew-ssl-ver 5) (>= mew-ssl-minor-ver 45))) (insert "libwrap=no\n")) (insert "CApath=" (expand-file-name (mew-ssl-cert-directory case)) "\n") (if mew-prog-ssl-arg (insert mew-prog-ssl-arg)) (insert (format "[%d]\n" localport)) (insert (format "accept=%s:%d\n" mew-ssl-localhost localport)) (insert (format "connect=%s:%d\n" server remoteport)) (if tls (insert (format "protocol=%s\nsslVersion=TLSv1\n" tls))) (mew-frwlet mew-cs-dummy mew-cs-text-for-write (write-region (point-min) (point-max) file nil 'no-msg)) (list file)))))
|
或者您可以把评论发在别处,添加指向本页的连接,然后把网址告诉我:
本文标题:在Windows下让Mew 6.7兼容stunnel 5.x
文章作者:Chris
发布时间:2016-05-07
最后更新:2022-03-23
原始链接:https://chriszheng.science/2016/05/07/Mew-6-7-and-stunnel-5-x/
版权声明:本博客所有文章除特别声明外,均采用 CC BY 4.0 许可协议。转载请注明出处!
分享