[mew-int 2357] Initialization of mew-ssl-ver
Harald Hanche-Olsen
hanche at example.com
Thu Sep 6 05:28:57 JST 2007
Just got bitten by this one ... I had somehow mangled my PATH, so
when I ran mew in a new emacs, it couldn't find 'stunnel' and duly
complained about it. However, after fixing the path and even trying
to set mew-prog-ssl to the absolute path of the stunnel program, it
still insisted that the program is not found.
This was mew version 5.2. If the problem has been fixed since, I
guess you can stop reading now. 8-)
The problem seems to be with mew-ssl-setup, which when called sets
mew-ssl-ver to nil if the stunnel program cannot be found, and with
mew-open-ssl-stream, which has the form
(cond
((not (and (stringp server) (stringp serv)))
nil)
((or (null mew-ssl-ver) (not (mew-which-exec mew-prog-ssl)))
(message "'%s' is not found" mew-prog-ssl)
nil)
(t ... do the real work ...))
so if mew-ssl-ver is nil, it complains, and you have no way to correct
the situation, other than to run (mew-ssl-setup) manually, or
mew-status-update (hard to guess), or to restart emacs.
I am actually puzzled as to the test
(or (null mew-ssl-ver) (not (mew-which-exec mew-prog-ssl)))
in there: If mew-ssl-ver is not null, then mew-ssl-setup has already
been run, and it has checked (mew-which-exec mew-prog-ssl) to see that
the program can be found. So the only purpose of checking again is to
see if the configuration has been changed so the program is no longer
available. But this does not check for the (equally likely) chance
that the program is still available, but the version has changed.
One suggestion: Replace the function mew-ssl-setup by this:
(defun mew-ssl-ver (&optional recache)
(or (and (not recache) mew-ssl-ver)
(setq mew-ssl-ver
(cond ((not (mew-which-exec mew-prog-ssl))
nil)
((= (call-process mew-prog-ssl nil nil nil "-V") 0)
3)
(t 4)))))
Then replace the test
(or (null mew-ssl-ver) (not (mew-which-exec mew-prog-ssl)))
in mew-open-ssl-stream by (mew-ssl-ver), and perhaps replace the call
to mew-ssl-setup in mew-status-update by (mew-ssl-ver t), as a way to
force a possible change in stunnel version. (Or else remove that call
altogether.)
This way, the ssl version is checked when it is first needed, and
cached for later use.
- Harald
More information about the Mew-int
mailing list