• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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