Jun 30 2005
Troubleshooting Email IMAP
yesterday night I kept noticing that maildrop was giving me some error messages on the server. Saying Maildrop could not open folder.
check the log
Jun 26 07:33:30 Jefferson maildrop[4743]: Unable to open mailbox.
Jun 26 07:33:46 Jefferson maildrop[4790]: Unable to open mailbox.
Jun 26 07:33:46 Jefferson maildrop[4767]: Unable to open mailbox.
Jun 26 07:33:47 Jefferson maildrop[4812]: Unable to open mailbox.
Jun 26 07:33:48 Jefferson maildrop[4815]: Unable to open mailbox.
Jun 26 07:33:50 Jefferson maildrop[4848]: Unable to open mailbox.
Jun 26 07:34:05 Jefferson maildrop[4868]: Unable to open mailbox.
Jun 26 07:34:15 Jefferson maildrop[4896]: Unable to open mailbox.
Jun 26 07:34:19 Jefferson maildrop[4917]: Unable to open mailbox.
Jun 26 07:34:32 Jefferson maildrop[4943]: Unable to open mailbox.
I didn’t know why this was happening. This was going for a long time at the servers at work and then it occurred to me that maybe Maildrop was trying to drop the message into a folder and it could not find it.
Here is how I found out how to fix this
There is a user who gets so much spam and usually the spam is put into a folder called .SPAM.TAGGED , I went into his directory and looked for that folder and I found that he had renamed the folder to .SPAM.MESSSAGES
That was the reason why the server was having problems. What I had to do to fix the problem was to create the folder .SPAM.TAGGED inside his directory
still that did not solve the issue. The folders inside the .SPAM.TAGGED folder
were missing.
So I did cp -ax /home/marco/Maildir/.SPAM.TAGGED/* /home/dtrongs/Maildir/.SPAM.TAGGED/
this copied all my files inside that folder then i did
chown -R dtrongs:users /home/dtrongs/Maildir/.SPAM.TAGGED
then I checked the logs and I saw the message dissapear. Then I went into his .SPAM.TAGGED folder and I saw that all those messages were being copied there.
#######################################
So how do I clean the messages inside the .SPAM.TAGGED folder you may ask. After awhile the .SPAM.TAGGED folder gets full of crap and no one bothers to clean that stuff.
Since I use the Maildir format I wrote a little script that looks like this.
I called it cleanmyspam.sh
#!/bin/bash
find /home/ -path ‘*/.SPAM/new/*’ -mtime +30 -exec rm {} \;
find /home/ -path ‘*/.SPAM/cur/*’ -mtime +30 -exec rm {} \;
find /home/ -path ‘*/.SPAM.TAGGED/new/*’ -mtime +30 -exec rm {} \;
find /home/ -path ‘*/.SPAM.TAGGED/cur/*’ -mtime +30 -exec rm {} \;
then I dumped the message inside the cron.daily folder and every night the script goes inside the .SPAM folder and .SPAM.TAGGED and deletes anything that is older than 30 days.
################################################
Continua”Troubleshooting Email IMAP”
