Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

how to delete email with certain date

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


ntserafica at yahoo

Apr 27, 2008, 7:28 PM

Post #1 of 4 (1985 views)
Permalink
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


mail at oliwel

Apr 27, 2008, 11:27 PM

Post #2 of 4 (1892 views)
Permalink
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-----


hanche at math

Apr 28, 2008, 1:04 AM

Post #3 of 4 (1906 views)
Permalink
Re: how to delete email with certain date [In reply to]

+ Oliver Welter <mail [at] oliwel>:

> 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


jeff at m2

May 1, 2008, 1:40 PM

Post #4 of 4 (1862 views)
Permalink
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>
Attachments: jeff.vcf (0.24 KB)

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.