projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(imap-send-command): Change EOL-chars when `imap-client-eol' differs
[gnus]
/
lisp
/
mail-source.el
diff --git
a/lisp/mail-source.el
b/lisp/mail-source.el
index
309cf9a
..
6c8e74a
100644
(file)
--- a/
lisp/mail-source.el
+++ b/
lisp/mail-source.el
@@
-131,6
+131,7
@@
Common keywords should be listed here.")
(:subtype hotmail)
(:user (or (user-login-name) (getenv "LOGNAME") (getenv "USER")))
(:password)
(:subtype hotmail)
(:user (or (user-login-name) (getenv "LOGNAME") (getenv "USER")))
(:password)
+ (:dontexpunge)
(:authentication password)))
"Mapping from keywords to default values.
All keywords that can be used must be listed here."))
(:authentication password)))
"Mapping from keywords to default values.
All keywords that can be used must be listed here."))
@@
-631,15
+632,23
@@
This only works when `display-time' is enabled."
(defun mail-source-fetch-imap (source callback)
"Fetcher for imap sources."
(mail-source-bind (imap source)
(defun mail-source-fetch-imap (source callback)
"Fetcher for imap sources."
(mail-source-bind (imap source)
- (let ((found 0)
+ (let ((from (format "%s:%s:%s" server user port))
+ (found 0)
(buf (get-buffer-create (generate-new-buffer-name " *imap source*")))
(mail-source-string (format "imap:%s:%s" server mailbox))
remove)
(if (and (imap-open server port stream authentication buf)
(buf (get-buffer-create (generate-new-buffer-name " *imap source*")))
(mail-source-string (format "imap:%s:%s" server mailbox))
remove)
(if (and (imap-open server port stream authentication buf)
- (imap-authenticate user password buf)
+ (imap-authenticate
+ user (or (cdr (assoc from mail-source-password-cache))
+ password) buf)
(imap-mailbox-select mailbox nil buf))
(let (str (coding-system-for-write 'binary))
(with-temp-file mail-source-crash-box
(imap-mailbox-select mailbox nil buf))
(let (str (coding-system-for-write 'binary))
(with-temp-file mail-source-crash-box
+ ;; remember password
+ (with-current-buffer buf
+ (when (or imap-password
+ (assoc from mail-source-password-cache))
+ (push (cons from imap-password) mail-source-password-cache)))
;; if predicate is nil, use all uids
(dolist (uid (imap-search (or predicate "1:*") buf))
(when (setq str (imap-fetch uid "RFC822.PEEK" 'RFC822 nil buf))
;; if predicate is nil, use all uids
(dolist (uid (imap-search (or predicate "1:*") buf))
(when (setq str (imap-fetch uid "RFC822.PEEK" 'RFC822 nil buf))
@@
-660,6
+669,11
@@
This only works when `display-time' is enabled."
(imap-mailbox-close buf))
(imap-close buf))
(imap-close buf)
(imap-mailbox-close buf))
(imap-close buf))
(imap-close buf)
+ ;; We nix out the password in case the error
+ ;; was because of a wrong password being given.
+ (setq mail-source-password-cache
+ (delq (assoc from mail-source-password-cache)
+ mail-source-password-cache))
(error (imap-error-text buf)))
(kill-buffer buf)
found)))
(error (imap-error-text buf)))
(kill-buffer buf)
found)))
@@
-670,7
+684,9
@@
This only works when `display-time' is enabled."
(defun mail-source-fetch-webmail (source callback)
"Fetch for webmail source."
(mail-source-bind (webmail source)
(defun mail-source-fetch-webmail (source callback)
"Fetch for webmail source."
(mail-source-bind (webmail source)
- (let ((mail-source-string (format "webmail:%s:%s" subtype user)))
+ (let ((mail-source-string (format "webmail:%s:%s" subtype user))
+ (webmail-newmail-only dontexpunge)
+ (webmail-move-to-trash-can (not dontexpunge)))
(when (eq authentication 'password)
(setq password
(or password
(when (eq authentication 'password)
(setq password
(or password