# Spam sample email
$sample{spam} = 'Subject: Test spam mail (GTUBE)
From: Sender <{FROM}>
-To: Recipient <{TO}>
+To: {TO}
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
# Nospam/novirus sample email
$sample{normal} = 'Subject: Test mail nospam/novirus
From: Sender <{FROM}>
-To: Recipient <{TO}>
+To: {TO}
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
# Virus sample email
$sample{virus} = 'From: Sender <{FROM}>
-To: Recipient <{TO}>
+To: {TO}
Subject: Test virus
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="C7zPtVaVf+AK4Oqc"
my $appconfig = AppConfig->new(
'host=s',
'from=s',
- 'to=s',
+ 'to=s@',
'spam=s',
'virus=s',
'normal=s',
my $host = $opt{host};
my $from = $opt{from};
- my $to = $opt{to};
+ my @to = @{$opt{to}};
+ my $to_formatted = join(", ", @to);
$count{spam} = $opt{spam};
$count{virus} = $opt{virus};
$count{normal} = $opt{normal};
foreach my $type (keys%count) {
my $i = 0;
while ($i < $count{$type}) {
- print "Sending: $from -> $to, $type\n";
+ print "Sending $type: $from -> $to_formatted\n";
$smtp->mail($from) or error("From failed: $!\n");
- $smtp->to($to) or error("To failed: $!\n");
+ $smtp->to(@to) or error("To failed: $!\n");
$smtp->data() or error("Data failed: $!\n");
my $sent_size = 0;
my $body = $sample{$type};
- $body =~ s/{TO}/$to/g;
+ $body =~ s/{TO}/$to_formatted/g;
$body =~ s/{FROM}/$from/g;
# Disable special virus mangling (needed for letting people using an http AV download this toool ;))
$body =~ s/{DEACTIVATED}//g;