#!/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);
$messageref = param ('ref');
$messageid = param ('id');

# 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("Removal of an email from the MailWall quarantine for $domainname");

if ( !( $messageref ) || !( $messageid ) )
{
	quit_with_errors ( "You seem to have left out some required information.");

} elsif ( ( length($messageref) !=8 ) || ( length($messageid) != 14 ) ) {

	quit_with_errors ( "The format of the information you supplied is not correct.");
} else {
	open (QUAR, ">>$release_email_file") || file_error($release_email_file);
	print QUAR "$virus_quarantine_tag,$domainname,$messageref,$messageid\n";
	close QUAR;

	print qq!
	Thank you for your request to release an email [ Message ID $messageid ] from the MailWall quarantine.<BR><BR>
	This email attachment will be released shortly.<BR><BR>
	If despite skipping our filename checks our systems still believe that this email contains a Virus, Worm or Trojan, this email 
	and its attachment will go back into the Quarantine. <br><br>

	!;
}


require $footer;
