Blog Archive

Thursday, 26 February 2015

Domain has exceeded the max defers and failures per hour

When sending e-mail from a cPanel hosting account, you might find that you get an error message similar to this: "Domain has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded."

If you are getting that error, it means that a large number of e-mails that have been sent from your domain have been rejected by the receiving mail server. Just increasing the limit is not a good idea, as it exposes the server to blacklisting if a spammer compromises an account. You therefore need to find out why so many sent messages are failing. Here are some suggestions on what to look for:

  1. Do you have a mailing list, perhaps for a newsletter? If so, your list might need cleaning up - too many dead e-mail addresses will push you over the limit. Better still, use a third party mailing service such as MailChimp for your newsletters, so you don't risk getting your own server blacklisted.
  2. Has your account been hacked? Try running an exploit scan (eg. using Configserver Exploit Scanner [CXS]) and make sure all the scripts running on your hosting account are up-to-date.
  3. Are any of your mailboxes forwarding to another mail service such as gmail or hotmail? This is a terrible idea! Delete those forwarders! If you want to get your mail into gmail, you need to 'pull' it from the gmail end, not 'push' it from the cPanel server (likewise for other mail services). Why? Well, if spammers send mail to your mailbox, and your mailbox forwards it to gmail, gmail will reject it (with a message like this: "Our system has detected an unusual rate of unsolicited mail originating from your IP address. To protect our users from spam, mail sent from your IP address has been temporarily rate limited. Please visit to review our Bulk Email Senders Guidelines."). This will count against your failed send limit, causing the above 'max defers/failures' error. It will also get your server's IP address blacklisted, which could cause problems for anyone on the same server sending mail to gmail.
  4. Have any of your mailboxes been hacked? If someone has discovered or guessed your mailbox password, they could be connecting and sending spam. Change your mailbox passwords and run a virus/malware scan on any device that you use to connect to the server.
  5. Login to cPanel and click on the 'Email Trace' icon. Don't enter an e-mail address, just click the 'Run Report' button (this will show details for all mail both in and out of your account). Look through the list for any groups of messages that failed to send from one of your mailboxes - that might give you a clue as to where the failures are coming from.

Wednesday, 29 January 2014

PHPUnit: cannot open file bootstrap.php

This post is google fodder for anyone who comes across the error 'cannot open file: /some/directory/here/tests/unit/bootstrap.php' when attempting to run unit tests with PHPUnit. In particular, I got this error when trying to set up unit tests for a new project in PHPEd. The reason for the error in this case is that PHPEd helpfully adds a default phpunit.xml file including a switch that attempts to load said bootstrap file.

To fix: Just edit the phpunit.xml file (or it might be named phpunit.xml.dist) in the root folder of the project, and remove the switch: bootstrap="tests/unit/bootstrap.php".