Gnus development mailing list
 help / color / mirror / Atom feed
From: Julien Danjou <julien@danjou.info>
To: ding@gnus.org
Subject: Immediate expire on imap
Date: Fri, 13 Jan 2017 12:22:55 +0100	[thread overview]
Message-ID: <m0ziiv5hm8.fsf@danjou.info> (raw)

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]

Hi folks,

I'm trying to expire some of my mails with 'immediate with nnimap, but I
think it actually does not really work. It only work with mail that are
before yesterday. I see the following as the potential problem:

(defun nnimap-find-expired-articles (group)
  (let ((cutoff (nnmail-expired-article-p group nil nil)))
    (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)))))))))))


If `nnmail-expiry-wait` is 'immediate then (nnmail-expired-article-p
group nil nil) returns (current-time), which is translated in e.g.
13-JAN-2017 by `nnimap-find-expired-articles`. So if the message is
expired today, well, it does no seem to work.

Sounds like a little bug to me, and I'm hoping that someone will help me
fixing it before I commit random garbage to the trunk. ;-) It has been a
long time since I played on that!

-- 
Julien Danjou
# Free Software hacker
# https://julien.danjou.info

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

                 reply	other threads:[~2017-01-13 11:22 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=m0ziiv5hm8.fsf@danjou.info \
    --to=julien@danjou.info \
    --cc=ding@gnus.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).