Skip to main content

Delete old emails have no effect

Comments

9 comments

  • quietFinn
    Hello, I'm trying to delete emails older than 136 weeks from cPanel (whm v96.0.11) -> Email Disk Usage -> Manage -> Custom query -> savedbefore 136weeks -> Success: The operation on "INBOX" succeeded. -> but the emails are not deleted. Any hints? :) Thanks

    Maybe you can find help here:
    0
  • cPRex Jurassic Moderator
    It's possible that the account was migrated to the current server in the last 136 weeks, which affects the timestamp used in that command. If that is the case, you'd need to manually remove the emails from the filesystem directly through SSH or File Manager.
    0
  • aadipop
    It's possible that the account was migrated to the current server in the last 136 weeks, which affects the timestamp used in that command. If that is the case, you'd need to manually remove the emails from the filesystem directly through SSH or File Manager.

    hmm ... it is possible to be a migrated account ... but if I try to get the size of files older than 136 weeks from cli `find . -type f -mtime +952 -printf '%s\n' | awk '{a+=$1;} END {printf "%.1f GB\n", a/2**30;}'` I got the expected size ... I suppose that means that the files are timestamped correctly is there any ex. for deleting emails older than x days/weeks from cli?
    0
  • aadipop
    I think I had this problem also last year but I forgot how I manage it ... and no cli history from then :(
    0
  • cPRex Jurassic Moderator
    I believe the script actually uses ctime instead of mtime.
    0
  • aadipop
    yep, with ctime the size is 0 ... so should I go with [QUOTE]find ./* -mtime +365 -exec rm {} \;
    ?
    0
  • cPRex Jurassic Moderator
    I would first run the command without the "-exec rm {} \;" portion as that would show you a list of what it finds. Then you can confirm if that is what you want to remove.
    0
  • aadipop
    it works with the following custom dovecot query BEFORE 31-May-2020
    0
  • aadipop
    thanks for helping :) have a good day
    0

Please sign in to leave a comment.