view release on metacpan or search on metacpan
ex/client.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use lib::abs '../lib';
use AnyEvent;
use AnyEvent::SMTP::Client 'sendmail';
my $cv = AnyEvent->condvar;
$cv->begin(sub{ $cv->send });
sendmail
# debug => 1, # connection debug
timeout => 10,
from => 'mons@cpan.org',
ex/server-fnc.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use lib::abs '../lib';
use AnyEvent;
use AnyEvent::SMTP::Server 'smtp_server';
use Data::Dumper;
my $cv = AnyEvent->condvar;
smtp_server undef, 2525, sub {
warn "MAIL=".Dumper shift;
die;
ex/server-obj.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use lib::abs '../lib';
use AnyEvent;
use AnyEvent::SMTP::Server;
use Data::Dumper;
my $cv = AnyEvent->condvar;
my $server = AnyEvent::SMTP::Server->new( port => 2525 );
$server->reg_cb(
ready => sub {
ex/server-restricted.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use lib::abs '../lib';
use AnyEvent;
use AnyEvent::SMTP::Server;
use AnyEvent::DNS;
use Data::Dumper;
# !
# ! Don't use this example as production code.
# ! This is only an example.
# ! Real production cases must be more smart
# !
t/00-load.t view on Meta::CPAN
#!/usr/bin/env perl -w
use strict;
use warnings;
use Test::More;
use lib::abs '../lib';
use AnyEvent::Impl::Perl;
BEGIN {
my @modules = qw(AnyEvent::SMTP AnyEvent::SMTP::Client AnyEvent::SMTP::Server);
plan tests => scalar( @modules );
use_ok $_ for @modules;
};
diag( "Testing AnyEvent::SMTP $AnyEvent::SMTP::VERSION, using AnyEvent $AnyEvent::VERSION, Perl $], $^X" );
t/30-server-func.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use Test::More;
BEGIN {
eval { require Test::SMTP;1 } or plan skip_all => 'Test::SMTP required';
}
use AnyEvent::SMTP::Server 'smtp_server';
our $port = 1024 + $$ % (65535-1024) ;
our $ready = 0;
$SIG{INT} = $SIG{TERM} = sub { exit 0 };
t/35-server-die.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use Test::More;
BEGIN {
eval { require Test::SMTP;1 } or plan skip_all => 'Test::SMTP required';
}
use AnyEvent::SMTP::Server 'smtp_server';
our $port = 1024 + $$ % (65535-1024) ;
our $ready = 0;
$SIG{INT} = $SIG{TERM} = sub { exit 0 };
t/40-client.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use Test::More;
use AnyEvent::SMTP qw(smtp_server sendmail);
our $port = 1024 + $$ % (65535-1024) ;
our $ready = 0;
$SIG{INT} = $SIG{TERM} = sub { exit 0 };
our $child;
unless($child = fork) {
t/50-slots-maxcon.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use Test::More;
use AnyEvent::SMTP qw(smtp_server sendmail);
our $port = 1024 + $$ % (65535-1024) ;
our $ready = 0;
$SIG{INT} = $SIG{TERM} = sub { exit 0 };
our $child;
unless($child = fork) {
t/51-slots-maxcon-host.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use Test::More;
use AnyEvent::SMTP qw(smtp_server sendmail);
our $port = 1024 + $$ % (65535-1024) ;
our $ready = 0;
$SIG{INT} = $SIG{TERM} = sub { exit 0 };
our $child;
unless($child = fork) {
t/52-slots-maxcon-unlim.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use Test::More;
use AnyEvent::SMTP qw(smtp_server sendmail);
our $port = 1024 + $$ % (65535-1024) ;
our $ready = 0;
$SIG{INT} = $SIG{TERM} = sub { exit 0 };
our $child;
unless($child = fork) {
t/53-slots-active.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use Test::More;
use AnyEvent::SMTP qw(smtp_server sendmail);
our $port = 1024 + $$ % (65535-1024) ;
our $ready = 0;
$SIG{INT} = $SIG{TERM} = sub { exit 0 };
our $child;
unless($child = fork) {
t/54-stop-listening.t view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::Socket;
use lib::abs '../lib';
use AnyEvent::Socket qw(tcp_connect);
use AnyEvent::SMTP::Server;
use Test::More;
my $MAX_SECONDS = 5;
my $cv = AE::cv;
my $server = AnyEvent::SMTP::Server->new(port => 2525, debug => 0);
t/pod-coverage.t view on Meta::CPAN
#!/usr/bin/env perl -w
use strict;
use Test::More;
use lib::abs "../lib";
BEGIN {
my $lib = lib::abs::path( ".." );
chdir $lib or plan skip_all => "Can't chdir to dist $lib";
}
$ENV{TEST_AUTHOR} or plan skip_all => '$ENV{TEST_AUTHOR} not set';
# Ensure a recent version of Test::Pod::Coverage
eval "use Test::Pod::Coverage 1.08; 1"
or plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage";
eval "use Pod::Coverage 0.18; 1"
#!/usr/bin/env perl -w
use strict;
use Test::More;
use lib::abs "../lib";
BEGIN {
my $lib = lib::abs::path( ".." );
chdir $lib or plan skip_all => "Can't chdir to dist $lib";
}
# Ensure a recent version of Test::Pod
eval "use Test::Pod 1.22; 1"
or plan skip_all => "Test::Pod 1.22 required for testing POD";
all_pod_files_ok();