LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-18-2011, 02:50 PM   #1
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Rep: Reputation: 16
Deleted QMail "mess" folder


Oops. I have deleted the folder "/var/qmail/queue/mess/*". I know this is really bad. How do I recover from this?

I did some searches, but all I got was "Whatever you do, DON'T DO THAT". Yes, I feel particularly stupid now.
 
Old 01-18-2011, 03:56 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I'm afraid you have to recreate it.
Take a look here to see what you nee to do

Regards
 
1 members found this post helpful.
Old 01-18-2011, 04:31 PM   #3
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Original Poster
Rep: Reputation: 16
I had just finished rebuilding it when your message came through.

I ended up using this tool:

http://pyropus.ca/software/queue-repair/docs.html

Unfortunately, now my messages seem to be stuck in the queue. I'm still investigating, but any suggestions are appreciated. I am new to QMail (as you might have guessed with the deleting of the queue).
 
Old 01-18-2011, 04:44 PM   #4
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Original Poster
Rep: Reputation: 16
Huh... Weird, I have two things (test emails) stuck in queue, but everything new is moving through.
 
Old 01-19-2011, 08:39 AM   #5
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Original Poster
Rep: Reputation: 16
How not to repair QMail

In the end, I resolved this issue using one of several tools found online. Being a QMail novice, there are several things I could have done differently from the beginning that would have saved me several hours.

Due to an unrelated issue (I'm cheap, and don't want to pay for more backup space), I needed to reduce the volume of data on my server. Upon exploration, 1.6G were sitting in "/var/qmail/queue/mess". A quick peek inside indicated that the message sitting in the queue was a failed delivery notification regarding to the postmaster. Unfortunately, postmaster is the failed location. This appeared to be causing a continous loop of notifications where the postmaster kept failing to send emails to itself, and sent a message to itself (with the entire previous emails appended) to notify of the problem. This email had grown to extremely large size.

The first step was to create a valid location for the email to be delivered to (to stop the infinite loop). I created a "Postmaster" account, though it likely would have been better to alias the postmaster to another account.

Instructions on creating a new email account: http://www.whirlycott.com/phil/pop3.html

Once I did this, and restarted QMail, I was expecting the queue to magically clear itself. This did not happen (maybe I was impatient), so I decided to clear the queue manually. I did this the wrong way. The correct way is to use a removal utility:

Removing Queued mail: http://www.linuxmagic.com/opensource.../qmail-remove/

I removed the mail by deleting the queue folder. The problem with this is that the created files are named pipes (I think). They have very specific names for a reason. This meant I could not just create a the files/folders again and have them work. Instead I needed to use a repair utility to put all of the items back to the way they were supposed to be.

Repair utility: http://pyropus.ca/software/queue-repair/

I did find the documentation a little confusing. In particular, the documentation states that things will be auto-detected but as I worked through the program, it kept telling me that I needed to be more specific. In the end, it only worked once I had specified every option:

Code:
./queue_repair -r -c -b -s 32
The options are clearly explained in the documentation, however I did not know if I had the BigToDo, or not (-b -n options). I tried Big, was wrong, used Not, was correct. I do not know of a good way to tell if you have BigToDo, but if you haven't deleted your "queue/todo" folder then you can see if you have folders in there. If you have folders, you have BigToDo.

Hopefully this will save someone else my pain.

Interestingly, the company I lease my server from has been arguing with me about the usage. I have been burning resources on that machine since I first leased it. They told me to fix the problem (as I was consuming more than my allocated resources), but I had reported it as an issue from the initial install (from the first login).

Currently, my CPU usage has dropped from 144% to 0%, and my logs are not growing at insane speed, and I have shed 1.6G from my HD (33.3%). I can't wait to tell them I fixed their mistake.
 
1 members found this post helpful.
Old 11-01-2011, 04:17 AM   #6
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
Quote:
Originally Posted by kavius View Post
In the end, I resolved this issue using one of several tools found online. Being a QMail novice, there are several things I could have done differently from the beginning that would have saved me several hours.

Due to an unrelated issue (I'm cheap, and don't want to pay for more backup space), I needed to reduce the volume of data on my server. Upon exploration, 1.6G were sitting in "/var/qmail/queue/mess". A quick peek inside indicated that the message sitting in the queue was a failed delivery notification regarding to the postmaster. Unfortunately, postmaster is the failed location. This appeared to be causing a continous loop of notifications where the postmaster kept failing to send emails to itself, and sent a message to itself (with the entire previous emails appended) to notify of the problem. This email had grown to extremely large size.

The first step was to create a valid location for the email to be delivered to (to stop the infinite loop). I created a "Postmaster" account, though it likely would have been better to alias the postmaster to another account.

Instructions on creating a new email account: http://www.whirlycott.com/phil/pop3.html

Once I did this, and restarted QMail, I was expecting the queue to magically clear itself. This did not happen (maybe I was impatient), so I decided to clear the queue manually. I did this the wrong way. The correct way is to use a removal utility:

Removing Queued mail: http://www.linuxmagic.com/opensource.../qmail-remove/

I removed the mail by deleting the queue folder. The problem with this is that the created files are named pipes (I think). They have very specific names for a reason. This meant I could not just create a the files/folders again and have them work. Instead I needed to use a repair utility to put all of the items back to the way they were supposed to be.

Repair utility: http://pyropus.ca/software/queue-repair/

I did find the documentation a little confusing. In particular, the documentation states that things will be auto-detected but as I worked through the program, it kept telling me that I needed to be more specific. In the end, it only worked once I had specified every option:

Code:
./queue_repair -r -c -b -s 32
The options are clearly explained in the documentation, however I did not know if I had the BigToDo, or not (-b -n options). I tried Big, was wrong, used Not, was correct. I do not know of a good way to tell if you have BigToDo, but if you haven't deleted your "queue/todo" folder then you can see if you have folders in there. If you have folders, you have BigToDo.

Hopefully this will save someone else my pain.

Interestingly, the company I lease my server from has been arguing with me about the usage. I have been burning resources on that machine since I first leased it. They told me to fix the problem (as I was consuming more than my allocated resources), but I had reported it as an issue from the initial install (from the first login).

Currently, my CPU usage has dropped from 144% to 0%, and my logs are not growing at insane speed, and I have shed 1.6G from my HD (33.3%). I can't wait to tell them I fixed their mistake.









iam also having same issue of mail stuck in mess folder..i follow your this post and run command
#qmialctl stop
# queue_repair.py --repair

and my qmail get stuck now..

# qmailctl restart
Restarting qmail:
* Stopping qmail-smtpd.
svc: warning: unable to control /var/qmail/supervise/smtp: supervise not running
* Sending qmail-send SIGTERM and restarting.
svc: warning: unable to control /var/qmail/supervise/send: supervise not running
* Restarting qmail-smtpd.
svc: warning: unable to control /var/qmail/supervise/smtp: supervise not running


#ls -la /var/qmail/supervise
drwx-----T 4 qmaill qmail 4096 Oct 4 19:09 /var/qmail/supervise/



iam not able to login in to mail...now what to do..





drwx-----T 4 qmaill qmail 4096 Oct 4 19:09 /var/qmail/supervise/smtp
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] There is no "menu.lst" in my Ubuntu "/boot/grub/" folder. msbstar Linux - Newbie 18 09-15-2012 01:26 PM
How does one "zip" a folder with Linux .? How does Windows user "unzip" same ? brjoon1021 Linux - Software 5 12-19-2010 12:10 AM
BASH:find out if volume "foo"/folder "goo" can be written to SilversleevesX Programming 2 08-28-2010 10:03 AM
After installing XAMPP for linux i have seen the folder "htdocs" belongs to "nobody". tirengarfio Linux - General 6 03-17-2010 01:41 PM
Dovecot - Create new folder gives "INBOX can't be deleted" error fukawi2 Linux - Server 3 09-24-2008 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration