Fix bad angle bracket handling in messageIds in Main/Send.pm

Extend Mail/Send.t to test messageId generation.
This commit is contained in:
Colin Kuskie 2009-04-26 03:05:22 +00:00
parent 4f5a010faa
commit 70845fd9e8
4 changed files with 134 additions and 24 deletions

View file

@ -1,6 +1,7 @@
my $HOST = shift;
my $PORT = shift;
my $EMAILS = shift || 1;
die "HOST must be first argument"
unless $HOST;
@ -13,17 +14,26 @@ use Net::SMTP::Server::Client;
my $server = Net::SMTP::Server->new( $HOST, $PORT );
while ( my $conn = $server->accept ) {
my $counter = 0;
$| = 1;
CONNECTION: while ( my $conn = $server->accept ) {
my $client = Net::SMTP::Server::Client->new( $conn );
$client->process;
print to_json({
to => $client->{TO},
from => $client->{FROM},
contents => $client->{MSG},
counter => $counter,
emails => $EMAILS,
});
exit(0);
print "\n";
last CONNECTION if ++$counter >= $EMAILS;
}
sleep 3;
exit(0);
=head1 NAME