Gnus development mailing list
 help / color / mirror / Atom feed
* Expiration not expiring
@ 2002-04-10 16:28 Michael J. Barillier
  2002-04-10 17:33 ` Kai Großjohann
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michael J. Barillier @ 2002-04-10 16:28 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've got an nnml group with group parameters that look like:

  ((total-expire . t)
   (expiry-wait . 1))

`B e' in the summary buffer doesn't delete read mail, `C-c C-x' in the
group buffer doesn't work, marking all the messages as expirable and
changing `total-expire' to `auto-expire' doesn't work -- seems that
nothing short of wiping the disk will delete the damned messages.
What am I doing wrong?

- -- 
Michael J. Barillier                        | Knowledge shared is
> (let ((uid "blackwolf")                   | power lost.
        (mailhost "pcisys.net"))            |   -- Aleister Crowley
    (concatenate 'string uid "@" mailhost)) |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard <http://www.gnupg.org/>

iD8DBQE8tGgN2CJ4zjXlSXMRAqfuAJ9LuvdCItbOGsGnvnzXaWczf0KKLwCgxYge
+yJSw9cUD+oTJiuQ2EouvCE=
=blSy
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Expiration not expiring
  2002-04-10 16:28 Expiration not expiring Michael J. Barillier
@ 2002-04-10 17:33 ` Kai Großjohann
  2002-04-10 17:59   ` Michael J. Barillier
  2002-04-11 14:47 ` Nicolas Kowalski
  2002-04-12  9:13 ` Nicolas Kowalski
  2 siblings, 1 reply; 9+ messages in thread
From: Kai Großjohann @ 2002-04-10 17:33 UTC (permalink / raw)
  Cc: ding

What happens with "C-u B e" instead of "B e"?
kai
-- 
Silence is foo!



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Expiration not expiring
  2002-04-10 17:33 ` Kai Großjohann
@ 2002-04-10 17:59   ` Michael J. Barillier
  2002-04-10 21:20     ` Kai Großjohann
  0 siblings, 1 reply; 9+ messages in thread
From: Michael J. Barillier @ 2002-04-10 17:59 UTC (permalink / raw)
  Cc: ding

>>>>> "Kai" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

    Kai> What happens with "C-u B e" instead of "B e"?

Same thing -- I get a message `Expiring articles...', but still have
the same number of messages in the folder.

I thought I heard mocking laughter coming from the box, but I could be
wrong ... :)

-- 
Michael J. Barillier                        | Knowledge shared is
> (let ((uid "blackwolf")                   | power lost.
        (mailhost "pcisys.net"))            |   -- Aleister Crowley
    (concatenate 'string uid "@" mailhost)) |



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Expiration not expiring
  2002-04-10 17:59   ` Michael J. Barillier
@ 2002-04-10 21:20     ` Kai Großjohann
  2002-04-10 22:20       ` Michael J. Barillier
  0 siblings, 1 reply; 9+ messages in thread
From: Kai Großjohann @ 2002-04-10 21:20 UTC (permalink / raw)
  Cc: ding

"Michael J. Barillier" <blackwolf@pcisys.net> writes:

>>>>>> "Kai" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:
>
>     Kai> What happens with "C-u B e" instead of "B e"?
>
> Same thing -- I get a message `Expiring articles...', but still have
> the same number of messages in the folder.

Hm.  So the problem is not the code that calculates the time.  Maybe
you can't delete messages at all?

Try using `B <delete>' to delete a message.  Does that work?

kai
-- 
Silence is foo!



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Expiration not expiring
  2002-04-10 21:20     ` Kai Großjohann
@ 2002-04-10 22:20       ` Michael J. Barillier
  0 siblings, 0 replies; 9+ messages in thread
From: Michael J. Barillier @ 2002-04-10 22:20 UTC (permalink / raw)
  Cc: ding

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "Kai" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

    Kai> Hm.  So the problem is not the code that calculates the time.  Maybe
    Kai> you can't delete messages at all?

    Kai> Try using `B <delete>' to delete a message.  Does that work?

I managed to whack the messages -- IIRC I ended up setting all the
messages as expirable and running `gnus-summary-expire-articles-now'.
Still don't know why total-expire wouldn't work on its own.  My plan
is to upgrade to the latest Gnus (I'm currently using 5.9.0) from CVS
and, if I don't see anything getting deleted in a couple of days
(whatever expiry-wait is set to) I'll root through the elisp code with
a debugger and see what's what.

Thanks for your help.

- -- 
Michael J. Barillier                        | Knowledge shared is
> (let ((uid "blackwolf")                   | power lost.
        (mailhost "pcisys.net"))            |   -- Aleister Crowley
    (concatenate 'string uid "@" mailhost)) |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard <http://www.gnupg.org/>

iD8DBQE8tLpd2CJ4zjXlSXMRAt+aAJ92rihg1cnMRkzwNk8Gb/bNIvCUlACfTCJs
oB2GEDRs1jKg7P9kQCsRwGg=
=su05
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Expiration not expiring
  2002-04-10 16:28 Expiration not expiring Michael J. Barillier
  2002-04-10 17:33 ` Kai Großjohann
@ 2002-04-11 14:47 ` Nicolas Kowalski
  2002-04-12 10:51   ` Kai Großjohann
  2002-04-12  9:13 ` Nicolas Kowalski
  2 siblings, 1 reply; 9+ messages in thread
From: Nicolas Kowalski @ 2002-04-11 14:47 UTC (permalink / raw)


"Michael J. Barillier" <blackwolf@pcisys.net> writes:

> `B e' in the summary buffer doesn't delete read mail, `C-c C-x' in the
> group buffer doesn't work, marking all the messages as expirable and
> changing `total-expire' to `auto-expire' doesn't work -- seems that
> nothing short of wiping the disk will delete the damned messages.
> What am I doing wrong?

(Sorry Michael, this message is not an answer...)

I use almost the same setup, and I am facing the same problem,
whatever the backend is (nnimap or nnml). B-<delete> works well.


My expiration definition is :

(setq

 gnus-auto-expirable-newsgroups "^list.\\|^mail."
 nnmail-expiry-wait-function
 (lambda (group)
   (cond 
    ((string-match "^list." group) 7)	          ;; mailing-lists
    ((string-match "^mail.verimag.log" group) 7)  ;; logs
    ((string-match "^mail." group) 31)            ;; others
    (t 'never)))                                  ;; 
)


Nicolas.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Expiration not expiring
  2002-04-10 16:28 Expiration not expiring Michael J. Barillier
  2002-04-10 17:33 ` Kai Großjohann
  2002-04-11 14:47 ` Nicolas Kowalski
@ 2002-04-12  9:13 ` Nicolas Kowalski
  2 siblings, 0 replies; 9+ messages in thread
From: Nicolas Kowalski @ 2002-04-12  9:13 UTC (permalink / raw)
  Cc: ding

"Michael J. Barillier" <blackwolf@pcisys.net> writes:

> `B e' in the summary buffer doesn't delete read mail, `C-c C-x' in the
> group buffer doesn't work, marking all the messages as expirable and
> changing `total-expire' to `auto-expire' doesn't work -- seems that
> nothing short of wiping the disk will delete the damned messages.
> What am I doing wrong?

Look at the modification times of the files in your nnml group. This
backend use them during the expiration process. It does not use the
date included in articles.

My problem was (in fact this is not a problem) that the nnml groups
are fairly recent (built a few days ago from nnfolder archives).

Nicolas.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Expiration not expiring
  2002-04-11 14:47 ` Nicolas Kowalski
@ 2002-04-12 10:51   ` Kai Großjohann
  2002-04-12 12:01     ` [code] " Nicolas Kowalski
  0 siblings, 1 reply; 9+ messages in thread
From: Kai Großjohann @ 2002-04-12 10:51 UTC (permalink / raw)
  Cc: ding

Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:

>     ((string-match "^list." group) 7)	          ;; mailing-lists

Could you verify that the group name is really list.foo and not
nnml:list.foo? 

kai
-- 
Silence is foo!



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [code] Re: Expiration not expiring
  2002-04-12 10:51   ` Kai Großjohann
@ 2002-04-12 12:01     ` Nicolas Kowalski
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Kowalski @ 2002-04-12 12:01 UTC (permalink / raw)
  Cc: ding

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:
>
>>     ((string-match "^list." group) 7)	          ;; mailing-lists
>
> Could you verify that the group name is really list.foo and not
> nnml:list.foo? 

Yes it is. nnml is my primary select method.

As i wrote in the message (Message-ID:
<vqovgaxth38.fsf@astazou.imag.fr>), the fact is nnml use the
modification time of the file containing an article to decide if it
must run the expiration process on it. As my nmml groups are fairly
recent, modification times of articles do not match the "real" date of
article.

To handle this, I wrote some simple functions (which look and behave
like nnml-generate-nov-database), to make Gnus modify the date
attributes of the files using the message dates, and the `touch' (FSF
version) utility. See below. It worked for me.

Any comment about these ?


;;
;; file: niko-nnml.el
;;
;; Simple functions for modifying time-related file attributes of nnml group
;; articles, based on the contents of these articles.  
;;
;; When a message date field is valid, change the modification time
;; (using touch command) of the file to this date.
;;
;; To use it M-x niko-nnml-generate-mod-time
;;
;; The commands to execute will be written in *niko-output* buffer, or
;; executed immediatly (not recommended) if niko-nnml-mod-time-exec is
;; set to t
;;


(defun niko-date-to-time (date)
  "Parse a string that represents a date-time and return a time value.
If DATE is malformed, returns nil."
  (condition-case ()
      (date-to-time date)
    (error nil)))

(defvar niko-nnml-mod-time-string-format "%Y%m%d%H%M"
  "Format of the string to be given as date argument to touch")

(defvar niko-nnml-mod-time-touch-cmd "touch -c -t"
  "touch program")

(defvar niko-nnml-mod-time-exec nil
  "Set to `t' if you really want to execute touch commands.
If nil, shells commands are stored in the *niko-output* buffer.")



(defun niko-nnml-regenerate-mod-time-for-files (dir files)
  (let* ((niko-buffer (get-buffer-create "*niko-tmp*"))
	 (niko-output-buffer (get-buffer-create "*niko-output*"))
	 (dir (file-name-as-directory dir)))
    (save-excursion
      (set-buffer niko-output-buffer)
      (while files
	(unless (file-directory-p (setq file (concat dir (cdar files))))
	  (set-buffer niko-buffer)
	  (erase-buffer)
	  (nnheader-insert-file-contents file)
	  (let* ((article-tmp-time (niko-date-to-time (message-fetch-field "Date")))
		 (article-time (if (eq nil article-tmp-time)
				   (nth 5 (file-attributes file))
				 article-tmp-time))
		 (cmd (concat niko-nnml-mod-time-touch-cmd " "
			      (format-time-string 
			       niko-nnml-mod-time-string-format
			       article-time)
			      " "
			      file
			      "\n")))
	    (set-buffer niko-output-buffer)
	    (point-max)
	    (if niko-nnml-mod-time-exec
		(shell-command cmd niko-output-buffer)
	      (insert cmd)
	      )
	    )
	  )
	(setq files (cdr files))
	)
      )
    )
  )


;;;###autoload
(defun niko-nnml-generate-mod-time (&optional server)
  "Generate articles modification times in all nnml directories."
  (interactive (list (or (nnoo-current-server 'nnml) "")))
  ;; Read the active file to make sure we don't re-use articles
  ;; numbers in empty groups.
  (nnmail-activate 'nnml)
  (unless (nnml-server-opened server)
    (nnml-open-server server))
  (setq nnml-directory (expand-file-name nnml-directory))
  ;; Recurse down the directories.
  (niko-nnml-generate-mod-time-1 nnml-directory nil t)
  )

(defun niko-nnml-generate-mod-time-1 (dir &optional seen no-active)
  "Regenerate the articles modification times in DIR."
  (interactive "DRegenerate mod-time in: ")
  (setq dir (file-name-as-directory dir))
  ;; Only scan this sub-tree if we haven't been here yet.
  (unless (member (file-truename dir) seen)
    (push (file-truename dir) seen)
    ;; We descend recursively
    (let ((dirs (directory-files dir t nil t))
	  dir)
      (while (setq dir (pop dirs))
	(when (and (not (string-match "^\\." (file-name-nondirectory dir)))
		   (file-directory-p dir))
	  (niko-nnml-generate-mod-time-1 dir seen))))
    ;; Do this directory.
    (let ((files (sort (nnheader-article-to-file-alist dir)
		       'car-less-than-car)))
      (if (not files)
	  (let* ((group (nnheader-file-to-group
			 (directory-file-name dir) nnml-directory))
		 (info (cadr (assoc group nnml-group-alist))))
	    (when info
	      (setcar info (1+ (cdr info)))))
	;; Generate the mod-time
	(niko-nnml-regenerate-mod-time-for-files dir files)
	))))



(provide 'niko-nnml)







^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-04-12 12:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-10 16:28 Expiration not expiring Michael J. Barillier
2002-04-10 17:33 ` Kai Großjohann
2002-04-10 17:59   ` Michael J. Barillier
2002-04-10 21:20     ` Kai Großjohann
2002-04-10 22:20       ` Michael J. Barillier
2002-04-11 14:47 ` Nicolas Kowalski
2002-04-12 10:51   ` Kai Großjohann
2002-04-12 12:01     ` [code] " Nicolas Kowalski
2002-04-12  9:13 ` Nicolas Kowalski

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).