* Double expiration
@ 2005-10-07 21:10 David Breton
0 siblings, 0 replies; only message in thread
From: David Breton @ 2005-10-07 21:10 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-07 21:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-07 21:10 Double expiration David Breton
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).