web analytics

Category Cpanel

Class ‘horde_Hooks’ not found

After recent cpanel update, I started getting the following error while accessing horde webmail.

A fatal error has occurred

Class ‘horde_Hooks’ not found

Details have been logged for the administrator.

This problem is expected to be fixed before cPanel 11.51 becomes 11.52 and is published to CURRENT, but it is still occurring in the 11.51 build that is in EDGE right now. The temporary fix for that problem is as follows.

Run the below commands.

[root@abc ~]# find /usr/local/cpanel/base/horde -name ‘hooks.php’ -not -wholename ‘*/imp/*’

[root@abc ~]# find /usr/local/cpanel/3rdparty/php/54/lib/php/Horde/Core -name ‘hooks.php’ -not -wholename ‘*/imp/*’

Now, move or remove any files that are listed by the above find commands...

Read More

Enabling detailed debug log in imap

Sometimes your might need to check for detailed logging in email. One of my friends was  developing an email application and he wanted to check what was happening behind the screen when he received an email, moves it to another folder, deletes it etc.

Hence, we decided to enable detailed logging in imap. It was a cpanel server and we used the option imapdebug. Always keep a backup of the file you edit.

root@abc# cp -pv /usr/lib/courier-imap/etc/imapd /usr/lib/courier-imap/etc/imapd.bak.$(date +%F)

root@abc# vi /usr/lib/courier-imap/etc/imapd

Now uncomment the following line.

IMAPDEBUGFILE=”imaplog.txt”

Now touch a file named  imaplog.txt at the root of the account where you want to enable logging. Restart the courier service. Suppose I need to enable logging for greproot@abc.com.

root...

Read More

Migrating emails from mailenable to exim

I wanted to transfer my entire sites from my Windows Plesk server to Linux Cpanel server. I could simply create the new accounts in the new server and copy the files. The main issue was with emails. My windows server was using mail enable, where as the the cpanel server uses exim.

I realized I will have to create all email accounts manually in the new server. A simple tool which will do everything in a click was not available. Losing email was not something I could let happen, so I decided to go ahead with creating accounts and then copying emails. I used imapcopy for it. If anybody wants to do it, you can do it as follows. I am copying the email account test@abc.com to new server. Its password is test123c on both servers.

root@abc [~]# cd /usr/local/src/

root@abc [/usr/local/src]#  wget ...

Read More

Script to clear spoofed emails from email queue

One of my friends email account was hacked, and was used to send tons of spam mails. Some of the mails were sent direct from his account while some others where spoofed.  There were around 50K emails in the queue.

I cleared all mails sent from him with the following command.

exiqgrep -i -f abc@abc.com | xargs exim -Mrm

where abc@abc.com is the account that was hacked.

Still there were close to 49000 mails in the queue. I wrote the following script to clear them. It basically checked the auth_id field in the header section of every email in the queue and if it matches abc@abc.com, then delete the message from the queue.

[root@abc ~]# vi script.sh

#!/bin/sh

phrase=”-auth_id abc@abc.com”

for i in `exim -bp | awk ‘{print $3}’`
do
authid=`exim -Mvh $i | grep auth_id`
if [ “$authid” == “$ph...

Read More

Diskusage of a few domains shown as 0 in Cpanel/WHM

Last day a few domains started throwing incorrect disk usage in WHM. The accounts has a lot of files, but the disk usage was reported as 0 in List Accounts section. Upon checking noticed that someone had played with the fstab and /home was not mounted with usrquota correctly. Did the following to correct it.

[root@abc ~]# cp -pv /etc/fstab /etc/fstab.bak.$(date +%F)

[root@abc ~]# vi /etc/fstab       Add/modify the mount point for home as follows

/dev/mapper/vg0-home    /home   ext4      defaults,usrquota             1       2

[root@abc ~]# mount -o remount /dev/mapper/vg0-home

Alternatively, you can reboot the machine, so that the changes will be picked up from the fstab after making changes.

[root@abc ~]# /scripts/fixquotas –force

When it is executed,...

Read More

***** FATAL: Could not write to /etc/yum.conf

Sometimes while running upcp in a cpanel server, you may encounter the following error and upcp will quit.

***** FATAL: Could not write to /etc/yum.conf

Check if any attributes are set for /etc/yum.conf.

You can check it by issuing the following command.

[root@abc ~]# lsattr /etc/yum.conf
—-i——–e- /etc/yum.conf

If you see an ‘i’  in the output as seen above, then issue the following command to release the attribute.

[root@abc ~]# chattr -i /etc/yum.conf

Now double check that the attribute is gone by issuing lsattr again.

[root@abc ~]# lsattr /etc/yum.conf
————-e- /etc/yum.conf

Read More

‘httpd’ is disabled via ‘/etc/apachedisable’, please re-enable to continue

If you get the following error while running easyapache in a cpanel server, it means httpd is not enabled in service manager.

‘httpd’ is disabled via ‘/etc/apachedisable’, please re-enable to continue

To correct it, do the following.

Login to WHM

Go to Service Configuration -> Service Manager

Check ‘enabled’ and ‘monitor’ for the service httpd

Save

Now try running easyapache again.

Read More

Fantastico Showing blank page

When you access fantastico from cpanel, if it is displaying a blank page, it can be fixed easily.

Login to WHM -> Tweak Settings -> PHP -> cPanel PHP loader.

Check ioncube as the cpanel PHP loader and save the changes.

Now refresh your fantastico page and enjoy 🙂

Read More

Upcp hanging – Bad archive: CPAN-SQLite-0.203.tar.gz

I had been trying to upgrade my cpanel version with upcp last day.

My current version – 11.34

Targetted version – 11.38

Tried many times, but each time it was stuck after the following error.

[20130801.235456]      [16015] ! Bad archive: CPAN-SQLite-0.203.tar.gz
[20130801.235456]      [16015] ! Failed to unpack CPAN-SQLite-0.203.tar.gz: no directory

Upon searching, I identified the problem is with the SQLite module. So I killed the currently running process, updated sqlite and ran again and hurrayyyy it worked.

ps aux | grep upcp      – will list the upcp processes running

kill -9 pid              – kill that process where pid is the process id listed in the above command output

cpan -i CPAN::SQLite   - install the cpanel sqlite module directly

/scripts/up...

Read More

temporarily rejected connection in “connect” ACL: “Host is ratelimited due to multiple failure only connections”

Sometimes you won’t be able to send/receive emails. Telnet may mention a temporary problem as follows.

telnet abc.com 25
Trying 123.456.789.12…
Connected to abc.com.
Escape character is ‘^]’.
451 Temporary local problem – please try later
Connection closed by foreign host.

Upon checking the error log, I noticed the following error displayed.

2013-07-24 03:11:48 SMTP connection from [122.174.199.157]:58121 (TCP/IP connection count = 1)
2013-07-24 03:11:48 no IP address found for host abts-tn-dynamic-157.199.174.122.airtelbroadband.in (during SMTP connection from [122.174.199.157]:58121)
2013-07-24 03:11:48 H=[122.174.199.157]:58121 temporarily rejected connection in “connect” ACL: “Host is ratelimited due to multiple failure only connections (7.9/1h max:5)”

To overcome this error, I did t...

Read More