Cpanel / WHM - catchall email question

Discussion in 'Site & Server Administration' started by Sn@Ke, Jul 20, 2009.

  1. #1
    So I want to turn off catchall emails using :fail:

    I did this in WHM, but it doesn't effect the accounts created before I made the change, it only effects "new accounts"

    When I login to the account I want to change via Cpanel it says
    "The Default E-Mail/Catch-All feature has been disabled by default due to Spam and Security concerns.
    Please contact support if you need assistance with creating mail forwards (aliases) as an alternative. "


    How can I use WHM to edit the accounts manually to set the catchall to :fail:

    someone heeeelp?
     
    Sn@Ke, Jul 20, 2009 IP
  2. renoir

    renoir Well-Known Member

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    118
    #2
    it sounds like this feature is disabled by the cpanel server admin.
     
    renoir, Jul 20, 2009 IP
  3. Sn@Ke

    Sn@Ke Well-Known Member

    Messages:
    334
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    155
    #3
    I am the cpanel server admin?

    When I enable the feature, it only effects "new accounts" being accounts created after I enable it.

    I want to enable the feature for ALL accounts - being accounts that I created whilst the feature was originally switched off.
     
    Sn@Ke, Jul 20, 2009 IP
  4. Janak

    Janak Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if you need to change : blackhole to :fail for all the domains. You can use the following

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

    Thanks!
     
    Janak, Jul 23, 2009 IP
  5. ravee1981

    ravee1981 Active Member

    Messages:
    712
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #5
    afaik, the thing that you set in whm is the default setting that is used while creating a new cpanel account. for changing already made settings, you will have to do that manually. I don't think theres an option to multi-reset in all cpanels that you have on your server
     
    ravee1981, Jul 25, 2009 IP
  6. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi there Sn@ke! Your wish is my command.
    I'm assuming this is a linux/centos box. The following should all be done via ssh. Make a backup of all files in /etc/valiases before running and then create a file (touch filename) and add the following:
    #!/usr/bin/perl
    print "Converting all domain Default Accounts to :fail: ...";
    opendir (DIR, "/etc/valiases/") or die;
    while (my $file = readdir (DIR)) {
    	if ($file =~ /^\./) {next}
    	open (IN, "</etc/valiases/$file") or die;
    	my @data = <IN>;
    	close (IN);
    	open (OUT, ">/etc/valiases/$file") or die;
    	foreach my $line (@data) {
    		if ($line =~ /^\*\:/) {
    			print OUT "*: :fail:\n";
    		} else {
    			print OUT $line;
    		}
    	}
    	close (OUT);
    }
    print "Done!\n";
    Code (markup):
    Then run: perl filename

    :D
     
    SecureCP, Jul 25, 2009 IP