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.

How to kill mail to default address

Discussion in 'E-mail Discussions' started by techpro, Sep 1, 2007.

  1. techpro

    techpro Member

    Joined:
    Oct 22, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Cumbria, UK
    My hosting account has a standard default email address of <accountname>@<mailhost>.<hostingservicedomain>. This is no use to me, and I saw the advice given in a recent post was just to ignore it. However this address is filling up with spam and delivery failure messages. If I simply ignore this address my web space will rapidly fill up with junk mail.

    The problem seems to be that this address is given as the return path to the standard cPanel autoresponder messages. Addresses that use the autoresponder receive a lot of spam. The autoresponder replies to the spam, the address of course is invalid, and a delivery failure comes back to this default address. I suspect this address is on some spam lists as well.

    I have set all the options under Mail > Default Address to :fail: no such address here. But these options are only there for my own domains and subdomains. There is no option to do this for this default address. My web host's support says "this address is a valid account on the server, and is not technically part of your domain, so gets passed as valid." Their suggestion is to set up a filter, but I don't know how to do this because the address doesn't appear in a To: header in most of the unwanted mails.

    If it is not possible to get cPanel to kill this mail automatically, is there a script I could run as a cron job to delete the contents of this mailbox once a day? Unfortunately my PHP is not up to writing my own.
     
  2. Damian

    Damian Well-Known Member

    Joined:
    Oct 1, 2001
    Messages:
    95
    Likes Received:
    1
    Trophy Points:
    8
    Look for the option 'Default Mail' under 'Mail Settings'. If you set this to discard :)fail:) it will render the default email account useless. You'll need to delete any mail already in the mail box.
     
    #2 Damian, Sep 3, 2007
    Last edited by a moderator: Sep 7, 2007
  3. v3locity

    v3locity Registered

    Joined:
    Mar 20, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I have a similar issue. This problem exists across 50 domains on my server. Is there a script I could use it have it set all the accounts default email to :fail: or :blackhole: I really don't want to have to go through each one. It would be even better if I could have all new domains automatically set up this way as well.

    Any way to do the same thing to delete the /mail/new folder that all that mail sits in and then mkdir a new folder called /new? I'd love to do this once than do it 50 times.
     
  4. linux.newbie

    linux.newbie Well-Known Member

    Joined:
    Sep 8, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    For new accounts created,
    WHM - Tweak Settings - Catchall account - set it to fail.
     
  5. Nahoo

    Nahoo Member

    Joined:
    Oct 7, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    I would like a way of finding the accounts that use the catchall email accounts first. Is there a nice way of doing this?
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    replace :blackhole: :fail: -- /etc/valiases/*
    Should change all accounts quick and easy.
     
  7. denisdekat09

    denisdekat09 Well-Known Member

    Joined:
    Mar 2, 2002
    Messages:
    265
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Francisco
    Anyone know fo a replace string that can replace anything post *: to :fail: ? I want to change all the default addresses on one server to :fail: but not sure how.

    Thanks for any ideas :D
     
  8. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    First, make a backup copy of your /etc/valiases directory.
    Code:
    cp -apfr /etc/valiases/ /etc/valiases.bak
    Then
    Code:
    for x in `cat /etc/trueuserdomains | awk {'print $2}'` ; do replace "*: $x" "*: :fail: No Such Address Here" -- /etc/valiases/* ; done
    Hope this helps!
     
Loading...

Share This Page