Archive for November, 2007

Some would say that Lighttpd is a more optimal solution for busy webservers.  DWG has just posted a tutorial on how to install lighttpd on your cPanel server instead of Apache:

http://www.dancewithgrenades.com/?page=37

A few years back, a very skilled programmer created a proxy script that makes is possible for users behind firewalls to access the ports servicing cPanel, Webhost Manager, and Webmail. You can install or download the proxy here:

http://cpanelproxy.net/

http://cpanelproxy.net/autoinstall

There’s a small issue with the webmail proxy on cPanel 11 servers, but there’s a fix located on the SourceForge site to allow it to work.

Sender callouts is an existing feature in cPanel that tells Exim to hit a sender’s mail server to find out of the sender exists.  This tends to lead to some false-positives when aliases are used to send email.  If you want to keep callouts enabled but ensure that certain people are able to reach you, you can set up a whitelist for email addresses and domains that will not be checked.

Tutorial taken and condensed from http://forums.cpanel.net/showthread.php?t=45370

Important:  before you make changes, it’s a good idea to make a copy of your /etc/exim.conf file!

1.  Create the whitelist file to list the safe senders.  To allow an entire domain, use *@domain.com

touch /etc/whitelist_senders

2.  In WHM’s advanced exim configuration section, add this line anywhere in the first box:

addresslist whitelist_senders = wildlsearch;/etc/whitelist_senders

3.  Scroll down to the ACL section (the three boxes together) and look for these lines:

#sender verifications are required for all messages that are not sent to lists

require verify = sender/callout
accept domains = +local_domains
endpass

Change this to:

#sender verifications are required for all messages that are not sent to lists

deny
!verify   = sender/callout
!senders  = +whitelist_senders

accept domains = +local_domains
endpass

4.  In the same section, locate this part:

#!!# ACL that is used after the DATA command
check_message:
require verify = header_sender
accept

Change to:

#!!# ACL that is used after the DATA command
check_message:
deny
!verify   = header_sender
!senders  = +whitelist_senders

accept

Then save and exit.  When exim is done restarting, send a test message to and from your server to make sure mail is working properly.

cPanel servers use a service called antirelayd to force users to authenticate by either specifying an SMTP password or using pop before SMTP. Any IP that has been authenticated is automatically added to /etc/relayhosts, but is then removed by antirelayd 30 minutes later. If you want to permanently allow an IP to relay mail through your server, you have to add the IP to /etc/alwaysrelay.

This file will usually not exist by default. All you need to do is create it, then list your IP’s line by line:

/etc/alwaysrelay
192.168.1.2
192.168.1.3

When logging into cPanel or WHM you see the following error:

Unactivated License File

To update the license file, run this command:

/usr/local/cpanel/cpkeyclt

This is assuming that the server’s IP has a valid cPanel license.

A buildup of spam and trash in user accounts can occupy several gigs worth of space. To easily remove spam and trash from your users’ accounts, you can use the following commands:

Maildir/Courier-IMAP:

rm -rf /home/*/mail/*/*/.spam/*
rm -rf /home/*/mail/.spam/*
rm -rf /home/*/mail/*/*/.Trash/cur/*
rm -rf /home/*/mail/*/*/.Trash/new/*

CPPOP:

rm -rf /home/*/mail/*/*/spam
rm -rf /home/*/mail/spam
rm -rf /home/*/mail/INBOX.Trash
rm -rf /home/*/mail/*/*/INBOX.Trash

To delete the cPanel trash folders:

rm -rf /home/*/.trash/*

In old cPanel versions there was a file-based mail system called ‘cppop’ that is known to be very inefficient for busier mail servers. A bug within cppop allows the main cPanel user to see all the sub-email accounts when logged in through Horde. Upon upgrading to the new Courier-IMAP (maildir) system, that bug was corrected and will therefore not allow the main user to see other accounts. However, a new script in the latest cPanel 11 releases will allow you to restore this functionality. To do this, simple run this command:

/scripts/linksubemailtomainacct

In case you are not running cPanel 11 or do not want to do this for all your accounts, you can manually do this by creating symlinks:

ln -s /home/username/mail/domain.com/user/ /home/username/mail/.user@domain.com

Substitute “user” for the email user, and “username” for the cPanel user on the system.

Note that all new cPanel accounts should automatically have these links. Running the script is only necessary if you’ve upgraded your mail system or moved a user from a server running cppop.

Since x3 there are no more evil HTML files to update.  Instead, you can create plugins to add your own icons to cPanel to link off to other sites or features.  cPanel now has a nice little plugin generator where you can  upload the image and specify where the link will go:

http://www.cpanel.net/plugins/devel/install.htm

Once you’ve created one, you would register the plugin according to cPanel’s instructions and activate it in your feature manager.

When migrating user emails manually from an mbox server to a maildir server, it’s usually preferred to run a partial conversion using the convert2maildir script. However, in some cases you may want to do a mailbox individually to either do it quickly or to restore it to another location. cPanel has a built-in script for this:

/usr/local/cpanel/3rdparty/mb2md/mb2md -s /home/username/mail/domain.com/user/inbox -d /home/username/mail/domain.com/user/

The first first argument following the ‘-s’ switch will indicate the original mailbox file in mbox format. The second following the ‘-d’ switch will be the location of the folder in which to store the mail folder in it’s converted format.

There are some cases where you may want to disable stats programs from running for certain users. To do so, open up their user file in /var/cpanel/users and add these lines:

STATGENS=WEBALIZER,AWSTATS,ANALOG
skipanalog=0
skipawstats=1
skipwebalizer=0

Of course, 1=yes and 0=no, and if the stats program is not enabled in the server it won’t run at all, regardless of whether it is enabled for a specific user.



Site Navigation