Closed Bug 11055 Opened 25 years ago Closed 19 years ago

Message aging (empty trash/auto-delete messages after N days)

Categories

(MailNews Core :: Backend, enhancement, P3)

enhancement

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.8beta2

People

(Reporter: sspitzer, Assigned: Bienvenu)

References

Details

Attachments

(2 files, 4 obsolete files)

Whiteboard: HELP WANTED
Target Milestone: M15
Bulk-resolving requests for enhancement as "later" to get them off the Seamonkey
bug tracking radar. Even though these bugs are not "open" in bugzilla, we
welcome fixes and improvements in these areas at any time. Mail/news RFEs
continue to be tracked on http://www.mozilla.org/mailnews/jobs.html
Reopen mail/news HELP WANTED bugs and reassign to nobody@mozilla.org
Keywords: helpwanted
Summary: [HELP WANTED] Message aging (auto-delete after N days) → Message aging (auto-delete after N days)
Whiteboard: HELP WANTED
Target Milestone: M15
*** Bug 68430 has been marked as a duplicate of this bug. ***
*** Bug 100059 has been marked as a duplicate of this bug. ***
*** Bug 105824 has been marked as a duplicate of this bug. ***
*** Bug 106001 has been marked as a duplicate of this bug. ***
Ahh, whoops, didn't see this in my search for forms of "expire".  Sorry.

Let me transfer a comment I made in bug 106001 over here though: rather than
just delete after x days, it would be more useful to perform other actions, such
as move to an archive folder.  It may be useful to have a different kind of
message filter, one that processes an entire folder on first folder open every
24 hours or client open.
The mail filter UI already includes a "age is N days" possibility, I don't know
if that is functional though. So deleting or archiving shouldn't be a problem
once the bug about filter after message has been downloaded and implement filter
for news have been fixed (don't know the numbers offhand).
*** Bug 121846 has been marked as a duplicate of this bug. ***
*** Bug 128307 has been marked as a duplicate of this bug. ***
If this bug is going to be a catch-all, it needs to have a better description.
As it is, it's impossible to find this bug with most searches on this topic. At
least mention the trash in the summary.
Like this? :-)
Summary: Message aging (auto-delete after N days) → Message aging (empty trash/auto-delete messages after N days)
*** Bug 129244 has been marked as a duplicate of this bug. ***
The comments for this bug talk about deleting mail on the client side. 
However, I would like to see serverside removal after N days. Outlook has this 
setting when you select leave mail on server. I think most of the bugs marked 
as duplicates of this one (including one of my own a couple of months back) 
are about this feature.

I depend on this to look at my pop account from home and work. At home I have 
leave mail on server selected whereas at work it is deleted from the server 
after a couple of days. I never throw away any fetched email (except spam) so 
I don't want to delete it locally, just on the server.
*** Bug 140374 has been marked as a duplicate of this bug. ***
I agree with Jilles!  The ability to automatically delete FROM THE POP SERVER
after x days is a VERY USEFUL FEATURE.  Eudora has had it as long as I can
remember (1997 or so).  

Anyone who accesses their mail account from more than one computer can really
benefit from this feature.  I hope someone will give it some priority!
*** Bug 171670 has been marked as a duplicate of this bug. ***
Jilles and Jim Booth hit the nail right on the head.  I would prefer to use
Mozilla as my mail client everywhere, but am forced to use Eudora on one of my
machines (at work).  Anyone who wants to maintain mail on more than one machine
NEEDS this feature!
Please see Bug 107883 for the issue of Deleting from server after X days, and
transfer your votes to that bug if appropriate.
Depends on: 107883
Blocks: 117037
No longer blocks: 117037
I'm not sure if this applies to this bug, but I would like to see messages older
than 1 month deleted from the Trash on my IMAP server.  All the previous talk
has been about POP so I thought I'd give my 2 cents. 
Yes, I was confused, too, whet not found "age" in filter for imap folder. Why
this option not available for IMAP folders? 
*** Bug 192156 has been marked as a duplicate of this bug. ***
Code to track the age of a message an take action based upon it is already
functional (at least for IMAP and Local Mail). It's used by the Junk Mail
feature to delete messages in the Junk Folder older than a certain age.
*** Bug 194591 has been marked as a duplicate of this bug. ***
QA Contact: lchiang → nobody
*** Bug 190295 has been marked as a duplicate of this bug. ***
Just out of curiosity: how much would one have to pay someone to get a feature
like this implemented?
I believe the addition of this single feature, which as someone pointed out, has
existed in Eudora for a very long time, would allow me to make the switch from
Eudora to Thunderbird. I've even dedicated a vote to this bug.
Bug 100059, bug 105824 and bug 129244 are duped against this bug when they
should instead be duped against Bug 107883 - Feature request: Remove from server
after x days (POP).  

Please note the difference.  THIS bug refers to removing from CLIENT.  Bug
107833 refers to REMOVING FROM A (POP) SERVER after X DAYS, and has 40 votes and
10 dupes on it already.  

Please move your VOTES accordingly if that's the feature you were asking for.
I want to add my vote to auto-delete from imap folder. where I can do it?
vote for this bug, I think. The pop3 delete from server after XX days feature
has been implemented and is in 1.6 daily builds now. Auto-aging from the client
is this bug, at this point.

We already have auto-aging for the junk mail folder (IMAP or LOCAL/POP3). It
would be fairly easy to extend that to folders in general. We'd need a UI for
specifying it, however. If it's just aging the trash, we could have a UI in the
account for the server...
Assignee: nobody → bienvenu
At work I have admin mailbox, with some imap folders, contains messages from
some robots. I think it will be suteble to auto-delete messages from robost in
this folders after 40 days.
*** Bug 222515 has been marked as a duplicate of this bug. ***
Blocks: 223200
Automatic export to a product-independent format may be great, too.
vote for this bug, and for http://bugzilla.mozilla.org/show_bug.cgi?id=223200
which has hardly gotten any votes so far
for consistency. if we age on the server (fixed in 1.6a) then we should have the
age in trash bin/specified folder in this release as well. 
Flags: blocking1.6b?
Flags: blocking1.6b? → blocking1.6b-
I was just looking for something like this. I actually stumbled over the
RetentionSettings first, but those only seem to apply to News folders. I get the
feeling that the RetentionSettings and the MsgPurgeService could be merged into
a single feature. Maybe all of the flexibility of the RetentionSettings is
overkill for general folders...
*** Bug 252867 has been marked as a duplicate of this bug. ***
severity should be 'enh'?
*** Bug 248248 has been marked as a duplicate of this bug. ***
*** Bug 258566 has been marked as a duplicate of this bug. ***
Severity: normal → enhancement
Product: MailNews → Core
*** Bug 274911 has been marked as a duplicate of this bug. ***
Blocks: 275292
Well, here is someone else that wants a setting to remove/delete old messages. 
I used this a lot in Kmail before I switched to Mozilla-mail.  I like
Mozilla-mail but this may get me to start using Kmail again.  

The reason I switched was I could right click a link and it open in Mozilla as
new tab.  I guess I could ask Kmail to see if they can do that like Mozilla-mail
does.  0_0

This would be a good option to add.  Kmail has it so I know it can be done.

Dale
Attached image Dialogbox example
i also want this feature -> voted.

also i'd like to automatically let tb delete messages in folders when the # of
mails in those folders surpasses a certain amount.
example: i want to have only the last 1000 mails of a mailinglist and everyone
before that should be automaticaly deleted.
*** Bug 291468 has been marked as a duplicate of this bug. ***
Attached patch work in progress (obsolete) — Splinter Review
this hooks up the UI for the existing backend aging code, and makes that
backend code work for local and imap (it previously just worked for news).

This patch allows you to set aging preferences on a per-server basis, and
override them on a per-folder basis. The aging preferences are the same as the
existing news preferences, without the settings that affect offline msg bodies.


There are a few issues with this patch:

1. It currently applies the retention settings only when you open a folder. So
if you never open a folder, we never apply the retention settings to that
folder. My plan here is to extend the nsMsgPurgeService to also do message
aging. In fact, the junk mail purging stuff could really be replaced with this
UI, except junk mail is more discoverable with its current UI.

2. This should be added to the RSS server account settings UI, which doesn't
play in the normal server settings game. 

3. We need some sort of big scary warning that messages that are aged away will
be permanently deleted. I've added some text to that effect to the account
settings UI, but it might not be scary enough.	We don't do archiving yet, and
I don't plan on doing that in 1.1
adding Neil and Scott to cc list for their input.
1. Maybe the junk mail UI should just open the folder properties dialog?

3. Perhaps reversing the sense of the text would help?
"To recover disk space, old messages can be permanently deleted.
 (o) Don't delete any messages
 (o) Delete messages more than [  ] days old
 (o) Delete all but the last [  ] messages
 [x] Always delete read messages
(is that really what it does?)
Not sure how 1) would work - I guess we could add a button to the junk controls
2) needs to be fleshed out more :-)
3) I like that a lot. I'll make those changes. Yes, that option really deletes
all read mail. It's intended for newsgroups where you never want to keep read
messages - it makes a little more sense for news, I guess, because you're only
deleting the headers. I'm open to removing it if people think no one would ever
use it, or hiding it for non-news.
(In reply to comment #49)
> Yes, that option really deletes
> all read mail. It's intended for newsgroups where you never want to keep read
> messages - it makes a little more sense for news, I guess, because you're only
> deleting the headers. I'm open to removing it if people think no one would ever
> use it, or hiding it for non-news.

Yes, it should definitely be hidden; for mail it almost never makes sense and no
one should accidently enable it.

> (o) Delete all but the last [  ] messages

Making that "latest" would be more clear.
(In reply to comment #50)
> Yes, it should definitely be hidden; for mail it almost never makes sense and no
> one should accidently enable it.

no it shouldn't.
that's exactly what i want and requested in
https://bugzilla.mozilla.org/show_bug.cgi?id=291468
I meant hide just the option that deletes all read mail, not all the auto-aging
options. I see no reference to wanting to delete all read mail in bug 291468
(In reply to comment #50)
> > (o) Delete all but the last [  ] messages

> Making that "latest" would be more clear.

"Latest referring to Date written" or "latest referring to order received"?

Making that "last|latest according to [whatever] sort order" would be even
clearer.  
Attached patch proposed fix (obsolete) — Splinter Review
this builds on the previous patch to make the purge service apply retention
settings to folders, if they haven't been applied in the last 8 hours. It also
fixes it so we do  junk purging every 8 hours instead of every 5 minutes, which
we were doing because of a 32 bit int overflow.

With the current patch, we apply retention settings whenever you open a folder
- we might want to avoid doing that every time, but people with retention
settings would tend to have smaller folders anyway.
Attachment #183167 - Attachment is obsolete: true
Attachment #183554 - Flags: review?(neil.parkwaycc.co.uk)
Attached patch address Neil's comments (obsolete) — Splinter Review
Attachment #183554 - Attachment is obsolete: true
Attachment #183745 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #183745 - Attachment is obsolete: true
Attachment #183745 - Flags: review?(neil.parkwaycc.co.uk)
the one outstanding issue is that in folderPane.xul, the keep unread only
checkbox doesn't line up with the radio buttons.
Attachment #183834 - Flags: review?(neil.parkwaycc.co.uk)
Blocks: majorbugs
No longer blocks: majorbugs
Comment on attachment 183834 [details] [diff] [review]
get rid of radio button id's, fix command updating, fix overriding server defaults in db.

>+<!ENTITY retentionCleanup.label "To recover disk space, old messages can be permanently deleted">
You didn't make these wording changes in the mailnews/ verions... 

>+    var titleStringID = (gIncomingServer.offlineSupportLevel >= 10) 
>+     ? "prefPanel-offline-and-diskspace" : "prefPanel-diskspace";
Nit: prefer the ? at the end of the previous line.

>+        <radio wsm_persist="true" id="retention.keepAllMsg" value="1" accesskey="&retentionKeepAll.accesskey;"
While you're changing these lines I wonder if you could get away with removing
the wsm_persist="true" on all the <radio>s.

>+            label="&retentionKeepUnread.label;" hidefor="" checked="true"/>
Is this hidefor="" to unhide the box for a non-deferred server? Seems a bit
obscure ;-)

>+function onUseDefaultRetentionSettings()
>+{
>+  var useDefault = document.getElementById("retention.useDefault").checked;
>+  document.getElementById('retention.keepMsg').disabled = useDefault;
>+}
Nit: it would be nice if you could arrange to disable the number of
days/messages textboxes as appropriate too.

>+	<tab id="Retention" label="&retention.label;"/>
Nit: We allow <tab>s but not TABs ;-)

>+ * -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
So why does all the code have 4-space indents?

>+    document.getElementById("retention.keepMsg").setAttribute("value", retentionSettings.retainByPreference);
>+    if(retentionSettings.daysToKeepHdrs > 0)
>+        document.getElementById("retention.keepOldMsgMin").setAttribute("value", retentionSettings.daysToKeepHdrs);
>+    else
>+        document.getElementById("retention.keepOldMsgMin").setAttribute("value", "30");
>+    document.getElementById("retention.keepNewMsgMin").setAttribute("value", 
>+        (retentionSettings.numHeadersToKeep > 0) ? retentionSettings.numHeadersToKeep : 30);
>+
>+    document.getElementById("retention.keepMsg").value = retentionSettings.retainByPreference;
This supercedes the setAttribute("value", ...) above. In fact, the intervening
setAttribute calls do not work, they should be .value too. The reason is that
if you change the value, and switch to another disk space value, the value will
not get overwritten if you only set the attribute.

>+    var retentionSettings = new Array;
Could be just new Object; or {}; or you could even use
return {
  retainByPreference: document.getElementById(...).value,
  daysToKeepHdrs: ... ,
  numHeadersToKeep: ... ,
  keepUnreadMessagesOnly: ...(...).checked
};

>+    switch (document.getElementById("retention.keepMsg").value)
>+    {
>+      case "1":
>+        document.getElementById("retention.keepNewMsgMin").setAttribute("disabled", "true");
>+        document.getElementById("retention.keepOldMsgMin").setAttribute("disabled", "true");
>+        break;
>+      case "2":
>+        document.getElementById("retention.keepOldMsgMin").removeAttribute("disabled");
>+        document.getElementById("retention.keepNewMsgMin").setAttribute("disabled", "true");
>+        break;
>+      case "3":
>+        document.getElementById("retention.keepNewMsgMin").removeAttribute("disabled");
>+        document.getElementById("retention.keepOldMsgMin").setAttribute("disabled", "true");
>+        break;
>+    }
It might be worth turning the logic on its head i.e.
var keepMsg = document.getElementById("retention.keepMsg").value;
document.getElementById("retention.keepOldMsgMin").disabled = keepMsg != 2;
document.getElementById("retention.keepNewMsgMin").disabled = keepMsg != 3;

r=me if you fix at least * the dtds * the TAB * the indents * the .values
Attachment #183834 - Flags: review?(neil.parkwaycc.co.uk) → review+
I'll fix the dtds and the indents and the .values, but there really isn't a TAB
there - it's just the diff "+ " that makes the indent look wrong :-)
(In reply to comment #58)
>I'll fix the dtds and the indents and the .values, but there really isn't a TAB
>there - it's just the diff "+ " that makes the indent look wrong :-)
I double-checked and found three other TABs too:
+<!ENTITY retentionUseDefault.label	"Use server defaults">
                                   ^^^^^ (appears in both locale files)
+	var retentionSettings = saveCommonRetentionSettings();
 ^^^^^^^
Attachment #183834 - Attachment is obsolete: true
Attachment #184938 - Flags: superreview?(mscott)
Attachment #184938 - Flags: superreview?(mscott) → superreview+
Comment on attachment 184938 [details] [diff] [review]
address most of Neil's comments.

carrying forward Neil's r=, and requesting a=1.1a2
Attachment #184938 - Flags: review+
Attachment #184938 - Flags: approval-aviary1.1a2?
Comment on attachment 184938 [details] [diff] [review]
address most of Neil's comments.

a=chofmann
Attachment #184938 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Thanks for all your work on this, David. Looking forward to checking this out!
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
thanks a lot!! in which version will this be implemented?
sorry, if this is the wrong place to ask, i'm kinda new.
tbird 1.1, and seamonkey 1.8, and nightly trunk builds starting tomorrow.
I got mozilla 20050602, set "keep messages which have been arrived within the
last 40 days" on my trash folder, located on imap server - and see tne last 40
messages instead around 4000 messages, received during the last 40 days. Maybe, bug?
yes, that was fixed Friday, so it's in Saturday's build.
Comment on attachment 183554 [details] [diff] [review]
proposed fix

clearing request
Attachment #183554 - Flags: review?(neil.parkwaycc.co.uk)
*** Bug 223200 has been marked as a duplicate of this bug. ***
*** Bug 232839 has been marked as a duplicate of this bug. ***
Status: RESOLVED → VERIFIED
Keywords: helpwanted
Target Milestone: --- → mozilla1.8beta2
Product: Core → MailNews Core
Depends on: 339151
On thunderbird 3.0beta 3 and All platform,the bug still reproduce.
On TB3 RC1 Build1, Linux version, fr locale (Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.1.5) Gecko/20091112 Thunderbird/3.0), the bug is still here.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: