Mail-Box-POP3-4.01/ 0000755 0001750 0000144 00000000000 15117246024 014305 5 ustar 00markov users 0000000 0000000 Mail-Box-POP3-4.01/README.md 0000644 0001750 0000144 00000004360 15117237340 015570 0 ustar 00markov users 0000000 0000000 # distribution Mail-Box-POP3
* My extended documentation:
* Development via GitHub:
* Sponsor me:
* Download from CPAN:
* Indexed from CPAN:
Until release 3.0, this module was an integral part of the Mail-Box
distribution. This distribution implements a client connector to a
POP3 server.
## Installing
On github, you can find the processed version for each release. But the
better source is CPAN; to get it installed simply run:
```sh
cpan -i Mail::Box::POP3
```
**Be aware that version 4 is not fully compatible with releases pre-4**
See
## Development → Release
Important to know, is that I use an extension on POD to write the manuals.
The "raw" unprocessed version is visible on GitHub. It will run without
problems, but does not contain manual-pages.
Releases to CPAN are different: "raw" documentation gets removed from
the code and translated into real POD and clean HTML. This reformatting
is implemented with the OODoc distribution (A name I chose before OpenOffice
existed, sorry for the confusion)
Clone from github for the "raw" version. For instance, when you want
to contribute a new feature.
## Contributing
When you want to contribute to this module, you do not need to provide
a perfect patch... actually: it is nearly impossible to create a patch
which I will merge without modification. Usually, I need to adapt the
style of code and documentation to my own strict rules.
When you submit an extension, please contribute a set with
1. code
2. code documentation
3. regression tests in t/
**Please note:**
When you contribute in any way, you agree to transfer the copyrights to
Mark Overmeer (you will get the honors in the code and/or ChangeLog).
You also automatically agree that your contribution is released under
the same license as this project: licensed as perl itself.
## Copyright and License
This project is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See
Mail-Box-POP3-4.01/t/ 0000755 0001750 0000144 00000000000 15117246023 014547 5 ustar 00markov users 0000000 0000000 Mail-Box-POP3-4.01/t/01basic.t 0000644 0001750 0000144 00000004325 15117237340 016164 0 ustar 00markov users 0000000 0000000 #!/usr/bin/env perl
use warnings;
use strict;
use Mail::Box::POP3::Test;
use Mail::Box::Test;
use File::Spec ();
use File::Basename qw(dirname);
use Test::More;
$ENV{MARKOV_DEVEL} or plan skip_all => "tests are fragile, skipped";
use_ok('Mail::Transport::POP3');
# Check if all methods are there OK
can_ok('Mail::Transport::POP3', qw(
deleted
deleteFetched
DESTROY
disconnect
fetched
folderSize
header
ids
id2n
init
message
messages
messageSize
send
sendList
socket
url
));
my $here = dirname __FILE__;
my $original = File::Spec->catdir($here, 'original');
my $popbox = File::Spec->catdir($here, 'popbox');
copy_dir($original, $popbox);
my ($server, $port) = start_pop3_server($popbox);
my $receiver = start_pop3_client($port);
isa_ok($receiver, 'Mail::Transport::POP3');
my $socket = $receiver->socket;
ok($socket, "Could not get socket of POP3 server");
print $socket "EXIT\n";
my @message = <$popbox/????>;
my $total = 0;
$total += -s foreach @message;
my $messages = @message;
cmp_ok($receiver->messages, '==', $messages, "Wrong number of messages");
cmp_ok($receiver->folderSize, '==', $total, "Wrong number of bytes");
my @id = $receiver->ids;
cmp_ok(scalar(@id), '==', scalar(@message), "Number of messages doesn't match");
is(join('',@id), join('',@message), "ID's don't match filenames");
my $error = '';
foreach(@id)
{ my ($reported, $real) = ($receiver->messageSize($_),-s);
$error .= "size $_ is not right: expected $real, got $reported\n"
if $reported != $real;
}
ok(!$error, ($error || 'No errors with sizes'));
$error = '';
foreach(@id)
{ my $message = $receiver->message($_);
open(my $handle, '<', $_);
$error .= "content of $_ is not right\n"
if join('', @$message) ne join('', <$handle>);
}
ok(!$error, $error || 'No errors with contents');
$receiver->deleted(1,@id);
ok($receiver->disconnect, 'Failed to properly disconnect from server');
@message = <$popbox/????>;
cmp_ok(scalar(@message) ,'==', 0, 'Did not remove messages at QUIT');
ok(rmdir($popbox), "Failed to remove $popbox directory: $!");
is(join('', <$server>), <