Решено!
Изменил скрипт до такого вида:
Код:
#!/usr/bin/perl -w
use strict;
use Net::SMTP;
my $host = &sall_ch(shift(@ARGV), '"');
my $ehlo = &sall_ch(shift(@ARGV), '"');
my $spamc = &sall_ch(shift(@ARGV), '"');
my $mail_from = &sall_ch(shift(@ARGV), '"');
my $rcpt_to = &sall_ch(shift(@ARGV), '"');
my $rcpt_to01 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to02 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to03 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to04 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to05 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to06 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to07 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to08 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to09 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to10 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to11 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to12 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to13 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to14 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to15 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to16 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to17 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to18 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to19 = &sall_ch(shift(@ARGV), '"');
my $rcpt_to00 = &sall_ch(shift(@ARGV), '"');
#if (!defined($host)||!defined($ehlo)||!defined($mail_from)||!defined($rcpt_to)) {
# die("use $0 <host> <ehlo> <mail_from> <rcpt_to> [cmd]\n");
#}
if (defined($spamc)) {
open(CF, "$spamc |") or undef($spamc);
}
my $smtp = Net::SMTP->new($host);
$smtp->hello($ehlo);
$smtp->mail($mail_from);
$smtp->to($rcpt_to);
$smtp->to($rcpt_to01);
$smtp->to($rcpt_to02);
$smtp->to($rcpt_to03);
$smtp->to($rcpt_to04);
$smtp->to($rcpt_to05);
$smtp->to($rcpt_to06);
$smtp->to($rcpt_to07);
$smtp->to($rcpt_to08);
$smtp->to($rcpt_to09);
$smtp->to($rcpt_to10);
$smtp->to($rcpt_to11);
$smtp->to($rcpt_to12);
$smtp->to($rcpt_to13);
$smtp->to($rcpt_to14);
$smtp->to($rcpt_to15);
$smtp->to($rcpt_to16);
$smtp->to($rcpt_to17);
$smtp->to($rcpt_to18);
$smtp->to($rcpt_to19);
$smtp->to($rcpt_to00);
$smtp->data();
if (defined($spamc)) {
while(<CF>) {
next if (/^delivered\-to\:/i);
$smtp->datasend($_);
}
}
else {
while(<>) {
next if (/^delivered\-to\:/i);
$smtp->datasend($_);
}
}
$smtp->dataend();
close(CF) if defined($spamc);
$smtp->quit;
exit 0;
############################################################
sub sall_ch($$) {
my($string, $chars) = (shift(), shift());
return(undef) unless defined($string);
$string =~ s/^[\Q$chars\E]+//;
$string =~ s/[\Q$chars\E]+$//;
return($string);
}
....смешное конечно решение, но пойдёт :-D