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.

Mass turn off all catchall addresses

Discussion in 'General Discussion' started by oulzac, Nov 23, 2007.

  1. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    Anyone know of a way to do this?
    Anyone know where the info for this is stored on the server, I can not find this as file setting in the account files or in the cpanel files.

    I want to be able to change all default emails (catchalls) to either :blackhole: or :fail: all at once.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    okay, so that gives me the files, but 80% of all accounts have it set to the username, so I would have change:
    *: username
    into *: :fail:

    I am not sure how I can do that with over 500 files at once.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You login via SSH to your server as root and run this command:

    replace :blackhole: :fail: -- /etc/valiases/*

    Thats it. All files will be updated with that one command.

    If you're not sure how to use SSH, now is probably a good time to learn, before making any mistakes. ;)

    Good luck.
     
  5. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    no, you do not understand what I am saying.

    I am not trying to change the setting from blackhole to fail.

    I am trying to change it from usaname to fail

    that command will not do what i need to do.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hmm, well I'm not sure what you mean now, but I thought I did earlier when you said this:
    Anyway, sorry I couldn't help...
     
  7. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    no you did help, you pointed me to the correct files and the location of them.

    the problem I have is none of the default is set to fail or blackhole currently, they are all active, and I want to be able to change them all to be off at once, but from researching there is no way to do this, I will have to manually turn the all off one by one :eek:
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  9. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    BTW, there are plenty of thread to go thru concerning this, use these three words to search the forums to read them.

    set default catchall
     
  10. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    thanks for the link, i did search, but found nothing for what I was looking for.
     
  11. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Can you use grep in a replace? Would something like this work?

    Code:
    replace (\*: :)(.*)(:) \1fail\3 -- /etc/valiases/*

    I'm just thinking out loud and don't really know. It works as a grep find/replace in my text editor.
     
    #11 verdon, Nov 23, 2007
    Last edited: Nov 23, 2007
  12. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    you would need to use vim or vi for that.

    I actually used the perl script from chirpy and it worked perfectly.
     
  13. Tam

    Tam Well-Known Member

    Joined:
    Jul 31, 2004
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    16
  14. testtubebaby

    testtubebaby Member

    Joined:
    Jul 28, 2007
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    I am also looking for that
     
  15. madan.cpanelnet

    madan.cpanelnet Well-Known Member

    Joined:
    Apr 1, 2006
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    INDIA
    Take this simple.. one liner command to do that .....




    root@server [/etc/valiases]# for x in `cat /etc/trueuserdomains | awk {'print $2}'` ; do replace "*: $x" "*: :fail: No Such Address Here" -- /etc/valiases/* ; done



    As a precaution... you may backup your /etc/valiases directory..... before running the above command... but that works

    root@server [/etc/valiases]# cp -apfr /etc/valiases/ /etc/valiases.old
     
  16. Amit Deshmukh

    Amit Deshmukh Well-Known Member

    Joined:
    Jul 1, 2007
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Hi Madan

    Thank you dear.

    That was helpful.

    But I know that already :eek:
     
  17. madan.cpanelnet

    madan.cpanelnet Well-Known Member

    Joined:
    Apr 1, 2006
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    INDIA
    btw .. Amit is my friend :)
     
Loading...

Share This Page