Tag Archive: plesk


The other day, I encounetered a problem where Plesk would fail to save settings from the Web Hosting Settings page, giving only this error:

Error: Unable to update hosting preferences: hosting update is failed: webstatmng is failed –unset-config –domain-name=Domain name –stat-prog=

Rather uninformative, but it turned out to be fairly simple. The box had been upgraded from Plesk 7.5.4 to 9.5.4, and it seems something went wrong in the psa database:

# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT d.name, h.webstat FROM hosting h, domains d WHERE dom_id=id AND name = 'example.com';"
+-------------+---------+
| name        | webstat |
+-------------+---------+
| example.com |         | 
+-------------+---------+
1 row in set (0.00 sec)

To remedy this, run the following MySQL query. Replace ‘none’ with ‘webalizer’ or ‘awstats’ where desired:

# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "UPDATE domains d, hosting h set h.webstat='none' WHERE h.dom_id=d.id AND d.name='example.com'"

Or if you have more than one domain that has this problem, run the follwing to change all the empty webstat fields to ‘none’:

# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "UPDATE hosting SET webstat='none' WHERE webstat = '' "

Now, you can go back to Plesk’s Web Hosting Settings page and save your settings.

I came across an error after upgrading a Plesk server from 8.6 to 9.2.3:

# /usr/local/psa/admin/sbin/mchk --with-spam
==> Checking for: mailsrv_conf_init... ok
==> Checking for: mail_mailbox_restore... ok
==> Checking for: mailsrv_entities_dump... ok
==> Checking for: mail_admin_aliases... ok
==> Checking for: mail_auth_dump... ok
==> Checking for: mailman_lists_dump... ok
==> Checking for: mail_responder_restore... ok
==> Checking for: mail_drweb_restore... ok
==> Checking for: mail_kav_restore... not exsists
==> Checking for: mail_spf_restore... ok
==> Checking for: mail_dk_restore... ok
==> Checking for: mail_grey_restore... ok
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "pop3d"
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "pop3d-ssl"
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "imapd"
awk: cmd. line:50: (END OF FILE)
awk: cmd. line:50: invalid char '�' in expression
unable to process "imapd-ssl" 

View full article »

Today I got tasked with removing duplicate mails from a mail folder with over 100,000 mails in it.  Doing this from a mail client is so impractical, it’s not even worth giving any thought at all.  Fortunately, the mailbox is on a mail server using Maildir style mailboxes, so I knew this could be done with minimum effort.

I discovered the ‘reformail’ utility, part of courier-imap, and after a few trial runs, I settled on the following:

# cd /path/to/mailbox/Maildir/cur

# for i in `find . -type f`; do reformail -D 10000000 /tmp/duplicates <$i && rm $i; done


-D looks for, and deletes duplicates.

10000000 is the length of the temporary file where a list of message IDs will be written

/tmp/duplicates is the aforementioned temporary file.

The temporary file needs to be big enough to accommodate the message ID of each mail.  In this particular case, I have found the average length to be 54 characters, but I would suggest using around double that to be safe.  So adjust to your needs.

In a big mail folder, and especially on ext3, this will take a long time to complete.