From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/5845 Path: news.gmane.org!not-for-mail From: David Breton Newsgroups: gmane.emacs.gnus.user Subject: Double expiration Date: Fri, 07 Oct 2005 14:10:58 -0700 Organization: Simon Fraser University Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138671493 29071 80.91.229.2 (31 Jan 2006 01:38:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 01:38:13 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:35:55 2006 Original-Path: quimby.gnus.org!newsfeed.gazeta.pl!news.nask.pl!newsfeed.pionier.net.pl!newsfeed.gamma.ru!Gamma.RU!cyclone.bc.net!news.sfu.ca!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-NNTP-Posting-Host: maggie.cs.sfu.ca Original-X-Trace: morgoth.sfu.ca 1128719419 15675 199.60.14.65 (7 Oct 2005 21:10:19 GMT) Original-X-Complaints-To: usenet@morgoth.sfu.ca Original-NNTP-Posting-Date: Fri, 7 Oct 2005 21:10:19 +0000 (UTC) User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux) Cancel-Lock: sha1:jVhSZuKeCM1KJ0wf73uHcZ/ysig= Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:5987 Original-Lines: 55 X-Gnus-Article-Number: 5987 Tue Jan 17 17:35:55 2006 Xref: news.gmane.org gmane.emacs.gnus.user:5845 Archived-At: Hi all, I'm playing around with my expiration process and I just can't make it do what I want it to do. Right now I'm expiring my nnml mail using the following: ;;Expire mail (setq nnmail-expiry-target 'nnmail-fancy-expiry-target nnmail-fancy-expiry-targets '( ("from" ".*" "nnfolder+archive:archived-mail-%Y-%m"))) I also save sent mail using the following: ;;Save sent mail (setq gnus-message-archive-group '((if (message-mail-p) (concat "sent-mail-" (format-time-string "%Y-%m" (current-time)))))) This of course works fine. Unfortunately, after a while I get lots of those archived-mail-yyyy-mm and sent-mail-yyyy-mm in my archive dir. I just don't like it. What I'd like is to have the archived-mail-yyyy-mm expire after say 90 days into archived-mail-yyyy. This would reduce the number of files I have and make me happy. Any ideas? So far I tried the following but it didn't work. (defun my-gnus-expiry-target (group) "Archive recent mail by year-month and old mail by year" (if (string-match "archived-mail-....-.." group) (concat "nnfolder+archive:archived-mail-" (format-time-string "%Y" (my-gnus-get-article-date))) (if (string-match "sent-mail-....-.." group) (concat "nnfolder+archive:sent-mail-" (format-time-string "%Y" (my-gnus-get-article-date))) (concat "nnfolder+archive:archived-mail-" (format-time-string "%Y-%m" (my-gnus-get-article-date))))))) (defun my-gnus-get-article-date () "Extracts the date from the current article and converts it to Emacs time" (save-excursion (goto-char (point-min)) (gnus-date-get-time (message-fetch-field "date")))) (setq nnmail-expiry-target 'my-gnus-expiry-target) Thanks for any help, David -- This isn't right. This isn't even wrong. -- Wolfgang Pauli