Koozali.org: home of the SME Server

SOLVED - Problem with large number of mails (~33K) in user mailbox

Offline miroj

  • *
  • 26
  • +0/-0
Hi,

I'm confronting an issue with mail, can't read it nor see attachments due the large number of mails (more than 32K mails). Unfortunately the auto-archive function in Horde (to archive mails per year) is not working, and all mails are in one folder (current).

As workaround, I have moved about 20K mails in other folder and the issue has disappeared. I would appreciate a help (if anyone faced similar problem) how to solve the issue, to make mails available in the Archive and appropriate year (hopefully that would be the solution).

Any other best practice or solution to archive mails within SME and the same to be available to users?

Thanks in advanced.
« Last Edit: July 09, 2015, 07:49:30 PM by miroj »
---
"Open Source will apear on your machines anyway"
Paolo Malinverno
Vice President, Gartner Research

Offline Stefano

  • *
  • 10,841
  • +2/-0
Re: Problem with large number of mails (~33K) in user mailbox
« Reply #1 on: July 08, 2015, 11:25:10 PM »
Did you try with an email client like thunderbird?
I'll try to test creating a large number of mails on a test machine

As a possible solution, take a look at imapsync.. yiu can use it to archive emails.. just search the web fir the right recipe

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Problem with large number of mails (~33K) in user mailbox
« Reply #2 on: July 08, 2015, 11:41:54 PM »
You can use standard tools to select and move messages - each message is just a file. For instance, you can do:

cd ~/Maildir/cur
mkdir -p ../.folder1/{new,tmp,cur}
ls -rt | head -40 | cpio -duvmp ../.folder1/cur
ls -rt | head -40 | xargs rm

to copy the 40 oldest messages in INBOX into an IMAP folder called 'folder1' and then delete them from INBOX.

Instead of 'ls -rt | head -40' you could use some other command to generate the file list. e.g. you could use 'grep -l' to select by text (e.g. by subject, or sender), or you could use 'find' to select by date.

Offline miroj

  • *
  • 26
  • +0/-0
Re: Problem with large number of mails (~33K) in user mailbox
« Reply #3 on: July 09, 2015, 07:48:41 PM »
Hi Stefano and CharlieBrady,

@Stefano, yes Thunderbird client was used on regular bases with IMAP, as well a smart phone to read mails. The same problem was occurring in all three cases. I'll look at your proposal for archiving with imapsync.

@CharlieBrady, thanks! This solved the issue. Elegant and logical solution.

I'm marking this issue as solved. Thank you again!

---
"Open Source will apear on your machines anyway"
Paolo Malinverno
Vice President, Gartner Research