#!/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("Accessing the MailWall content quarantine for $domainname");

if ( !( $messageref ) || !( $messageid ) )
{
	print "Sorry, but you seem to have left out some required information.";
	show_option_to_go_back();
} elsif ( ( length($messageref) !=8 ) || ( length($messageid) != 14 ) ) {
	print qq!
		Sorry, but some of the information you have supplied is incorrect. Please check the email
		notification you received and try again.
	!;
	show_option_to_go_back();
} else {
	open (CONQUAR, ">>$release_email_file") || file_error($release_email_file);
	print CONQUAR "$content_quarantine_tag,$domainname,$messageref,$messageid\n";
	close CONQUAR;

	print qq!
		Thank you for your request to release an email [ Message ID $messageid ] from the MailWall content quarantine.<BR><BR>
		This email will be released shortly.<BR><BR>
	!;
}


require $footer;


