Rebuild/Fix Mail Dbs/Boxes

DigiCrime

Well-Known Member
Nov 27, 2002
399
0
166
Seen this in WHM, what exactly does this feature do

cPanel.net Support Ticket Number:
 

spaceman

Well-Known Member
Mar 25, 2002
517
8
318
If I click on this option, I see lines like this:

Incorect mode on mailbox /home/account/mail/domain.com.au/info/inbox.pop (0644).. fixing

Fine great, they're being 'fixed', but can anyone tell me how (and why) are they getting 'broken' in the first place?

I help to manage two dedicated servers, and it seems that if I click on this option in WHM, there are always at least a few fixups that have to be performed EVERY DAY. Surely this is indicative of something that should be fixed at source (so that it doesn't keep on happening)??

Thanks for your comments.
 
Last edited:

xion

Active Member
Apr 6, 2003
25
0
151
Same thing on our servers. I'd love to know why that is happening also. For now, I've just set a night cronjob to run it.
 

spaceman

Well-Known Member
Mar 25, 2002
517
8
318
Originally posted by xion
Same thing on our servers. I'd love to know why that is happening also. For now, I've just set a night cronjob to run it.
Sounds like a plan. I'm considering the same, but will hold off until I find out more about why it's happening and whether running a daily 'fix' is a good thing.
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Although the creation of the incorrect settings seems to be, one of life's little mysteries, you would do well to setup a daily (if not twice) cron job. It does makes a difference if the settings are incorrect -- had Clients with eMail problems and after running it, they were fixed.

I usually run it 4 or 5 times a day as, whenever I use the "Manage Mail Queue" to delete garbage eMails I will next use the "Fix/Rebuild" link -- since I'm there anyway. ;)
 

Peoplespaces

Well-Known Member
Oct 1, 2001
262
6
318
cPanel Access Level
Root Administrator
This feature I believe fixes things like mailbox locks that happen when the download is interrupted.

We get a dozen a day fixed and we run it several times a day.
 

spaceman

Well-Known Member
Mar 25, 2002
517
8
318
Official tech response from cPanel (Clifford P):

[cPanel] "...a lot of times this does fix as mentioned in the thread items related to inbox locks (i.e. where a clients pop connection suddenly dies). I'm not certain as to other causes of the incorrect permissions, they can range from external scripts modifying the file permissions to older emails that are transfered over from different cpanel servers."

[Me] So can I assume that you approve/recommend that we run an hourly cron job to run this script?

[cPanel] It won't harm anything I can say that much, hourly might be a bit much but again it shouldn't harm anything at all.
 

Watcher_TVI

Registered
Mar 10, 2003
4
0
151
It appeared to me there was some issue related to accessing web mail and permissions with Cpanel. After several complaints about clients not receiving mail. I had to set it up on a Cron to keep things repaired. Since I did there hasn't been any complaints about mail delivery...
 

(cmo)

Member
Feb 28, 2003
11
0
151
How to setup cron

I need to know how to setup the cron to do the automatic fix at least twice a day. I am not an expert in SSH.
 
R

Ramsy

Guest
Originally posted by icanectc
Yes how do we setup a cron job to run this? Thanks for any assistance.
in ssh:
crontab -e (as root)

add:
0 * * * * /scripts/mailperm > /dev/null 2<&1

or in freebsd:
@daily /scripts/mailperm > /dev/null 2<&1

This will run the script daily @ 0:00
 

sneader

Well-Known Member
Aug 21, 2003
1,195
65
178
La Crosse, WI
cPanel Access Level
Root Administrator
Thanks Ramsy, that was VERY nice of you to document this for us newbies.

If I want to run this at 3AM instead, am I safe to say that I could modify this to look like:

3 * * * * /scripts/mailperm > /dev/null 2<&1

And what if I wanted to run this a couple times a day, say at 3AM and also 3PM, would it be:

3 15 * * * /scripts/mailperm > /dev/null 2<&1

Now I'm just flat out guessing at this point. :)

- Scott
 

evisions

Well-Known Member
Jan 25, 2004
68
0
156
Hey sneader, actually this line:
3 15 * * * /scripts/mailperm > /dev/null 2<&1

would run the job at 3:03pm every day. The format is:
minute
hour
day (of month)
month
day (of week)

to run twice daily use this:
0 3,15 * * * /scripts/mailperm > /dev/null 2<&1

that will run it at 3am and 3pm daily.

And actually Ramsy's post of:
0 * * * * /scripts/mailperm > /dev/null 2<&1
will run the script at the top of every hour.

for more information type:
man 5 crontab

there are examples in the man page.
 

eazistore

Well-Known Member
Nov 7, 2003
69
0
156
Singapore
Originally posted by evisions
Hey sneader, actually this line:
3 15 * * * /scripts/mailperm > /dev/null 2<&1

would run the job at 3:03pm every day. The format is:
minute
hour
day (of month)
month
day (of week)

to run twice daily use this:
0 3,15 * * * /scripts/mailperm > /dev/null 2<&1

that will run it at 3am and 3pm daily.

And actually Ramsy's post of:
0 * * * * /scripts/mailperm > /dev/null 2<&1
will run the script at the top of every hour.

for more information type:
man 5 crontab

there are examples in the man page.
Hi evision,

Can I ask you somthing?

I have added this:
0 12,15 * * * /scripts/mailperm > /dev/null 2<&1

This means that it will run everyday at 1200hrs and 2400hrs.
Meaning running it twice daily.

Is that right?
Thanks for the tips.

Sincerely,
Vincent
 

PWSowner

Well-Known Member
Nov 10, 2001
2,901
4
343
ON, Canada
Your
0 12,15 * * * /scripts/mailperm > /dev/null 2<&1
will make it run at 1200 hours and 1500 hours, or noon and 3pm.

For noon and midnight, you want
0 0,12 * * * /scripts/mailperm > /dev/null 2<&1
because 0 is midnight.
 

eazistore

Well-Known Member
Nov 7, 2003
69
0
156
Singapore
Originally posted by squirrel
Your
0 12,15 * * * /scripts/mailperm > /dev/null 2<&1
will make it run at 1200 hours and 1500 hours, or noon and 3pm.

For noon and midnight, you want
0 0,12 * * * /scripts/mailperm > /dev/null 2<&1
because 0 is midnight.
Hi squirrel,

I have change to:
0 0,12 * * * /scripts/mailperm > /dev/null 2<&1

Thanks for the tips.

Sincerely,
Vincent
 

evisions

Well-Known Member
Jan 25, 2004
68
0
156
Thanks for answering that question directed at me Squirel ;). I'm glad you got it worked out Vincent.