Forums

Resolved
0 votes
Hi,
A while ago, something weird happened in one of my mailbox users deleted items when using Evolution email against the ClearOS IMAP Server. When she tried to expunge her deleted items it appeared to work and then suddenly all the deleted items re-appeared along with what appears to be multiple duplicates of the deleted items. This kept happening and now she has literally millions of deleted items and any attempt to expunge them from within Evolution seems to make things worse.

Is there a way I could just delete the physical files from the /usr/lib/cyrus-imapd/ folder or will this break Cyrus.

I had a look around here and on the Cyrus IMAP site and can't seem to find a way to remove these files from a command line.

Any help would be appreciated as this is driving me nuts and making my backups take longer and longer plus the danger of using up my free disk space.

Graham Sivill
In Mail
Wednesday, January 27 2021, 12:46 PM
Share this post:

Accepted Answer

Wednesday, January 27 2021, 02:11 PM - #Permalink
Resolved
0 votes
There are all sorts of things you can do. I have the following three lines added to the events section of my /etc/cyrus.conf:
  delprune  cmd="cyr_expire -E 1 -X 7 -D 7" at=0110
spamPurge cmd="ipurge -s -X -f -d 5 user/*/Junk" at=0102
trashPurge cmd="ipurge -s -X -f -d 350 user/*/Trash" at=0103
I believe they work but you can research them. It could be the cyr_expire command you are looking for. I also have a cron job:
/usr/lib/cyrus-imapd/cyr_expire -E 1 -X 7 -D 7
Because of this duplication, I don't know which is doing the work!

Individual mailboxes can be manipulated with the cyradm command which you can use with "cyradm localhost". Your root password should work.

Ultimately you can delete individual files from /var/spool/imap and wait for it to re-index overnight.
The reply is currently minimized Show
Responses (10)
  • Accepted Answer

    Saturday, January 30 2021, 04:44 PM - #Permalink
    Resolved
    0 votes
    Nick,

    Thanks!

    Graham Sivill
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, January 30 2021, 04:09 PM - #Permalink
    Resolved
    0 votes
    Glad it worked.

    I've just edited the the accepted answer to say that the three lines I've added to /etc/cyrus.conf should go in the events section.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, January 30 2021, 02:54 PM - #Permalink
    Resolved
    0 votes
    Nick,

    Sorry for my delay getting back to report my findings, I had the coronavirus jab and it knocked me for six so I am only just back at my desk today!
    Everything seems to be back to normal again my daily backup reports seem OK again and the mailbox is now behaving itself so the fixes seem to have worked.
    Thanks as always for your help.

    Graham Sivill
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 27 2021, 04:49 PM - #Permalink
    Resolved
    0 votes
    Nick,

    It was accepted OK but it will be interesting to see if it gets an error when it runs at 3 AM tomorrow.
    I will keep an eye on it and will report back tomorrow!

    Graham Sivill
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 27 2021, 03:52 PM - #Permalink
    Resolved
    0 votes
    I don't know if your command line needs to be quoted to stop it taking the first parameter as the user, but I don't really know crontab well.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 27 2021, 03:50 PM - #Permalink
    Resolved
    0 votes
    Nor am I but I don't do it that way. I just put the command in a little file in /etc/cron.daily and make it executable. I think your error is to do with the required crontab format. Have a look at "man crontab".
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 27 2021, 03:50 PM - #Permalink
    Resolved
    0 votes
    Nick,

    Sorry I realised what I was doing wrong so I have changed the line to:

    0 3 * * * /usr/lib/cyrus-imapd/cyr_expire -E 1 -X 7 -D 7


    Which I am hoping means do it a t 3 AM every day of the week.

    If you can see any issues with that please let me know!


    Graham Sivill
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 27 2021, 03:37 PM - #Permalink
    Resolved
    0 votes
    Nick,

    The deletion went fine so the "/var/spool/imap/l/user/lynn/Deleted Items" folder is now empty. So hopefully when the re-indexing occurs all will be well.

    I added the 3 lines on the end of the cyrus.conf file OK.

    However when I ran "crontab -e" and added the line you had given when I saved and exited nano I go this error:

    no crontab for siv - using an empty one
    crontab: installing new crontab
    "/tmp/crontab.4Yd8Ak/crontab":23: bad minute
    errors in crontab file, can't install.
    Do you want to retry the same edit? (y/n) y


    I pressed Y and tried again but get:

    crontab: installing new crontab
    "/tmp/crontab.4Yd8Ak/crontab":23: bad minute
    errors in crontab file, can't install.
    Do you want to retry the same edit? (y/n)


    So I pressed N and exited so not sure what I am doing wrong here?

    Graham Sivill
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 27 2021, 03:20 PM - #Permalink
    Resolved
    0 votes
    Be careful with your parameters. I am pruning 7 days after deletion. You may decide it is too short.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 27 2021, 02:48 PM - #Permalink
    Resolved
    0 votes
    Nick,

    Thanks very much for your response, I will delete the files in "/var/spool/imap/l/user/lynn/Deleted Items" first, and this should hopefully reduce the load on my disks and then I will implement the changes /etc/cyrus.conf and cron.daily.

    I will report back if that has worked.

    Graham Sivill
    The reply is currently minimized Show
Your Reply