mu4e-utils: Detect if update process asks for a password.
Offlineimap (or other mail fetchers) may query the user for a password. This patch adds a process filter to the `mu4e-update-mail' process and checks if the process asks for a password (Currently only matches "^Remote: Enter password: $"). It then reads the password from the user. Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
This commit is contained in:
@ -709,7 +709,16 @@ processing takes part in the background, unless buf is non-nil."
|
|||||||
(when maybe-error
|
(when maybe-error
|
||||||
(sit-for 5))
|
(sit-for 5))
|
||||||
(mu4e~proc-index mu4e-maildir mu4e-my-email-addresses)
|
(mu4e~proc-index mu4e-maildir mu4e-my-email-addresses)
|
||||||
(when (buffer-live-p buf)
|
(when (buffer-live-p buf)
|
||||||
|
(kill-buffer buf)))))
|
||||||
|
(set-process-filter proc
|
||||||
|
(lambda (proc msg)
|
||||||
|
(save-current-buffer
|
||||||
|
(set-buffer (process-buffer proc))
|
||||||
|
(let ((inhibit-read-only t))
|
||||||
|
;; Check whether process asks for a password and query user
|
||||||
|
(when (string-match "^Remote: Enter password: $" msg)
|
||||||
|
(process-send-string proc (concat (read-passwd "Password: ") "\n")))
|
||||||
(insert msg)))))))
|
(insert msg)))))))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user