• 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.

Resolved Deleting old mails from the server

Filipe Silva

Basic Pleskian
Greatings everyone.

I'm in the need of a comand to remove emails older than 30 days from the server. (We are using dovecot/postfix)
I found this : "find /var/qmail/mailnames/domain/*/*/cur -type f -mtime +30 -exec rm {} \;" and it works, but the other IT guy says it is too risky, but I can't find a specific dovecot/postfix comand to delete old mails.
The other solution is to violate the users account and delete old emails in the webmail.

What do you recommend?
Thank you.

PS: I am resorting to this because some users are not accessible to properly configure the email client and it is harder to educate them to use webmail to delete older emails.
 
On a first thought I don't get what exactly the risk would be. Each mail is stored as a single file. To my knowledge there is no static index that points to the files, but files are read on-the-fly when the mailbox is opened. If a file is not there, the mail is not there.
 
I see and agree,

However as I research may exist another option with something like "doveadm -expunge".

EDIT: Found it. For whoever is interested:
"doveadm expunge mailbox Inbox savedbefore 30d -u <user>"
 
Last edited:
Back
Top