• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • 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.

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