info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with expiry-wait set to never on imap


From: Carlos Sánchez de La Lama
Subject: Problem with expiry-wait set to never on imap
Date: Thu, 19 Dec 2013 09:06:41 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix)

Hi all,

I have found a problem when setting expiry-wait to never for an imap
group. My messages were still being expired. After some investigation I
think the problem is at this defun:

--8<---------------cut here---------------start------------->8---
(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))))))))))
--8<---------------cut here---------------end--------------->8---

nnmail-expired-article-p will return nil for groups with expiry-wait
parameter set to never, but nnimap-find-expired-articles does not
checkfor such return value.

I have temporarily fixed it by placing in .gnus.el:

--8<---------------cut here---------------start------------->8---
(eval-after-load "nnimap"
  '(defun nnimap-find-expired-articles (group)
     (let ((cutoff (nnmail-expired-article-p group nil nil)))
       (if 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))))))))))))
--8<---------------cut here---------------end--------------->8---

(note the check for cutoff being not-nil).

BR

Carlos





reply via email to

[Prev in Thread] Current Thread [Next in Thread]