* archiving old mail
@ 2001-12-07 15:43 Nicolas Kowalski
2001-12-07 15:51 ` Karl Kleinpaste
2001-12-08 16:49 ` Nevin Kapur
0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Kowalski @ 2001-12-07 15:43 UTC (permalink / raw)
Hello.
Is there a way to make Gnus move the old (say, 30 days old) mail I
sent or received to some archive groups with the year+month digits
appended ?
What I do now to achieve this is :
- Enter the group `mygroup' I want to archive,
- select messages I sent/received during the MM month,
- move them to a nnfolder group `mygroup.YYYY.MM'
As I have a number of groups, I would like to automate this.
Thanks in advance.
Nicolas.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: archiving old mail
2001-12-07 15:43 archiving old mail Nicolas Kowalski
@ 2001-12-07 15:51 ` Karl Kleinpaste
2001-12-07 16:42 ` Simon Josefsson
2001-12-08 16:49 ` Nevin Kapur
1 sibling, 1 reply; 8+ messages in thread
From: Karl Kleinpaste @ 2001-12-07 15:51 UTC (permalink / raw)
Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:
> Is there a way to make Gnus move the old (say, 30 days old) mail I
> sent or received to some archive groups with the year+month digits
> appended ?
Group properties will do most of this for you. I do this kind of
expiry for quite a few groups. nnml is my gnus-select-method (nntp is
secondary) and I expire my group "personal.general" to its archive
companion this way:
((total-expire . t)
(expiry-wait . 30)
(expiry-target . "archive.current.personal.general"))
expiry-target is new in Oort. Your challenge is to find a way to make
the value of expiry-target into an eval -- I don't know if that's
possible or not in the current scheme.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: archiving old mail
2001-12-07 15:51 ` Karl Kleinpaste
@ 2001-12-07 16:42 ` Simon Josefsson
2001-12-07 17:23 ` Nicolas Kowalski
0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2001-12-07 16:42 UTC (permalink / raw)
Cc: ding
Karl Kleinpaste <karl@charcoal.com> writes:
> Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:
>> Is there a way to make Gnus move the old (say, 30 days old) mail I
>> sent or received to some archive groups with the year+month digits
>> appended ?
>
> Group properties will do most of this for you. I do this kind of
> expiry for quite a few groups. nnml is my gnus-select-method (nntp is
> secondary) and I expire my group "personal.general" to its archive
> companion this way:
>
> ((total-expire . t)
> (expiry-wait . 30)
> (expiry-target . "archive.current.personal.general"))
>
> expiry-target is new in Oort. Your challenge is to find a way to make
> the value of expiry-target into an eval -- I don't know if that's
> possible or not in the current scheme.
`expiry-target' can be a function, it will be called narrowed to the
message in question.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: archiving old mail
2001-12-07 16:42 ` Simon Josefsson
@ 2001-12-07 17:23 ` Nicolas Kowalski
2001-12-07 19:16 ` Simon Josefsson
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Kowalski @ 2001-12-07 17:23 UTC (permalink / raw)
Simon Josefsson <jas@extundo.com> writes:
>>
>> expiry-target is new in Oort. Your challenge is to find a way to make
>> the value of expiry-target into an eval -- I don't know if that's
>> possible or not in the current scheme.
>
> `expiry-target' can be a function, it will be called narrowed to the
> message in question.
(Please, be comprehensive : I am a lisp newbie)
So, I could use something like :
(defun gnus-user-expiry-target-function (group)
"Return the archive group filename"
(concat "archive." group "."
(format-time-string "%Y.%m"
(safe-date-to-time
(mail-header-date the-message))))
)
^^^^^^^^^^^
My problem is that I do not known how to get `the-message' with the
current buffer.
May somebody help ?
Thanks.
Nicolas.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: archiving old mail
2001-12-07 17:23 ` Nicolas Kowalski
@ 2001-12-07 19:16 ` Simon Josefsson
2001-12-08 11:11 ` Nicolas Kowalski
0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2001-12-07 19:16 UTC (permalink / raw)
Cc: Gnus
Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:
> Simon Josefsson <jas@extundo.com> writes:
>
>>>
>>> expiry-target is new in Oort. Your challenge is to find a way to make
>>> the value of expiry-target into an eval -- I don't know if that's
>>> possible or not in the current scheme.
>>
>> `expiry-target' can be a function, it will be called narrowed to the
>> message in question.
>
>
> (Please, be comprehensive : I am a lisp newbie)
>
> So, I could use something like :
>
> (defun gnus-user-expiry-target-function (group)
> "Return the archive group filename"
> (concat "archive." group "."
> (format-time-string "%Y.%m"
> (safe-date-to-time
> (mail-header-date the-message))))
> )
> ^^^^^^^^^^^
>
> My problem is that I do not known how to get `the-message' with the
> current buffer.
Perhaps the following works?
(expiry-target . my-expiry-target-function)
(defun my-expiry-target-function (group)
"Return the archive group filename"
(concat "archive." group "."
(format-time-string "%Y.%m"
(safe-date-to-time
(message-fetch-field "Date")))))
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: archiving old mail
2001-12-07 19:16 ` Simon Josefsson
@ 2001-12-08 11:11 ` Nicolas Kowalski
2001-12-08 13:24 ` Simon Josefsson
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Kowalski @ 2001-12-08 11:11 UTC (permalink / raw)
Cc: Gnus
Simon Josefsson <jas@extundo.com> writes:
> Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:
>
>> Simon Josefsson <jas@extundo.com> writes:
>>
>>>>
>>>> expiry-target is new in Oort. Your challenge is to find a way to make
>>>> the value of expiry-target into an eval -- I don't know if that's
>>>> possible or not in the current scheme.
>>>
>>> `expiry-target' can be a function, it will be called narrowed to the
>>> message in question.
>>
<snip bad_code>
> Perhaps the following works?
>
> (expiry-target . my-expiry-target-function)
>
> (defun my-expiry-target-function (group)
> "Return the archive group filename"
> (concat "archive." group "."
> (format-time-string "%Y.%m"
> (safe-date-to-time
> (message-fetch-field "Date")))))
Unfortunately no. I just tried with a big group. The expiry process
takes much more time, but no archive group is created.
Hmm, this is perhaps the trick : the archive group should exist before
the expiration process begins. What is the function for this ?
Nicolas.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: archiving old mail
2001-12-08 11:11 ` Nicolas Kowalski
@ 2001-12-08 13:24 ` Simon Josefsson
0 siblings, 0 replies; 8+ messages in thread
From: Simon Josefsson @ 2001-12-08 13:24 UTC (permalink / raw)
Cc: Gnus
Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:
>> Perhaps the following works?
>>
>> (expiry-target . my-expiry-target-function)
>>
>> (defun my-expiry-target-function (group)
>> "Return the archive group filename"
>> (concat "archive." group "."
>> (format-time-string "%Y.%m"
>> (safe-date-to-time
>> (message-fetch-field "Date")))))
>
>
> Unfortunately no. I just tried with a big group. The expiry process
> takes much more time, but no archive group is created.
>
> Hmm, this is perhaps the trick : the archive group should exist before
> the expiration process begins. What is the function for this ?
C-h k for `G m' in the group buffer says `gnus-group-make-group',
perhaps you can use the function directly, or you can look in that
function to see what you have to do.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: archiving old mail
2001-12-07 15:43 archiving old mail Nicolas Kowalski
2001-12-07 15:51 ` Karl Kleinpaste
@ 2001-12-08 16:49 ` Nevin Kapur
1 sibling, 0 replies; 8+ messages in thread
From: Nevin Kapur @ 2001-12-08 16:49 UTC (permalink / raw)
Nicolas Kowalski <Nicolas.Kowalski@imag.fr> writes:
> What I do now to achieve this is :
>
> - Enter the group `mygroup' I want to archive,
> - select messages I sent/received during the MM month,
> - move them to a nnfolder group `mygroup.YYYY.MM'
>
>
> As I have a number of groups, I would like to automate this.
I just submitted a patch that will allow you to say
(expiry-target . nnmail-fancy-expiry-target)
(nnmail-fancy-expiry-targets '(("from" ".*" "nnfolder:mygroup" "%Y-%b")))
in the group's parameter and the right thing would happen.
Using the gnus-parameters variable you can probably automate it for
all your groups.
--
Nevin
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2001-12-08 16:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-07 15:43 archiving old mail Nicolas Kowalski
2001-12-07 15:51 ` Karl Kleinpaste
2001-12-07 16:42 ` Simon Josefsson
2001-12-07 17:23 ` Nicolas Kowalski
2001-12-07 19:16 ` Simon Josefsson
2001-12-08 11:11 ` Nicolas Kowalski
2001-12-08 13:24 ` Simon Josefsson
2001-12-08 16:49 ` Nevin Kapur
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).