#!/usr/bin/perl

print "Content-Type: Text/HTML\n\n";

use CGI ':standard';
use Vpanel 1.00;
require $header;
require $accountinfo;

$domainname = find_domain ($mainuser);

# Define the tab which appears to the front
$tab_section = $tabnum_mailwall;

# Output the content associated with this tab
print "<body class=section-$tab_section>";

# display tabs
require $tabdisplay;

print_header("Activation of Spam protection for $domainname");

$spam_status = spam_scanning_status($domainname);

if ( $spam_status eq "off" )
{
	print qq!
	Thank you for your request to turn on MailWall's Anti-Spam protection for $domainname. 
	!;
	show_time_to_change();

	$ret = php_request ("setSpamScanning", "domain:$domainname", "true");
	#return 1 if (defined ($ret) && ref ($ret) ne "SCALAR");
	#return 0;
	#open (ADDSPAM, ">>$create_spam_protection_file") || file_error($create_spam_protection_file);
	#print ADDSPAM $domainname, "\n";
	#close (ADDSPAM);
} else {
	print "Sorry, but you seem to have your Spam scanning turned on already<BR><BR>";
	print_support_contact_information();
}

require $footer;
