Mailing List Archive

how to delete email with certain date
Does anyone has a script/procedure how to delete an email from a certain date.

Example:

I have 30,000 emails in cur directory and want to delete emails receive from January to March 2008 and let emails receive from April 2008 onwards remain.

Is there a faster way to do this? I created a script but still delete some emails that are not intent to delete.




____________________________________________________
Tired of spam? Yahoo! Mail has the best spam protection around
http://ph.mail.yahoo.com
Re: how to delete email with certain date [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Nelson Serafica schrieb:
> Does anyone has a script/procedure how to delete an email from a certain
> date.
>
> Example:
>
> I have 30,000 emails in cur directory and want to delete emails receive
> from January to March 2008 and let emails receive from April 2008
> onwards remain.

If you have shell access, a fast way to do is just a "find -type f
- -ctime +XXX | xargs rm" on ypur mailfolders

This will remove all files/mails, where the files where created before
the given offset. If you dont move around mails between different
mailboxes, the file creation date should be the date of the first
delivery to the final mailfolder.

Oliver
- --
Protect your environment - close windows and adopt a penguin!
PGP-Key: 3B2C 8095 A7DF 8BB5 2CFF 8168 CAB7 B0DD 3985 1721
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIFW5Kyrew3TmFFyERAiafAJ94WVXk+iBQQ5kpA4KFJEU0Geth+wCffTn9
QmURmDJOaW0cv3DPzBt7J3c=
=SLTA
-----END PGP SIGNATURE-----
Re: how to delete email with certain date [ In reply to ]
+ Oliver Welter <mail@oliwel.de>:

> If you have shell access, a fast way to do is just a "find -type f
> - -ctime +XXX | xargs rm" on ypur mailfolders
>
> This will remove all files/mails, where the files where created before
> the given offset. If you dont move around mails between different
> mailboxes, the file creation date should be the date of the first
> delivery to the final mailfolder.

Bzzt. Unix has no concept of file creation time. The ctime is the
time of the latest change to the file's inode. (With the exception of
accessing the file, which updates the atime and hence the inode but
does not change the ctime.) That said, in a maildir it is very
likely, though by no means guaranteed, that a file's modification time
(mtime) and (ctime) are both identical to the creation time - meaning
the time when mail delivery to the file was completed.

- Harald
Re: how to delete email with certain date [ In reply to ]
If you have an imap server, point Thunderbird at it and just sort by
date (the default) click to select the first message, scroll down to the
last message to delete and shift-click to select range, push delete and
go get coffee.

Nelson Serafica wrote:
> Does anyone has a script/procedure how to delete an email from a
> certain date.
>
> Example:
>
> I have 30,000 emails in cur directory and want to delete emails
> receive from January to March 2008 and let emails receive from April
> 2008 onwards remain.
>
> Is there a faster way to do this? I created a script but still delete
> some emails that are not intent to delete.
>
> ------------------------------------------------------------------------
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://ph.mail.yahoo.com
> <http://sg.rd.yahoo.com/mail/ph/footer/def/*http://ph.mail.yahoo.com%20>