• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Deleting mail

spaceout

Basic Pleskian
I have a client that has been using webmail and never deletes any messages. There are now 15,000 emails and I was wondering if there is a way to easily delete all of the messages older than a certain date?
 
Found it...

I found my answer...seems to work well so far.

find /var/qmail/mailnames/domain/youruser/Maildir/cur -type f -ctime +90 | xargs rm

What it means: look in the user's folder (Maildir/new) for any regular files (-type f) older than 90 days (-ctime +90) and send these files (xargs) to the delete command (rm).
 
Hi spaceout,
I'm facing with the same probelm and I found your post/solution because.
However, before to implement this script, I would like to be sure that the deletion of the file will not cause any problem.

In the directories /var/qmail/mailnames/domain/youruser/Maildir/cur or /var/qmail/mailnames/domain/youruser/Maildir/new, I can find the files and delete the ones older than x days.

BUT... in the /var/qmail/mailnames/domain/youruser/Maildir/ directory, there is a file named "maildirsize" which seems to contain 1 line for each file in the cur/new directory. I don't know the usage of this file and what is the goal of it's content. Would it be possible that Plesk uses it to know the size of the mailbox?

Did you also see this file in the Maildir directory and did you make something special with it?

Regards,
Joel
 
Back
Top