Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: csanchezdll@gmail.com (Carlos Sánchez de La Lama)
To: info-gnus-english@gnu.org
Subject: Problem with expiry-wait set to never on imap
Date: Thu, 19 Dec 2013 09:06:41 +0000	[thread overview]
Message-ID: <dazfvppxl9a.fsf@sdf.lonestar.org> (raw)

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	other threads:[~2013-12-19  9:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dazfvppxl9a.fsf@sdf.lonestar.org \
    --to=csanchezdll@gmail.com \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).