I use gnus
configured to read mails from the davmail
IMAP server. This one is used to read mails from outlook
and translate them according to the IMAP protocol.
When I start gnus
, I configured emacs to autostart the davmail
server, with following function :
(defun davmail/start ()
"Run davmail externally for gnus."
(interactive)
(if (buffer-live-p "*davmail*")
(kill-buffer "*davmail*"))
(let ((default-directory davmail-directory))
(start-process "davmail" "*davmail*" local-java-path "-jar" davmail-jar davmail-properties)))
The trouble is that davmail
often asks to accept the outlook
server certificate, which blocks gnus
. To overcome this issue, I implemented this function :
(defun davmail/accept_certificate ()
"Accept certificate."
(interactive)
(if (get-process "davmail")
(process-send-string "davmail" "o\n")
(message "No running davmail process")))
which retrieves the emacs davmail
process and send to it the "o" (accept) string.
It works but it remains a little painful. I would like to trigger this function whenever the davmail
process asks for certificate acceptation. Usually, it is a line containing "accept certificate (o/n) ?"
This way, I would not have to do it manually each time it occurs. But i am rather new to emacs/lisp and implementing this overpasses my skills. Could you give me some pieces of advices ?
I am aware that it is not really an emacs related issue, I could as well ask to the davmail
developers to implement some kind of auto accept certificate option. But it is a good opportunity for me to improve my emacs skills.
Regards