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.

turn off the mail service

Discussion in 'E-mail Discussions' started by OooLong, Apr 20, 2014.

  1. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    So lately I noticed my harddisk were filling up rather quickly and soon running out of space. So I check what was causing all this space usage and one of my domain /home/domain/mail/new folder used up about 35gigs of space. I made mistake doing an ls in the folder and it take about 10minute to finish listing as there are literally millions of file like this:

    1383336285.H468369P62734.ndahcap.domain.com,S\=1549
    1383336288.H928262P63111.ndahcap.domain.com,S\=4044

    This is inside my mail folder:
    drwxr-x--x 2 domain domain 411340800 Apr 20 03:57 new/


    How do I turn off the mail service for a particular domain completely? Thanks in advance.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    It's likely the default address for this account was configured to “catch” any mail that was sent to an invalid email address for your domain. Browse to the "Default Address" option in cPanel and update the default behavior to:

    "Discard with error to sender (at SMTP time)"

    This will ensure emails sent to non-existing email accounts for these domain names will bounce to the sender.

    Thank you.
     
  3. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Is this the mail folder inside /home/$user/mail/new, or /home/$user/mail/$domain/$account/net?

    If it's the second of the two, technically all you would have to do is remove the domain from /etc/localdomains and the server will not deliver mail to it.

    If it's the first one, there isn't currently a reliable way of disabling it because it's actually yourcpaneluser@yourserverhostname, however, you may want to review the contents of some of the emails to see what's causing the mail to end up there. It's usually bounces from PHP/Perl scripts that are not properly configured to use SMTP. You can deter mail from going here by

    1) making sure the default address for the domain is set to :fail:

    2) going to whm -> exim configuration manager and checking this box:

    Code:
    Reject remote mail sent to the server's hostname [?]
    
    3) make sure php/perl scripts sending email from this account are sending from a valid email address
     
  4. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Thanks. I'm not sure about the inner working of DNS but isn't it possible to edit zone records and redirect any mail to some un-existing ip and point it there?
     
  5. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    You can change the MX records for the domains on the server to point to a hostname that doesn't resolve, but that would depend on the answer to the question I asked you in my previous comment.
     
  6. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    It is this: /home/$user/mail/new

    1) making sure the default address for the domain is set to :fail:

    how do I do this?

    2) going to whm -> exim configuration manager and checking this box:

    done


    The mail I'm getting all look like this:

    This message was created automatically by mail delivery software.

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    All mail was send by some randomgeneratename@domain.com


    I did what you told and hope it's sufficient.

    - - - Updated - - -

    Do you mean that I go to edit MX entry and change The lowest numbered MX to some un existing domain?

    My hostname for the current server is some gibberish that already resolve to nothing.
     
  7. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I just tried to shut off exim completely with /etc/init.d/exim stop and exim disable in service manager and I'm still getting these mail, how is that possible?
     
  8. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I am still getting these spam after doing all these steps. I even edit the mx entry and change the MX Destination to some not existing domain and that don't work, shutting off exim still didn't work. So this leave me to two things I haven't tried yet:

    1) You can change the MX records for the domains on the server to point to a hostname that doesn't resolve, but that would depend on the answer to the question I asked you in my previous comment.

    Can you provide a walkthrough on how to do this?

    2) Tracking down what script that is causing all this email send. What's the best way to track what script is causing all this spam?

    Thank you.
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Browse to the "Default Address" option within cPanel and set it to:

    "Discard with error to sender (at SMTP time)"

    Then, assuming you do not want to save any email that already exists for this email account, delete the email account and re-create it. You may want to create it with a new password if you are concerned this email account has been used to send out SPAM.

    Thank you.
     
Loading...

Share This Page