Tag Archives: WHM Cpanel

Configure iPhone for cPanel Email

I get asked this so many times, I though I would save myself a bit of time, and publish a simple guide to setting up an iPhone for a POP3 or IMAP email account. Although the title says for cPanel, this guide is fine for just about any POP3 or IMAP account where you know the server and account details.

The screenshots were taken from my iPhone 4 runnng iOS 4.3.x. So, lets start.

Tap the Settings icon on your iPhone’s home screen. This will bring you to this screen (below).

iPhone Settings Read More…

Exim Queue Management Tutorial

So, you have got yourself a shiney new dedicated or VPS server with cPanel or DirectAdmin or some such installed. It probably won’t be long before you have to start checking the exim mail logs and the exim mail queue to trace problems being encountered by customers.

I have put this article here more as an aide-memoir than anything. If anyone finds it useful, I’d love to hear from you!

Respect the exim queue

One of worst things you could ever do as an admin, when finding a mail queue with hundreds or thousands of frozen or delayed messages in it, is to simply clear the queue. DONT DO THIS! You might just as well not run a mail server at all. The messages you remove in this way will just vanish without a trace – your customers and the people they communicate with won’t have a clue what happened, and your service will soon be viewed as unreliable.

Sadly, many inexperienced admins use the graphical UI to do just that – because it’s easy. However, with just a few simple commands, it can become possible to inspect and manage the queue with much greater elegance.

So, read on to find out how Exim queue management can be done from the command line. Read More…

Stopping Pushing “47 GETDISKUSED blah” for UID: 47 messages in Cpanel logwatch

Just a quick hint here to stop your daily logwatch email being filled up with messages like this:

Cp-Wrap[3624]: Pushing "47 GETDISKUSED enquiries domain.co.uk" to '/usr/local/cpanel/bin/eximadmin' for UID: 47 
Cp-Wrap[3624]: CP-Wrapper terminated without error

Just go to the /etc/logwatch/conf/ignore.conf file, and add the following lines:

^Cp-Wrap.*?Pushing .*?GETDISKUSED.*?UID: 47
^Cp-Wrap.*?CP-Wrapper terminated without error

That will filter out those annoying lines. Simples!

How to Configure Exim to receive email for domain only from specific IP addresses

This article describes one way to limit incoming SMTP connections for specific domains to a list of specific safe relay IP addresses. Let’s suppose that you have a domain, mydomain.com – and you want to filter all email for this domain via an external host – lets call it filtermail.com.

You would typically set the MX records for mydomain.com to point to in.filtermail.com as follows:

mydomain.com. 14400 IN MX 10 in.filtermail.com.

And, presumably, you would configure filtermail.com to send your sanitised, cleaned mail back to mail.yourdomain.com and set your exim config to accept all mail locally for your domain. Great, so now you are happily filtering your mail for spam – but wait… some sneaky monkey decides to try sending spam directly to mail.mydomain.com, and your exim happily receives it, because exim isn’t aware of the DNS settings, and doesn’t know any better.

So, we need to tell exim NOT to accept any mail for mydomain.com UNLESS it is coming from, lets say for the sake of argument, out.filtermail.com. Let’s say that out.filtermail.com has an IP address of Read More…

Bash Script to place 404.shtml and favicon.ico in home directories

OK, so you’ve noticed how your error_log files are just full to busting with 404 errors for favicon.ico and 404.shtml? Annoying isn’t it, especially when you have a lot of activity on a server, as these files can mushroom out of control.

This script will go through each user account’s home directory, and where it doesn’t find then, it will place a copy of 404.shtml and favicon.ico for you. Read More…

Bash Script to scan folders and PHP files for bad permissions

This script will run through all Cpanel user account home directories and recursively do the following:

  • check for directories that have the write bit set for group(g) or other(o) – and reset any found to 755 permissions.
  • check for any files with the .php extension and that have any access bits at all allowed for other (o), write/execute bits set for group(g), or execute bit set for user(u) – and reset any found to 640 permissions.

It is quite easy to modify for your own purposes, but these permissions are generally a good starting point when on a server running PHP with the suPHP module (THIS WILL BREAK EVERYTHING IF YOU ARE RUNNING PHP AS DSO). Read More…