• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Plesk saving emails

M

Mark Priest

Guest
Hi All,

I have always had a problem with plesk saving emails. Even if they are not set to save them on the server on the customers machine.

A. How can I stop this

B. How can I remove all emails from the server over x days old
 
You can delete all the files in a dir older than a 30 days with:

find /var/qmail/mailnames/domain.com/username/Maildir/cur/ -name \* -mtime +30
 
Hi Attomic

That's great thanks!

Any way of doing it as a wildcard for say all accounts?
 
Sorry atomicturtle. thats a find command wouldnt you use the rm?
 
This will remove it:

find /var/qmail/mailnames/domain.com/username/Maildir/cur/ -name \* -mtime +30 -exec rm -f {} \;


It would be safer to script something up to do this than to try and condense it all into one line. First off if your users are running IMAP, then you'll have folders under Maildir on each account. The reason you dont want to do this recursively is that there are other files in those dirs you dont want to delete. So maybe something like this to find the dirs:

find /var/qmail/mailnames/ -name cur -type d and follow that up with your deletes. Scripted (rough, untested)

for i in `find /var/qmail/mailnames/ -name cur -type d`; do

find $i -name \* -mtime +30 -exec rm -f {} \;
done
 
Thanks attomic

That's great, it only seems to be a couple of users anyway, probably they have their outlook set up to save for eternity or its corrupt.
 
Back
Top