How to Clear SMTP Outgoing Queue in Citadel Server via command line

citadel

I had a spam attack this morning. I cleaned up the account responsible, but now I am stuck with over 80 thousand messages in my citadel SMTP queue. This queue is so large that I can't use WebCit to clear the queue, because it just crashes trying to load all the messages to get them all selected and deleted. Surely there must be some command line way to clear this queue that doesn't require 6 different JavaScript libraries? The instructions given in the citadel documentation only mention WebCit, and I can't get that to work at all due to the size of the queue.

Best Answer

Update: This morning, dothebart@uncensored.citadel.org responded to my support request there, and modified the documentation to have a shell script to clear the SMTP queue. http://citadel.org/doku.php/faq:spam:recover I haven't tried it, but I assume this is now the correct way to do this.

This worked for me, but I'm not sure it's the correct way, or even a good way, of doing this. First, set the expiration policy of the __CitadelSMTPspoolout__ room so that all of the bad messages stuck in your queue will expire: after clicking on view outgoing smtp queue, quickly click advanced before the JavaScript crashes your browser, and then edit or delete this room. Then click Message expire policy, and set "Message expire policy for this room" in a way that will cause all of the crap clogging your queue to expire. Next, connect to your server via SSH and as root run: "/usr/local/citadel/sendcommand TDAP". Then wait for your processor use to fall back to normal, signalling that the purge has finished. Then restart your citadel server a few times. For me, the first restart command I issued via WebCit hung everything hard and I had to go and kill all of the citadel processes, run the db repair scripts included with citadel, and start citadel again via init.d. Then I had to do the purge all over again, and restart twice more before everything finally took and cleared correctly. This is bad and horrible and awful and terrible, and citadel really should have a command line way to just purge the SMTP queue. But if it does, I've never found it. After this experience, I will no longer be using citadel, as it seems there is no timely support either here or at uncensored.citadel.org, and citadel doesn't care enough about administrators to give us the critical tools we need to resolve problems in anything like a reasonable fashion. Thus, citadel is not, and should not advertise itself as, a professional groupware solution. Unless all problems can be cleared from the console, without resorting to random hacks that risk breaking more than they fix, it just can't be used in any environment where stable access to the groupware server is a requirement. All of the other groupware solutions I've used would have had this problem solved in under an hour. It took me from 5 AM this morning until now, 5:08 PM in the evening, without stopping for food or anything else, to get mail back up and running. Unacceptable.