Properly Reject Invalid Email Published: Dec 18, 2003
  • Rating


Set Exim to Properly Reject Invalid Email the right way and let your Cpanel server run a little easier.

Tired of seeing your mail queue fill up with bounce messages to non-existant spammer email addresses? By default, if an email comes into your server addressed to an invalid recipient, Exim will accept the message from the delivering agent, and then generate a return email to them explaining that the address is invalid. With this little tweak, you can make exim tell the delivering agent that that address is invalid at the time the message is being delivered, meaning no more spam returns cluttering up your queue! Can I get an Amen!? Read on!

This is curtesy of cyberspirit in the cpanel forums. Original thread is loacted here.

Method 1)
1. Open WHM and click on Exim Configuration Editor

2. Click on the Switch to Advanced Mode button.

3. Scroll down until you see the section on ACL's. You'll see three boxes. In the middle box, locate the section that reads - See Section A:

Method 2) Recommended

Login into SSH and su to root

2. pico /etc/exim.conf

3. Ctrl + W and type in: accept  domains   Notice the two spaces. Look for something like this below.

Section A:
accept  domains = +local_domains
accept  domains = +relay_domains
accept  hosts = +relay_hosts
accept  condition = ${perl{checkrelayhost}{$sender_host_address}}


accept domains = +local_domains


accept domains = +relay_domains

add the following:

message = unknown user
verify = recipient

Make sure each line lines up. You might need to add two spaces before each line. The final section will look like this:

accept domains = +local_domains
message = unknown user
verify = recipient
accept domains = +relay_domains
accept hosts = +relay_hosts
accept condition = ${perl{checkrelayhost}{$sender_host_address}}

Scroll all the way to the bottom and click on Save.

That's it! Welcome to much smaller mail queues!
  • Rating


Related Articles

Comments (7)

  • Gravatar - Martin
    Martin 12:35, March 26, 2004
    So this only accepts emails for domains based on your server, which is brillant, but what about separate email accounts?
    E.g. if [email protected] is sent mail can we auto reject that? Would the above script do that? If so, how would it handle catch-all email addresses, setup by default in cpanel?
  • Gravatar - calvin
    calvin 08:31, August 6, 2004
    is it work with new version cpanel + exim?
  • Gravatar - paul
    paul 20:51, October 31, 2004
    i think this needs some updates
  • Gravatar - RICK   CHRONISTER
    RICK CHRONISTER 23:27, April 25, 2006
    my email keep say invalid email when i sign in any on the web thank u
  • Gravatar - Melvin Jones
    Melvin Jones 22:15, November 14, 2007
    INvalid e-mail
  • Gravatar - AOsama
    AOsama 07:44, December 10, 2009
    It does not work within the latest cpanel + exim.<br />
    <br />
    Please confirm?
  • Gravatar - erick
    erick 15:28, March 17, 2011
    Is this still valid as of WHM 11.28?

Add Your Thoughts is a hosting directory, not a web host.

Copyright © 1998-2023