From 6bf0b14d55ac93a35e2444c09cc2d6c060d1fb54 Mon Sep 17 00:00:00 2001 From: Elias Oltmanns Date: Wed, 28 Jan 2015 07:01:53 +0000 Subject: [PATCH] nnimap.el (nnimap-find-expired-articles): nnimap `never' expiration fix --- lisp/ChangeLog | 5 +++++ lisp/nnimap.el | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52177b7e6..2291cb930 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-28 Elias Oltmanns + + * nnimap.el (nnimap-find-expired-articles): Fix handling of + (expiry-wait . never). + 2015-01-28 Lars Ingebrigtsen * nnimap.el (nnimap-request-group): Clear the buffer before returning diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 205f92cd9..e619c0f13 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -1021,20 +1021,20 @@ textual parts.") (defun nnimap-find-expired-articles (group) (let ((cutoff (nnmail-expired-article-p group nil nil))) - (with-current-buffer (nnimap-buffer) - (let ((result - (nnimap-command - "UID SEARCH SENTBEFORE %s" - (format-time-string - (format "%%d-%s-%%Y" - (upcase - (car (rassoc (nth 4 (decode-time cutoff)) - parse-time-months)))) - cutoff)))) - (and (car result) - (delete 0 (mapcar #'string-to-number - (cdr (assoc "SEARCH" (cdr result)))))))))) - + (when cutoff + (with-current-buffer (nnimap-buffer) + (let ((result + (nnimap-command + "UID SEARCH SENTBEFORE %s" + (format-time-string + (format "%%d-%s-%%Y" + (upcase + (car (rassoc (nth 4 (decode-time cutoff)) + parse-time-months)))) + cutoff)))) + (and (car result) + (delete 0 (mapcar #'string-to-number + (cdr (assoc "SEARCH" (cdr result))))))))))) (defun nnimap-find-article-by-message-id (group server message-id &optional limit) -- 2.25.1