211 |
|
|
212 |
$date=localtime(); |
$date=localtime(); |
213 |
|
|
214 |
my ($fromaddr) = $from; |
my $fromaddr = $from; chomp $fromaddr; chomp $from; |
215 |
my ($replyaddr) = $reply; |
my $replyaddr = $reply; chomp $replyaddr; |
216 |
|
|
217 |
$to =~ s/[ \t]+/, /g; # pack spaces and add comma |
$to =~ s/[ \t]+/, /g; # pack spaces and add comma |
218 |
$cc =~ s/[ \t]+/, /g; # pack spaces and add comma |
$cc =~ s/[ \t]+/, /g; # pack spaces and add comma |
250 |
print S "mail from: <$fromaddr>\r\n"; |
print S "mail from: <$fromaddr>\r\n"; |
251 |
$_ = <S>; if (/^[45]/) { close S; return -5; } |
$_ = <S>; if (/^[45]/) { close S; return -5; } |
252 |
|
|
253 |
foreach (split(/, /, $to)) { |
foreach (split(/, */, $to)) { |
254 |
print S "rcpt to: <$_>\r\n"; |
chomp; |
255 |
$_ = <S>; if (/^[45]/) { close S; return -6; } |
print S "rcpt to: <$_>\r\n"; |
256 |
|
$_ = <S>; if (/^[45]/) { close S; return -6; } |
257 |
} |
} |
258 |
foreach (split(/, /, $cc)) { |
foreach (split(/, */, $cc)) { |
259 |
print S "rcpt to: <$_>\r\n"; |
chomp; |
260 |
$_ = <S>; if (/^[45]/) { close S; return -6; } |
print S "rcpt to: <$_>\r\n"; |
261 |
|
$_ = <S>; if (/^[45]/) { close S; return -6; } |
262 |
} |
} |
263 |
print S "data\r\n"; |
print S "data\r\n"; |
264 |
$_ = <S>; if (/^[45]/) { close S; return -5; } |
$_ = <S>; if (/^[45]/) { close S; return -5; } |
281 |
|
|
282 |
close S; |
close S; |
283 |
return 1; |
return 1; |
|
} |
|
284 |
|
} |