The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Blacklisting an e-mail or MX ?

Discussion in 'E-mail Discussions' started by droidman, Jun 21, 2011.

  1. droidman

    droidman Active Member

    Joined:
    Mar 9, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    is it possible to block an MX record, or dk_remote_smtp by name or by ip ? (both if possible)
    something like this:

    mail.remoteserver.com

    and then, everytime someone on my server attempts to mail that host, the e-mail is either deleted or something like that
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Rather than blacklisting those domains from being sent to, you could simply hold any emails sent to those domains without having the message sent (this way you would be able to see which users tried to send to such domains as the messages would be in the queue and held until they time out and are dropped).

    The option to hold domains from delivery is the following:

    Code:
    hold_domains = /etc/helddomains
    Here you would create the file /etc/helddomains and list the domains that will not be able to be sent to. The list will not accept MX record IP addresses or mailserver names but only domain names.

    To add this option, you would go to WHM > Exim Configuration Editor > Advanced Editor and place the option in the topmost field, then save that area.
     
  3. droidman

    droidman Active Member

    Joined:
    Mar 9, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    ok i did what you told me and it is starting to look good
    but i placed the domains like this:

    xxxxxxx.com
    aaaaaa.com
    aieieieie.net

    etc

    so is this right ? no www and no mx and no ip, just the domain name, one per line.
    do i have to restart exim each time i add a new domain ?
    and where are those e-mails held? folder or queue?
    thanks
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The domain without www and no IP at one per line is exactly how you should do it. You don't have to restart exim upon adding any domains to the list. The emails are held in the mail queue. Just ensure never to force the mail queue to process. If you do, those messages will try to deliver due to using the force option for delivery.

    You should be able to test it by trying to send from an account on the server to one of the email accounts you've put into the helddomains list. After sending it, simply go into WHM > Mail Queue Manager and you should see the email still there in the queue. It will not deliver (again, unless it is forced for delivery).
     
  5. droidman

    droidman Active Member

    Joined:
    Mar 9, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    ok great, thanks. that is exactly what i needed
     
Loading...

Share This Page