Page 1 of 3 123 LastLast
Results 1 to 15 of 32

Thread: How Do I Block One Domain From Sending Email From My Server?

  1. #1
    Registered Member
    Join Date
    Jan 2006
    Posts
    35

    Default How Do I Block One Domain From Sending Email From My Server?

    Hello,

    I have one user who is getting hacked a lot and the account is sending out spam emails. I want to disable just his account from being able to send mail at all until he can get his script updated or changed. Any way to do this?

    Many thanks.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,609
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    You can try the following steps. First, in root SSH, run these commands:

    Code:
    touch /etc/blockeddomains
    echo "domain.com" >> /etc/blockeddomains
    Please replace domain.com with the domain name. Do not replace the "" part as that's required, only the domain.com part with the right domain name.

    In WHM > Exim Configuration Editor > Advanced Editor, put the following in the topmost box:

    Code:
    domainlist blocked_domains = lsearch;/etc/blockeddomains
    Locate the "ROUTERS CONFIGURATION" section, and right below these lines:

    democheck:
    driver = redirect
    require_files = "+/etc/demouids"
    condition = "${if eq {${lookup {$originator_uid} lsearch {/etc/demouids} {$value}}}{}{false}{true}}"
    allow_fail
    data = :fail: demo accounts are not permitted to relay email
    Put the following lines:

    Code:
    reject_domains:
    
    driver = redirect
    # RBL Blacklist incoming hosts
    domains = blocked_domains
    allow_fail
    data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Registered Member
    Join Date
    Jan 2006
    Posts
    35

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Wow, talk about a fast response! It seems to be working so far. If I go to re-enable the banned domain is it recommended that I remove all of the things I just added? Or just remove it from the /etc/blockeddomains? Thanks very much.

  4. #4
    Registered User
    Join Date
    Jul 2011
    Posts
    1

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    You can always modify the account in WHM and change the outgoing mail limit to zero.

  5. #5
    Registered Member Indianets's Avatar
    Join Date
    Jun 2008
    Posts
    65
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Quote Originally Posted by GatorJoshD View Post
    You can always modify the account in WHM and change the outgoing mail limit to zero.
    And, this will set the sending limit for this domain to "Unlimited" Unfortunately, 0 implies "unlimited" in this contrast, so you are going to remove all the limits set on the server for this domain.

  6. #6
    Registered Member Indianets's Avatar
    Join Date
    Jun 2008
    Posts
    65
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Quote Originally Posted by ambition13 View Post
    Wow, talk about a fast response! It seems to be working so far. If I go to re-enable the banned domain is it recommended that I remove all of the things I just added? Or just remove it from the /etc/blockeddomains? Thanks very much.
    You can simply clean the file and let it be there -

    Code:
    echo > /etc/blockeddomains

  7. #7
    Registered Member
    Join Date
    Jul 2010
    Posts
    22

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    how can i do this but block all domains except ones i whitelist?

  8. #8
    Registered Member
    Join Date
    May 2006
    Location
    Johannesburg, South Africa
    Posts
    988
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Quote Originally Posted by alexmack View Post
    how can i do this but block all domains except ones i whitelist?
    That's actually a good idea and I would like to know how todo this as well.
    • cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill
    • Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program
    • Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting

    SoftDux- The Leaders in Software
    Use the coupon: cpanel-06 to get 20% off our packages

  9. #9
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,609
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    You could revise /etc/localdomains file to only have the whitelisted domains and place those other domains into /etc/remotedomains file, which would prevent those domains from being able to properly send. Any domain in /etc/remotedomains file will not be placed back into /etc/localdomains file.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  10. #10
    Registered User
    Join Date
    Feb 2008
    Location
    Aliso Viejo, CA
    Posts
    2

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Hi,

    I tried the ‘blocked_domians’ solution with the latest version of cPanel and it isn’t working. Has anything changed with respect to this solution in the latest version of cPanel? I’m simply trying to disallow my demo user from sending email.

  11. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,609
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    How precisely is it not working? Is it PHP mail() or using sendmail, or it is sending via webmail and/or an email client? Are you receiving any type of error message or otherwise? Please provide as many details as possible. Thanks!
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  12. #12
    Registered User
    Join Date
    Feb 2008
    Location
    Aliso Viejo, CA
    Posts
    2

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Thanks for the quick response.

    After implementing the ‘blocked_domains’ solution, I log into the demo account and then into webmail. From there I can send an email. There’s no errors. It just that I can send email from my demo account and so can spammers which is the problem I am trying to solve.

  13. #13
    Registered Member
    Join Date
    May 2006
    Location
    Johannesburg, South Africa
    Posts
    988
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Quote Originally Posted by cPanelTristan View Post
    In WHM > Exim Configuration Editor > Advanced Editor, put the following in the topmost box:

    Code:
    domainlist blocked_domains = lsearch;/etc/blockeddomains
    Locate the "ROUTERS CONFIGURATION" section, and right below these lines:



    Put the following lines:

    Code:
    reject_domains:
    
    driver = redirect
    # RBL Blacklist incoming hosts
    domains = blocked_domains
    allow_fail
    data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.

    Can you please update these instructions for WHM 11.32.x?

    The layout has changed a lot
    • cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill
    • Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program
    • Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting

    SoftDux- The Leaders in Software
    Use the coupon: cpanel-06 to get 20% off our packages

  14. #14
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,609
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Yes, it has changed to the point that the editor is more difficult to give easy instructions to follow. For example, the topmost box is no longer at the top but towards the middle now. I'll see what I can do.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  15. #15
    Registered Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,351
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How Do I Block One Domain From Sending Email From My Server?

    Tristan,

    Just moved to 11.32.3.19 and wanted to confirm the steps we took to re-enable this directive.

    Exim Advanced Editor > Section: CONFIG scroll down to "Add additional configuration setting".

    In the form that appears add:
    Code:
    domainlist blocked_domains = lsearch;/etc/blockeddomains
    Then scroll down to the Section: ROUTERSTART which is below the democheck entry and add:
    Code:
    reject_domains:
    
    driver = redirect
    # RBL Blacklist incoming hosts
    domains = blocked_domains
    allow_fail
    data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
    Just to double check, tail -f /var/log/exim_paniclog or if you're running CSF and have Log Scanner enabled from the command line run "/usr/sbin/csf --logrun" and check if any errors are reported.

Page 1 of 3 123 LastLast

Similar Threads

  1. Block all local domain email not from my server.
    By serichards in forum E-mail Discussions
    Replies: 1
    Last Post: 03-25-2014, 05:34 AM
  2. problem sending email with same domain in the same server
    By AlaEddine in forum E-mail Discussions
    Replies: 2
    Last Post: 12-09-2013, 08:33 AM
  3. Replies: 1
    Last Post: 08-28-2011, 05:44 PM
  4. How to block apache from sending out email
    By vishwas in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 03-07-2005, 02:45 AM
  5. Block sending mail for one domain?
    By handsonhosting in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 01-12-2005, 02:35 AM
bargain