Plesk scheduled task to empty mailbox not working

358 views Asked by At

I have a client who has email forwarded to Gmail (for better spam filtering). I set up the forwarding in Plesk but left a mailbox so that she can send email from her own domain rather than from Gmail. Unfortunately Plesk/Qmail leaves a copy of every (forwarded) email in her Inbox on my server, which periodically shuts my server down after filling the hard drive.

I've tried setting up a scheduled task in Plesk, but it's not working. I just found 25,000+ emails in her box. This is the command that I got to work from SSH:

/var/qmail/mailnames/herdomain.com/hername/Maildir/cur -mtime +3 -print | xargs rm

(domain names have been changed to protect the "innocent")

Why wouldn't this work on my Linux server running Plesk Parallels 12.0.18?

2

There are 2 answers

0
Oleg Neumyvakin On

Check new folder: /var/qmail/mailnames/herdomain.com/hername/Maildir/new

0
Simon Ilett On

I use this

find /var/qmail/mailnames/domain/user/Maildir/curr -mtime +X -print | xargs rm
find /var/qmail/mailnames/domain/user/Maildir/new -mtime +X -print | xargs rm

where +X is your time

+7 = 7 days