Application to Download All Mail Directories After a Certain Time

A client of mine who would like to avoid a server upgrade (mainly for mail) asked if there’s any way to set up a computer to download all the mail locally after 14 days. He wants the mail available to his employees on their phones and tablets for that long in case they need it, but thereafter archived on one machine in the office to get it off the server.

I know any POP3 client can do this for inbox mail, but I’m not aware of any way to download Sent, Trash, etc.

OS doesn’t matter because this would be a machine dedicated to that one purpose. It doesn’t necessarily need to be a client, either. It can be another server accessible via a client when archived mail needs to be accessed.

Any ideas?



So: email older than 14 days belonging to all mailboxes is archived to one big mailbox?

Imapsync can do that, it has a cutoff date option as part of the CLI which can be set to -14 and then it will keep the big mailbox updated every day (incremental updates, yay) and move mail older than 14 days off the server.

I am assuming that the employee mailboxes can be accessed via IMAP in addition to POP3.

1 Like

Yes, that’s the idea. Or it could be some other time period. 14 days was just a number we threw around.

I didn’t know Imapsync could delete from the remote server. That would work. I could install a server on the machine that they can access locally through Roundcube or something along those lines if they actually need to access the files.

Maybe I’ll set up a test account or two and install Imapsync on the AlmaLinux box I’m testing (which is still humming along nicely, by the way). If I have to build the client a Linux box and set it up there, it will give me an excuse to make a trip to Georgia and get out of this blasted snow and cold weather for a while.

The idea is to get the mail off the public server to avoid the need to upgrade. I think this might be the ticket. Thanks for your help.


  1. 14 days or any other user defined period can be specified at the command line, no porblem.

  2. Imapsync does delete mail and I use it to deprive Google of some extra income that it doesn’t need and to earn for myself some income that I very much need by archiving / deleting Gmail / Gsuite email for users who are about to exhaust their quota and are being pestered by Google to upgrade. Imapsync to the rescue!

Glad I could help Richard. Hope you do get to move away from the snow for a bit.

1 Like

Thanks again. I’ll try it out in my office and set it up for him when I get it working right.

We’ll still have to reinstall / restore before CentOS 7 goes EOL, but this should avoid having to upgrade the server size-wise just to store ancient mail. It also avoids the annoyances that come with new recycled IP addresses.


They could do a cronjob with rsynch that moves the e-mail to a place of his choosing at anytime he wants to, then mailboxes and mails are intact, We have sat it up at alot of Hospitals and lawyers who need it “archived” and not lost.

No idea what mail system they run but Dovecot has a plugin for that function.

1 Like

That’s one of the options I’m considering.


1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.