Mail-Box-IMAP4-3.010/0000755000175000001440000000000015111051631014445 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/t/0000755000175000001440000000000015111051631014710 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/t/20server-fetch.t0000644000175000001440000001410015062205153017635 0ustar00markovusers00000000000000#!/usr/bin/env perl # # Test body-structure capturing for IMAP servers use strict; use warnings; use Mail::Box::Test; use Mail::Message; use Mail::Message::Body::Lines; use Mail::Server::IMAP4::Fetch; use Test::More tests => 44; my $msif = 'Mail::Server::IMAP4::Fetch'; my $msg = Mail::Message->build ( From => 'I myself and me ' , To => 'you@example.com' , Date => 'now' , Subject => 'Life of Brian' , 'Message-ID' => 'unique' , data => [ "two\n", "lines\n" ] ); ok($msg, "First, simple message built"); my $f = $msif->new($msg); isa_ok($f, $msif); ok($f->part() == $f); ok(!defined $f->part('1')); #use Data::Dumper; #print Dumper $f; is($f->fetchBody(0)."\n", <<__BODY, '...body'); ("TEXT" "PLAIN" ("charset" "us-ascii") "" NIL "8BIT" 10 2) __BODY is($f->fetchBody(1)."\n", <<__BODYSTRUCT, '...bodystruct'); ("TEXT" "PLAIN" ("charset" "us-ascii") "" NIL "8BIT" 10 2 NIL ("inline") NIL) __BODYSTRUCT is($f->fetchEnvelope."\n", <<__ENVELOPE, '...envelope'); ("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "") __ENVELOPE # # Simple multipart # my $data = Mail::Message::Body::Lines->new ( mime_type => 'audio/mpeg3' , transfer_encoding => 'base64' , charset => 'utf8' , data => "ABBA\n" ); my $mp = Mail::Message->build ( From => 'me' , Date => 'now' , Subject => 'multi' , 'Message-ID' => 'unique' , data => [ "two\n", "lines\n" ] , attach => $data ); ok(defined $mp, "Simple multipart"); $f = $msif->new($mp); isa_ok($f, $msif); ok($f->part() == $f); is($f->fetchBody(0)."\n", <<__BODY, '...body'); (("TEXT" "PLAIN" ("charset" "us-ascii") NIL NIL "8BIT" 10 2)("AUDIO" "MPEG3" () NIL NIL "BASE64" 5 1) "MIXED") __BODY is($f->fetchBody(1)."\n", <<__BODYSTRUCT, '...bodystruct'); (("TEXT" "PLAIN" ("charset" "us-ascii") NIL NIL "8BIT" 10 2 NIL ("inline") NIL)("AUDIO" "MPEG3" () NIL NIL "BASE64" 5 1 NIL ("attachment") NIL) "MIXED") __BODYSTRUCT is($f->fetchEnvelope."\n", <<__ENVELOPE, '...envelope'); ("now" "multi" NIL NIL NIL NIL NIL NIL NIL "") __ENVELOPE ok($f->part('1'), "Has two parts"); ok($f->part('2')); ok(!$f->part('3')); ok(!$f->part('1.1')); my $g = $f->part('2'); isa_ok($g, $msif); is($g->fetchBody(0)."\n", <<__BODY, '...body'); ("AUDIO" "MPEG3" () NIL NIL "BASE64" 5 1) __BODY is($g->fetchBody(1)."\n", <<__BODYSTRUCT, '...bodystruct'); ("AUDIO" "MPEG3" () NIL NIL "BASE64" 5 1 NIL ("attachment") NIL) __BODYSTRUCT is($g->fetchEnvelope."\n", <<__ENVELOPE, '...envelope'); (NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL) __ENVELOPE # # All fields in an envelope # my $a = Mail::Message->build ( From => 'FROM ' , To => 'TO ' , Cc => 'CC ' , Bcc => 'BCC ' , Sender => 'SENDER ' , 'Reply-To' => 'RT ' , Date => 'today' , Subject => 'subject' , 'Content-Type' => 'video/vhs' , 'Content-Disposition' => 'attachment; filename="private-video.ras"; size=100' , 'Content-Language' => 'nl-NL, nl-BE' , 'Content-Description' => 'blue movie' , 'Message-ID' => 'unique-id-123' , data => "BINARY data for video" ); ok(defined $a, "Full envelope"); #$a->print(\*STDERR); ##### get should become study ## my $s = $a->study('Content-Disposition'); ## isa_ok($s, 'Mail::Message::Field::Structured'); my $s = $a->head->get('Content-Disposition'); isa_ok($s, 'Mail::Message::Field'); is($s->attribute('filename'), 'private-video.ras', '...one attr'); my %attrs = $s->attributes; cmp_ok(keys %attrs, '==', 2, '...nr attrs'); is($attrs{filename}, 'private-video.ras', '...filename'); is($attrs{size}, 100, '...size'); $f = $msif->new($a); isa_ok($f, $msif); is($f->fetchBody(0)."\n", <<__BODY, "...body"); ("VIDEO" "VHS" () "" "blue movie" "BASE64" 29 1) __BODY is($f->fetchBody(1)."\n", <<__BODYSTRUCT, "...bodystruct"); ("VIDEO" "VHS" () "" "blue movie" "BASE64" 29 1 NIL ("attachment" "filename" "private-video.ras" "size" "100") "nl-NL, nl-BE") __BODYSTRUCT is($f->fetchEnvelope."\n", <<__ENVELOPE, "...envelope"); ("today" "subject" ("FROM" NIL "from" "from.home") ("SENDER" NIL "sender" "sender.home") ("RT" NIL "replyto" "rt.home") ("TO" NIL "to" "to.home") ("CC" NIL "cc" "cc.home") ("BCC" NIL "bcc" "bcc.home") NIL "") __ENVELOPE # # Nested # my $b = Mail::Message->build ( To => 'someelse@somewhere.aq' , 'Message-Id' => 'newid' , Date => 'tomorrow' , attach => $msg ); ok(defined $b, "Constructed nested message"); isa_ok($b, 'Mail::Message'); ok($b->isNested, 'check structure'); $f = $msif->new($b); isa_ok($f, $msif); #$b->print(\*STDERR); is($f->fetchBody(0)."\n", <<__BODY, "...body"); ("MESSAGE" "RFC822" () "" NIL "8BIT" 215 ("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "") ("TEXT" "PLAIN" ("charset" "us-ascii") "" NIL "8BIT" 10 2) 11) __BODY is($f->fetchBody(1)."\n", <<__BODYSTRUCT, "...bodystruct"); ("MESSAGE" "RFC822" () "" NIL "8BIT" 215 ("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "") ("TEXT" "PLAIN" ("charset" "us-ascii") "" NIL "8BIT" 10 2 NIL ("inline") NIL) 11 NIL ("inline") NIL) __BODYSTRUCT is($f->fetchEnvelope."\n", <<__ENVELOPE, "...envelope"); ("tomorrow" NIL NIL NIL NIL (NIL NIL "someelse" "somewhere.aq") NIL NIL NIL "") __ENVELOPE #$b->print(\*STDERR); $g = $f->part('1'); ok(defined $g, "nested info"); isa_ok($g, $msif); ok($f != $g); is($g->fetchBody(0)."\n", <<__BODY, "...body"); ("TEXT" "PLAIN" ("charset" "us-ascii") "" NIL "8BIT" 10 2) __BODY is($g->fetchBody(1)."\n", <<__BODYSTRUCT, "...bodystruct"); ("TEXT" "PLAIN" ("charset" "us-ascii") "" NIL "8BIT" 10 2 NIL ("inline") NIL) __BODYSTRUCT is($g->fetchEnvelope."\n", <<__ENVELOPE, "...envelope"); ("now" "Life of Brian" ("I myself and me" NIL "me" "localhost") NIL NIL (NIL NIL "you" "example.com") NIL NIL NIL "") __ENVELOPE Mail-Box-IMAP4-3.010/t/21server-list.t0000644000175000001440000001327415062205153017533 0ustar00markovusers00000000000000#!/usr/bin/env perl # Test list command for IMAP servers # # A lot of the basic administration handling is tested in 52manager/30collect.t use strict; use warnings; use File::Temp (); use Mail::Box::MH; use Mail::Box::Identity; use Mail::Server::IMAP4::List; use Test::More tests => 41; my $msil = 'Mail::Server::IMAP4::List'; my $mbi = 'Mail::Box::Identity'; my @boxes = qw( a1 a1/b1 a1/b2 a1/b2/c1 a1/b2/c2 a1/b2/c3 a1/b2/c3/d1 a1/b2/c3/d2 a1/b3 a2 a3 ); # Create the directory hierarchy my $top = File::Temp->newdir; foreach my $box (@boxes) { my $dir = "$top/$box"; mkdir $dir or die "$dir: $!"; } # Create the top object my $folders = $mbi->new ( name => '=' , folder_type => 'Mail::Box::MH' , only_subs => 1 ); ok(defined $folders, "Created the top folder"); isa_ok($folders, $mbi); # Load the structure my $count = 0; sub setloc($) { my $node = shift; my $full = $node->fullname; $full =~ s/^\=/$top/; $node->location($full); $count++; } $folders->foreach(\&setloc); cmp_ok($count, '==', @boxes+1, "Succesfully expanded"); ok($folders->onlySubfolders, "top without msgs"); my $a1 = $folders->folder('a1'); ok(defined $a1, "found $a1"); ok(!$a1->onlySubfolders, "other with msgs"); # # Let's do the simple LIST check. # sub str(@) { return '' unless @_; my @lines; foreach my $record (@_) { my($flags, $delim, $rest) = @$record; $rest = '""' unless length $rest; push @lines, "$flags \"$delim\" $rest\n"; } join '', @lines; } my $imap = $msil->new(folders => $folders, delimiter => '#'); isa_ok($imap, $msil); is(str($imap->list('', '')), <<'__DELIM', 'as for delim'); (\Noselect) "#" "" __DELIM is(str($imap->list('#', 'a1')), <<'__DELIM'); () "#" #a1 __DELIM $folders->folder('a1')->deleted(1); is(str($imap->list('#', 'a1')), <<'__DELIM'); (\Noselect) "#" #a1 __DELIM $folders->folder('a1')->deleted(0); is(str($imap->list('#', 'a1')), <<'__DELIM'); () "#" #a1 __DELIM $folders->folder('a1')->onlySubfolders(1); is(str($imap->list('#', 'a1')), <<'__DELIM'); (\Noselect) "#" #a1 __DELIM $folders->folder('a1')->marked(1); is(str($imap->list('#', 'a1')), <<'__DELIM', 'marked'); (\Noselect \Marked) "#" #a1 __DELIM $folders->folder('a1')->marked(0); is(str($imap->list('#', 'a1')), <<'__DELIM', 'unmarked'); (\Noselect \Unmarked) "#" #a1 __DELIM $folders->folder('a1')->marked(undef); is(str($imap->list('#', 'a1')), <<'__DELIM', 'not marked'); (\Noselect) "#" #a1 __DELIM is(str($imap->list('a1', 'b1')), <<'__DELIM', 'straight forward'); () "#" #a1#b1 __DELIM is(str($imap->list('a1', 'none')), <<'__DELIM', 'missing'); __DELIM is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'stacking'); () "#" #a1#b2#c3 __DELIM # # Flags # my $abc = $folders->folder('a1', 'b2', 'c3'); ok(defined $abc, 'got abc'); $abc->marked(1); is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'abc marked'); (\Marked) "#" #a1#b2#c3 __DELIM $abc->marked(0); is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'abc unmarked'); (\Unmarked) "#" #a1#b2#c3 __DELIM $abc->marked(undef); is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'abc undef marked'); () "#" #a1#b2#c3 __DELIM $abc->inferiors(0); is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'abc no inferiors'); (\Noinferiors) "#" #a1#b2#c3 __DELIM $abc->inferiors(1); is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'abc inferiors'); () "#" #a1#b2#c3 __DELIM $abc->inferiors(0); $abc->marked(1); is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'abc inferiors'); (\Noinferiors \Marked) "#" #a1#b2#c3 __DELIM $abc->inferiors(1); $abc->marked(1); is(str($imap->list('a1#b2', 'c3')), <<'__DELIM', 'abc inferiors'); (\Marked) "#" #a1#b2#c3 __DELIM # # Now for some real searching # is(str($imap->list('a1#none', '%')), <<'__DELIM', 'find none %'); __DELIM is(str($imap->list('a1#none', '*')), <<'__DELIM', 'find none *'); __DELIM is(str($imap->list('a1#b1', '%')), <<'__DELIM', 'find here %'); () "#" #a1#b1 __DELIM is(str($imap->list('a1#b1', '*')), <<'__DELIM', 'find here *'); () "#" #a1#b1 __DELIM is(str($imap->list('a1#b2', '%')), <<'__DELIM', 'find none %'); () "#" #a1#b2#c1 () "#" #a1#b2#c2 (\Marked) "#" #a1#b2#c3 __DELIM is(str($imap->list('a1#b2', '*')), <<'__DELIM', 'find none *'); () "#" #a1#b2 () "#" #a1#b2#c1 () "#" #a1#b2#c2 (\Marked) "#" #a1#b2#c3 () "#" #a1#b2#c3#d1 () "#" #a1#b2#c3#d2 __DELIM is(str($imap->list('a1', '%#b3')), <<'__DELIM', 'find inside %'); __DELIM is(str($imap->list('a1', '*#b3')), <<'__DELIM', 'find inside *'); () "#" #a1#b3 __DELIM is(str($imap->list('a1', 'b2#*')), <<'__DELIM', 'find inside *'); () "#" #a1#b2 () "#" #a1#b2#c1 () "#" #a1#b2#c2 (\Marked) "#" #a1#b2#c3 () "#" #a1#b2#c3#d1 () "#" #a1#b2#c3#d2 __DELIM is(str($imap->list('a1', '*#c2')), <<'__DELIM', 'find inside *'); () "#" #a1#b2#c2 __DELIM is(str($imap->list('a1', '*#d2')), <<'__DELIM', 'find inside *'); () "#" #a1#b2#c3#d2 __DELIM # # Complicated delimiter, as defined by the RFC. Examples in 6.3.8 # sub combi_delim($) { my $path = shift; my ($delim, $root) = $path =~ m/^(#news\.)/ ? ('.', $1) : $path =~ m!^/! ? ('/', '/') : ('/', ''); wantarray ? ($delim, $root) : $delim; } $folders->onlySubfolders(0); ok(! $folders->onlySubfolders); $imap = $msil->new(folders => $folders, delimiter => \&combi_delim); is(str($imap->list('', '')), <<'__DELIM', 'combi delim'); (\Noselect) "/" "" __DELIM is(str($imap->list('#news.comp.mail.misc', '')), <<'__DELIM'); (\Noselect) "." #news. __DELIM is(str($imap->list('/usr/staff/jones', '')), <<'__DELIM'); (\Noselect) "/" / __DELIM Mail-Box-IMAP4-3.010/t/10client-read.t0000644000175000001440000001105315062205153017432 0ustar00markovusers00000000000000#!/usr/bin/env perl # # Test reading of IMAP4 folders. # The environment has some requirements: # On Debian: # adduser -d /tmp/imaptest imaptest # /etc/cram-md5.pwd: # imaptesttestje # touch /var/mail/imaptest # chown imaptest.users /var/mail/imaptest # chmod 0664 /var/mail/imaptest # user running the tests # .... and a running imapd # # On SuSE 8.2 # useradd -d /tmp/imaptest imaptest # /etc/cram-md5.pwd: # imaptesttestje # touch /var/spool/mail/imaptest # chown imaptest.users /var/mail/imaptest # chmod 0664 /var/mail/imaptest # user running the tests # .... and a running imapd, which requires the start of xinetd and # enabling the imap service via YaST2 use strict; use warnings; use Mail::Box::Test; use Mail::Box::IMAP4; use Test::More; use File::Compare; use File::Copy; use File::Spec::Functions; BEGIN { $ENV{MARKOV_DEVEL} or plan skip_all => 'Only tested on markov\'s platform'; plan tests => 40; } my $user = 'imaptest'; my $password = 'testje'; my $server = 'localhost'; my $port = 143; my @connect = ( username => $user, password => $password , server_name => $server, server_port => $port ); my $home = "/tmp/$user"; my $inbox = "/var/mail/$user"; # Prepare home directory -d $home or mkdir $home or die "Cannot create $home: $!\n"; # Prepare INBOX my $src = "../Mail-Box/$unixsrc"; copy $src, $inbox or die "Cannot create $inbox: $!\n"; ok(Mail::Box::IMAP4->foundIn(folder => 'imap://'), 'check foundIn'); # # The folder is read. # my $folder = Mail::Box::IMAP4->new ( @connect , folder => 'INBOX' , lock_type => 'NONE' , cache_labels => 'YES' ); ok(defined $folder, 'check success open folder'); exit 1 unless defined $folder; isa_ok($folder, 'Mail::Box::IMAP4'); cmp_ok($folder->messages , "==", 45, 'found all messages'); is($folder->organization, 'REMOTE', 'folder organization NET'); # # Take one message. # my $message = $folder->message(2); ok(defined $message, 'take one message'); isa_ok($message, 'Mail::Box::Message'); isa_ok($message, 'Mail::Box::IMAP4::Message'); ok($message->head->isDelayed); cmp_ok($message->recvstamp, '==', 950134500, 'try recvstamp'); cmp_ok($message->size, '==', 3931, 'try fetch size'); ok($message->head->isDelayed, 'still delayed'); # # Take a few messages. # my @some = $folder->messages(3,7); cmp_ok(@some, "==", 5, 'take range of messages'); isa_ok($some[0], 'Mail::Box::Message'); isa_ok($some[0], 'Mail::Box::IMAP4::Message'); # # None of the messages is parsed, yet # my $parsed = 0; $parsed ||= $_->isParsed foreach $folder->messages; cmp_ok($parsed, '==', 0, 'no messages parsed'); # # Load a message # my $m34 = $folder->message(34); ok($m34->isDelayed, 'msg 34 delayed'); ok($m34->head->isDelayed, 'head delayed'); ok($m34->body->isDelayed, 'body delayed'); isa_ok($m34->head, 'Mail::Message::Head::Delayed'); isa_ok($m34->body, 'Mail::Message::Body::Delayed'); my $s = $m34->body->string; $s =~ s/\r\n/\n/g; is($s, "subscribe magick-developer\n", 'simple body'); # # Try to delete a message # ok(!$folder->message(2)->deleted, 'msg 2 not yet deleted'); $folder->message(2)->delete; ok($folder->message(2)->deleted, 'msg 2 flagged for deletion'); cmp_ok($folder->messages , "==", 45, 'deletion not performed yet'); cmp_ok($folder->messages('ACTIVE') , "==", 44, 'less messages ACTIVE'); cmp_ok($folder->messages('DELETED') , "==", 1, 'more messages DELETED'); my $replied = 0; $_->label('replied') && $replied++ for $folder->messages; cmp_ok($replied, '==', 12, 'read replied flags'); $folder->message(0)->label(replied => 1); $replied = 0; $_->label('replied') && $replied++ for $folder->messages; cmp_ok($replied, '==', 13, 'set replied flag'); # # Take a message # my $m = $folder->message(8); ok(defined $m, 'take message 8'); ok($m->isDelayed); ok($m->head->isDelayed); ok($m->body->isDelayed); my $subject = $m->subject; is($subject, 'Resize with Transparency', 'realized 8'); isa_ok($m->head, 'Mail::Message::Head::Complete'); ok($m->body->isDelayed); my $body = $m->body; ok($body->isDelayed, 'got some body'); $s = $body->string; ok(defined $s, 'got a string'); $s =~ s/\r//g; is(substr($s, 0, 19), "\nHi,\n\nMaybe someone"); isa_ok($body, 'Mail::Message::Body'); $folder->close(write => 'NEVER'); exit 0; Mail-Box-IMAP4-3.010/t/12client-flags.t0000644000175000001440000000576615062205153017633 0ustar00markovusers00000000000000#!/usr/bin/env perl # # Test flags conversion of IMAP4 folders. use strict; use warnings; use Mail::Box::Test; use Mail::Transport::IMAP4; use Test::More tests => 65; my $mti = 'Mail::Transport::IMAP4'; ### ### Checking labels2flags ### sub expect_flags($$$) { my ($got, $expect, $text) = @_; my $errors = 0; my %got; $got{$_}++ for split " ", $got; if(grep {$_ > 1} values %got) { $errors++; ok(0, "found double, $text"); } else { ok(1, $text); } foreach my $e (split " ", $expect) { if(delete $got{$e}) { ok(1, "found $e") } else { $errors++; ok(0, "missing $e") } } if(keys %got) { ok(0, "got too much: ".join(" ", keys %got)); $errors++; } else { ok(1, "exact match"); } if($errors) { warn "$errors errors, expected '$expect' got '$got'\n"; } } my $flags = $mti->labelsToFlags(); expect_flags($flags, '', "Empty set"); $flags = $mti->labelsToFlags(seen => 1, flagged => 1, old => 1); expect_flags($flags, '\Seen \Flagged', "No old"); $flags = $mti->labelsToFlags( {seen => 1, flagged => 1, old => 1} ); expect_flags($flags, '\Seen \Flagged', "No old as hash"); $flags = $mti->labelsToFlags(seen => 1, flagged => 1, old => 0); expect_flags($flags, '\Seen \Flagged \Recent', "No old"); $flags = $mti->labelsToFlags( {seen => 1, flagged => 1, old => 0} ); expect_flags($flags, '\Seen \Flagged \Recent', "No old as hash"); $flags = $mti->labelsToFlags(seen => 1, replied => 1, flagged => 1, deleted => 1, draft => 1, old => 0, spam => 1); expect_flags($flags, '\Seen \Answered \Flagged \Deleted \Draft \Recent \Spam', "show all flags"); $flags = $mti->labelsToFlags(seen => 0, replied => 0, flagged => 0, deleted => 0, draft => 0, old => 1, spam => 0); expect_flags($flags, '', "show no flags"); ### ### Checking flagsToLabels ### sub expect_labels($$$) { my ($got, $expect, $text) = @_; my $gotkeys = join " ", %$got; my $expkeys = join " ", %$expect; # warn "expected '$expkeys' got '$gotkeys'\n"; # depends on predefined labels cmp_ok(scalar keys %$got, '==', 7, "$text; nr fields"); foreach my $k (keys %$got) { my $g = $got->{$k} || 0; my $e = $expect->{$k} || 0; cmp_ok($g, '==', $e, "got $k"); } foreach my $k (keys %$expect) { my $g = $got->{$k} || 0; my $e = $expect->{$k} || 0; cmp_ok($g, '==', $e, "expect $k"); } } my $labels = $mti->flagsToLabels('REPLACE'); expect_labels $labels, {old => 1}, "flagsToLabels: Empty set"; $labels = $mti->flagsToLabels(REPLACE => qw[\Seen \Flagged] ); expect_labels $labels , {old => 1, seen => 1, flagged => 1} , "flagsToLabels: Empty set"; $labels = $mti->flagsToLabels(REPLACE => qw[\Seen \Answered \Flagged \Deleted \Draft \Recent \Spam] ); expect_labels $labels , { seen => 1, replied => 1, flagged => 1, deleted => 1 , draft => 1, spam => 1 } , "show all labels"; exit 0; Mail-Box-IMAP4-3.010/t/11client-write.t0000644000175000001440000000531715062205153017660 0ustar00markovusers00000000000000#!/usr/bin/env perl # # Test reading of IMAP4 folders. # The environment has some requirements: # On Debian: # adduser -d /tmp/imaptest imaptest # /etc/cram-md5.pwd: # imaptesttestje # touch /var/mail/imaptest # chown $USER /var/mail/imaptest # user running the tests # .... and a running imapd # # On SuSE 8.2 # useradd -d /tmp/imaptest imaptest # /etc/cram-md5.pwd: # imaptesttestje # touch /var/spool/mail/imaptest # chown $USER /var/spool/mail/imaptest # user running the tests # .... and a running imapd, which requires the start of xinetd and # enabling the imap service via YaST2 use strict; use warnings; use Mail::Box::Test; use Mail::Box::IMAP4; use Test::More; use File::Compare; use File::Copy; use File::Spec::Functions; BEGIN { unless($ENV{MARKOV_DEVEL}) { plan skip_all => 'Only tested on markov\'s platform'; } plan tests => 18; } my $user = 'imaptest'; my $password = 'testje'; my $server = 'localhost'; my $port = 143; my @connect = ( username => $user, password => $password , server_name => $server, server_port => $port ); my $home = "/tmp/$user"; my $inbox = "/var/mail/$user"; # Prepare home directory -d $home or mkdir $home or die "Cannot create $home: $!\n"; # Prepare INBOX copy $unixsrc, $inbox or die "Cannot create $inbox: $!\n"; # # The folder is read. # my $folder = Mail::Box::IMAP4->new ( @connect , folder => 'INBOX' , lock_type => 'NONE' , access => 'rw' ); ok(defined $folder, 'check success open folder'); exit 1 unless defined $folder; ok($folder->writeable); cmp_ok($folder->messages , "==", 45, 'found all messages'); my $msg = Mail::Message->build(From => 'me', data => "Hi\n"); ok(defined $msg, 'build new message to append'); isa_ok($msg, 'Mail::Message'); my $m = $folder->addMessage($msg); isa_ok($m, 'Mail::Box::IMAP4::Message', 'coercion successful'); isa_ok($msg, 'Mail::Box::IMAP4::Message'); ok(!defined $m->unique, 'ids only for "native" messages'); cmp_ok($folder->messages , "==", 46, 'found the new message'); # # Play around with the message, and see nothing breaks # ok($m->label('reply' => 1)); ok($m->label('reply')); ok($m->label('reply' => 0)); ok(!$m->label('reply')); is($m->get('From'), 'me'); is($m->body->string, "Hi\n"); # Now try to save it, and reopen ok($folder->close, 'closing folder'); $folder = Mail::Box::IMAP4->new ( @connect , folder => 'INBOX' , lock_type => 'NONE' , access => 'r' ); ok(defined $folder, 'check success re-open folder'); cmp_ok($folder->messages , "==", 46, 'found one more messages'); Mail-Box-IMAP4-3.010/lib/0000755000175000001440000000000015111051631015213 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/lib/Mail/0000755000175000001440000000000015111051631016075 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/lib/Mail/Server/0000755000175000001440000000000015111051631017343 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4.pod0000644000175000001440000000414715111051627020674 0ustar00markovusers00000000000000=encoding utf8 =head1 NAME Mail::Server::IMAP4 - IMAP4 server implementation (not completed) =head1 INHERITANCE Mail::Server::IMAP4 is a Mail::Server is a Mail::Reporter =head1 SYNOPSIS !!!Partially implemented!!!! my $server = Mail::Server::IMAP4->new($msg); =head1 DESCRIPTION This module is a place-holder, which can be used to grow code which is needed to implement a full IMAP4 server. Although the server is not implemented, parts of this server are already available. =over 4 =item * L used to capture "FETCH" related information from a message, and produce server-side FETCH answers. =item * L produce LIST responses about existing folders. This works in combination with a L object. =item * L the SEARCH request. Not implemented yet... looking for a volunteer. =back Extends L<"DESCRIPTION" in Mail::Server|Mail::Server/"DESCRIPTION">. =head1 METHODS Extends L<"METHODS" in Mail::Server|Mail::Server/"METHODS">. =head1 DETAILS See =over 4 =item RFC2060: "Internet Message Access Protocol IMAP4v1" =back Extends L<"DETAILS" in Mail::Server|Mail::Server/"DETAILS">. =head1 DIAGNOSTICS =over 4 =item Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by C =back =head1 SEE ALSO This module is part of Mail-Box-IMAP4 version 3.010, built on November 24, 2025. Website: F =head1 LICENSE For contributors see file ChangeLog. This software is copyright (c) 2001-2025 by Mark Overmeer. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/0000755000175000001440000000000015111051631020155 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/List.pod0000644000175000001440000000770315111051627021610 0ustar00markovusers00000000000000=encoding utf8 =head1 NAME Mail::Server::IMAP4::List - folder related IMAP4 answers =head1 SYNOPSIS my $imap = Mail::Server::IMAP4::List->new( folders => $folders, # Mail::Box::Identity inbox => $inbox, # Mail::Box delimiter => '#' ); my $imap = Mail::Server::IMAP4::List->new(user => $user); print $imap->list(...); # for LIST command =head1 DESCRIPTION =head1 METHODS =head2 Constructors =over 4 =item $class-EB(%options) Create a (temporary) object to handle the LIST requests for a certain user, based upon a set of folders. The data is kept by L and L objects, which mean that the folders will not be opened to answer these questions. -Option --Default delimiter '/' folders inbox user undef =over 2 =item delimiter => STRING|CODE Either the constant delimiter, or a code reference which will get passed a folder name and should return the delimiter string used in that name. If that folder name is empty, the default delimiter must be reported. See L for an example. =item folders => OBJECT You need to specify either a set of folders explicitly or via the user. Some L OBJECT is needed. =item inbox => BOOLEAN For now, only used to see whether there is an inbox, so a truth value will do. This may change in the future. By default, the flag is set if C inbox is defined. =item user => OBJECT A L OBJECT, representing the user who's folders must get reported. =back =back =head2 Attributes =over 4 =item $obj-EB( [$foldername] ) Returns the delimiter string. The foldername is only required when a CODE reference was specified at initiation. » example: setting-up an IMAP4 delimiter sub delim($) { my $path = shift; my ($delim, $root) = $path =~ m/^(#news\.)/ ? ('.', $1) : $path =~ m!^/! ? ('/', '/') : ('/', ''); wantarray ? ($delim, $root) : $delim; } my $list = Mail::Server::IMAP4::List->new(delimiter => \&delim, ...); print $list->delimiter('abc/xyz'); # returns a / (slash) and '' print $list->delimiter('#news.feed'); # returns a . (dot) and $news. print $list->delimiter(''); # returns default delimiter =item $obj-EB() Returns the L of the toplevel folder. =item $obj-EB() Returns the L or filename of the INBOX. =item $obj-EB() Returns the L object, if defined. =back =head2 IMAP Commands =over 4 =item $obj-EB($base, $pattern) IMAP's LIST command. The request must be partially decoded, the answer will need to be encoded. » example: using IMAP list my $imap = Mail::Server::IMAP4::List->new(delimiter => \&delim, ...); local $" = ';'; my @lines = $imap->list('', ''); # returns the default delimiter print ">@{$lines[0]}<"; # >(\Noselect);/;< my @lines = $imap->list('#news',''); # specific delimiter print ">@{$lines[0]}<"; # >(\Noselect);.;< my @lines = $imap->list('top/x/', '%'); print ">@$_<," foreach @lines; # >();/;/tmp/x/y<,>(\Marked);/;/tmp/x/z< =back =head1 DETAILS See =over 4 =item RFC2060: "Internet Message Access Protocol IMAP4v1" sections 6.3.8 (LIST question) and 7.2.2 (LIST answer) =back =head1 SEE ALSO This module is part of Mail-Box-IMAP4 version 3.010, built on November 24, 2025. Website: F =head1 LICENSE For contributors see file ChangeLog. This software is copyright (c) 2001-2025 by Mark Overmeer. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/Fetch.pod0000644000175000001440000000601315111051627021717 0ustar00markovusers00000000000000=encoding utf8 =head1 NAME Mail::Server::IMAP4::Fetch - message info for IMAP protocol speed-up =head1 SYNOPSIS my $imap = Mail::Server::IMAP4::Fetch->new($msg); print $imap->fetchBody(1); # for FETCH BODYSTRUCTURE print $imap->fetchBody; # for FETCH BODY print $imap->fetchEnvelope; # for FETCH ENVELOPE print $imap->fetchSize; =head1 DESCRIPTION Create a new object hierarchy, which contains information to capture the most important details about the message. The object can be used to speed-up IMAP-server implementations, as L. The object used here is a simplified representation of a L object. It does not maintain headers and does not refer to the folder. It only works with messages stored in a file. Therefore, this object can be frozen by L if you want to. =head1 METHODS =head2 Constructors =over 4 =item $class-EB( <$message|$part>, %options ) Z<> -Option --Default md5checksums 0 =over 2 =item md5checksums => BOOLEAN =back =back =head2 Attributes =over 4 =item $obj-EB() Z<> =item $obj-EB() Z<> =item $obj-EB() Z<> =back =head2 IMAP Commands =over 4 =item $obj-EB($extended) Returns one string, representing the message's structure as defined by the IMAP protocol. The boolean argument indicates whether you like to have the C<$extended> information, as the imap command 'FETCH BODYSTRUCTURE' defines or the limited information of 'FETCH BODY'. =item $obj-EB() Returns a string representation of some header information. =item $obj-EB() Returns the size of the message body. =item $obj-EB( [$partnr] ) The partnummer is a list of dot-separated positive integers, numbering (nested) parts in multi-part message bodies. By default, the info of the main message is returned. » example: my $partinfo = $msg->info->part('1.2.1'); print $msg->info->part('3.3')->fetchBody; =item $obj-EB( [<$fh|undef>, [$number]] ) Print the structure of the fetch data to the specified C<$fh> or the selected filehandle. When explicitly C is specified as handle, then the output will be returned as string. Only a limited set of the information is displayed. » example: my $imap = ...; $imap->printStructure(\*OUTPUT); $imap->printStructure; my $struct = $imap->printStructure(undef); =back =head2 Internals =head1 DETAILS See =over 4 =item RFC2060: "Internet Message Access Protocol IMAP4v1" section 7.4.2 =item RFC2045: "MIME Part One: Format of Internet Message Bodies". =back =head1 SEE ALSO This module is part of Mail-Box-IMAP4 version 3.010, built on November 24, 2025. Website: F =head1 LICENSE For contributors see file ChangeLog. This software is copyright (c) 2001-2025 by Mark Overmeer. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/Search.pm0000644000175000001440000000121615111051626021724 0ustar00markovusers00000000000000# This code is part of Perl distribution Mail-Box-IMAP4 version 3.010. # The POD got stripped from this file by OODoc version 3.05. # For contributors see file ChangeLog. # This software is copyright (c) 2001-2025 by Mark Overmeer. # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later package Mail::Server::IMAP4::Search;{ our $VERSION = '3.010'; } use base 'Mail::Box::Search'; use strict; use warnings; #-------------------- sub init($) { my ($self, $args) = @_; $self->notImplemented; } 1; Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/User.pod0000644000175000001440000003371215111051627021612 0ustar00markovusers00000000000000=encoding utf8 =head1 NAME Mail::Server::IMAP4::User - manage the folders of one user =head1 INHERITANCE Mail::Server::IMAP4::User is a Mail::Box::Manage::User is a Mail::Box::Manager is a Mail::Reporter =head1 SYNOPSIS my $mgr = Mail::Server::IMAP4::User->new(...); =head1 DESCRIPTION This class adds IMAP protocol features to the normal L. Extends L<"DESCRIPTION" in Mail::Box::Manage::User|Mail::Box::Manage::User/"DESCRIPTION">. =head1 METHODS Extends L<"METHODS" in Mail::Box::Manage::User|Mail::Box::Manage::User/"METHODS">. =head2 Constructors Extends L<"Constructors" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Constructors">. =over 4 =item $class-EB(%options) Inherited, see L -Option --Defined in --Default autodetect Mail::Box::Manager undef collection_type Mail::Box::Manage::User Mail::Box::Collection default_folder_type Mail::Box::Manager 'mbox' delimiter Mail::Box::Manage::User "/" folder_id_type Mail::Box::Manage::User Mail::Box::Identity folder_types Mail::Box::Manager folderdir Mail::Box::Manager [ '.' ] folderdirs Mail::Box::Manager > identity Mail::Box::Manage::User inbox Mail::Box::Manage::User undef index_filename $folderdir/index log Mail::Reporter 'WARNINGS' topfolder_name Mail::Box::Manage::User '=' trace Mail::Reporter 'WARNINGS' =over 2 =item autodetect => $type|\@types =item collection_type => $class =item default_folder_type => $type|CLASS =item delimiter => STRING =item folder_id_type => CLASS|OBJECT =item folder_types => $typedef|\@typedefs =item folderdir => DIRECTORY =item folderdirs => [DIRECTORIES] =item identity => OBJECT =item inbox => $name =item index_filename => FILENAME =item log => LEVEL =item topfolder_name => $name =item trace => LEVEL =back =back =head2 Attributes Extends L<"Attributes" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Attributes">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$name] ) Inherited, see L =item $obj-EB() Returns the filename of the index file. =item $obj-EB() Inherited, see L =item $obj-EB($type, $class, %options) Inherited, see L =item $obj-EB( [@params] ) Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Manage open folders Extends L<"Manage open folders" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Manage open folders">. =over 4 =item $obj-EB($folder, %options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB($folder) Inherited, see L =item $obj-EB( [$foldername], %options ) Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Manage existing folders Extends L<"Manage existing folders" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Manage existing folders">. =over 4 =item $obj-EB($name) Inherited, see L =item $obj-EB($name) Inherited, see L =item $obj-EB($oldname, $newname, %options) Inherited, see L =back =head2 Move messages to folders Extends L<"Move messages to folders" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Move messages to folders">. =over 4 =item $obj-EB( [$folder|$foldername], $messages, %options ) Inherited, see L =item $obj-EB( [$folder|$foldername], @messages, %options ) Inherited, see L =item $obj-EB( [$folder|$foldername], @messages, %options ) Inherited, see L =back =head2 Manage message threads Extends L<"Manage message threads" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Manage message threads">. =over 4 =item $obj-EB( [@folders], %options ) Inherited, see L =back =head2 Internals Extends L<"Internals" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Internals">. =over 4 =item $obj-EB($url) Inherited, see L =item $obj-EB($folder, $messages) Inherited, see L =item $obj-EB($folder, $messages) Inherited, see L =back =head2 Error handling Extends L<"Error handling" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Error handling">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB($object) Inherited, see L =item $any-EB( [$level]|[$loglevel, $tracelevel]|[$level, $callback] ) Inherited, see L =item $obj-EB() Inherited, see L =item $any-EB( [$level, [$strings]] ) Inherited, see L =item $any-EB($level) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Cleanup Extends L<"Cleanup" in Mail::Box::Manage::User|Mail::Box::Manage::User/"Cleanup">. =over 4 =item $obj-EB() Inherited, see L =back =head2 Manage folders =over 4 =item $obj-EB($name, %options) Creates a new folder with the specified name. Folder info is returned, which will be very simple. In the accidental case that the folder already exists, a warning will be issued, and that folder's data returned. Improves base, see L -Option --Defined in --Default create_real Mail::Box::Manage::User true create_supers Mail::Box::Manage::User false deleted Mail::Box::Manage::User false id_options Mail::Box::Manage::User [] =over 2 =item create_real => BOOLEAN =item create_supers => BOOLEAN =item deleted => BOOLEAN =item id_options => ARRAY =back =item $obj-EB($name, %options) Remove all signs from the folder on the file-system. Messages still in the folder will be removed. This method returns a C value when the folder has been removed or not found, so "C" means failure. It is also possible to delete a folder using C<< $folder->delete >>, which will call this method here. The C<%options>, which are used for some other folder types, will be ignored here: the user's index contains the required details. Improves base, see L -Option --Defined in --Default recursive Mail::Box::Manager =over 2 =item recursive => BOOLEAN =back » example: how to delete a folder print "no xyz (anymore)\n" if $user->delete('xyz'); =item $obj-EB($name) Returns a hash with folder information. In normal circumstances, it is cheap to get these details, because they are cached in an index file. DO NOT modify the values you find in the hash, because that data may or may not be lost. DO NOT trust on the existence of any field in the info: fields may get renamed, removed, or added over time. Not all folder indexes will be generated by the same software release. » example: how to get global info about a folder my $info = $user->folderInfo($name); # get info =back =head1 DETAILS Extends L<"DETAILS" in Mail::Box::Manage::User|Mail::Box::Manage::User/"DETAILS">. =head1 DIAGNOSTICS =over 4 =item Error: Cannot create folder directory $dir: $! Cast by C =item Error: Cannot rename $name to $new: higher levels missing Unless you set L, all higher level folders must exist before this new one can be created. Cast by C =item Error: Cannot write name for folder in $file: $! Cast by C =item Error: Failed writing folder name to $file: $! Cast by C =item Warning: Folder $name already exists, creation skipped Cast by C =item Error: Folder $name is already open. You cannot ask the manager for a folder which is already open. In some older releases (before MailBox 2.049), this was permitted, but then behaviour changed, because many nasty side-effects are to be expected. For instance, an L on one folder handle would influence the second, probably unexpectedly. Cast by C =item Error: Folder $name is not a Mail::Box; cannot add a message. The folder where the message should be appended to is an object which is not a folder type which extends L. Probably, it is not a folder at all. Cast by C =item Warning: Folder does not exist, failed opening $type folder $name. The folder does not exist and creating is not permitted (see L) or did not succeed. When you do not have sufficient access rights to the folder (for instance wrong password for POP3), this warning will be produced as well. The manager tried to open a folder of the specified type. It may help to explicitly state the type of your folder with the C option. There will probably be another warning or error message which is related to this report and provides more details about its cause. You may also have a look at L and L. Cast by C =item Warning: Folder type $type is unknown, using autodetect. The specified folder type (see L, possibly derived from the folder name when specified as url) is not known to the manager. This may mean that you forgot to require the L extension which implements this folder type, but probably it is a typo. Usually, the manager is able to figure-out which type to use by itself. Cast by C =item Error: Illegal folder URL '$url'. The folder name was specified as URL, but not according to the syntax. See L for an description of the syntax. Cast by C =item Error: No foldername specified to open. L needs a folder name as first argument (before the list of options), or with the C option within the list. If no name was found, the MAIL environment variable is checked. When even that does not result in a usable folder, then this error is produced. The error may be caused by an accidental odd-length option list. Cast by C =item Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by C =item Error: Unable to remove folder $dir Cast by C =item Error: Use appendMessage() to add messages which are not in a folder. You do not need to copy this message into the folder, because you do not share the message between folders. Cast by C =item Warning: Use moveMessage() or copyMessage() to move between open folders. The message is already part of a folder, and now it should be appended to a different folder. You need to decide between copy or move, which both will clone the message (not the body, because they are immutable). Cast by C =item Warning: Will never create a folder $name without having write access. You have set L, but only want to read the folder. Create is only useful for folders which have write or append access modes (see L). Cast by C =back =head1 SEE ALSO This module is part of Mail-Box-IMAP4 version 3.010, built on November 24, 2025. Website: F =head1 LICENSE For contributors see file ChangeLog. This software is copyright (c) 2001-2025 by Mark Overmeer. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/Search.pod0000644000175000001440000001214315111051627022074 0ustar00markovusers00000000000000=encoding utf8 =head1 NAME Mail::Server::IMAP4::Search - select messages within a IMAP folder (not completed) =head1 INHERITANCE Mail::Server::IMAP4::Search is a Mail::Box::Search is a Mail::Reporter =head1 SYNOPSIS use Mail::Box::Manager; my $mgr = Mail::Box::Manager->new; my $folder = $mgr->open('imap4:Inbox'); my $filter = Mail::Server::IMAP4::Search->new(...); my @msgs = $filter->search($folder); if($filter->search($message)) {...} =head1 DESCRIPTION THIS PACKAGES IS NOT IMPLEMENTED YET... (it's waiting for a volunteer) Extends L<"DESCRIPTION" in Mail::Box::Search|Mail::Box::Search/"DESCRIPTION">. =head1 METHODS Extends L<"METHODS" in Mail::Box::Search|Mail::Box::Search/"METHODS">. =head2 Constructors Extends L<"Constructors" in Mail::Box::Search|Mail::Box::Search/"Constructors">. =over 4 =item $class-EB(%options) Inherited, see L -Option --Defined in --Default binaries Mail::Box::Search > decode Mail::Box::Search > delayed Mail::Box::Search true deleted Mail::Box::Search false deliver Mail::Box::Search undef in Mail::Box::Search 'BODY' label Mail::Box::Search undef limit Mail::Box::Search 0 log Mail::Reporter 'WARNINGS' logical Mail::Box::Search 'REPLACE' multiparts Mail::Box::Search true trace Mail::Reporter 'WARNINGS' =over 2 =item binaries => BOOLEAN =item decode => BOOLEAN =item delayed => BOOLEAN =item deleted => BOOLEAN =item deliver => undef|CODE|'DELETE' =item in => 'HEAD'|'BODY'|'MESSAGE' =item label => $label =item limit => $number =item log => LEVEL =item logical => 'REPLACE'|'AND'|'OR'|'NOT'|'AND NOT'|'OR NOT' =item multiparts => BOOLEAN =item trace => LEVEL =back =back =head2 Attributes Extends L<"Attributes" in Mail::Box::Search|Mail::Box::Search/"Attributes">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Error handling Extends L<"Error handling" in Mail::Box::Search|Mail::Box::Search/"Error handling">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB($object) Inherited, see L =item $any-EB( [$level]|[$loglevel, $tracelevel]|[$level, $callback] ) Inherited, see L =item $obj-EB() Inherited, see L =item $any-EB( [$level, [$strings]] ) Inherited, see L =item $any-EB($level) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Cleanup Extends L<"Cleanup" in Mail::Box::Search|Mail::Box::Search/"Cleanup">. =over 4 =item $obj-EB() Inherited, see L =back =head2 Searching Extends L<"Searching" in Mail::Box::Search|Mail::Box::Search/"Searching">. =over 4 =item $obj-EB($part, $body) Inherited, see L =item $obj-EB($part, $head) Inherited, see L =item $obj-EB($folder|$thread|$message|ARRAY) Inherited, see L =item $obj-EB($part) Inherited, see L =back =head2 The Results Extends L<"The Results" in Mail::Box::Search|Mail::Box::Search/"The Results">. =over 4 =item $obj-EB( [$fh], HASH ) Inherited, see L =back =head1 DIAGNOSTICS =over 4 =item Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by C =back =head1 SEE ALSO This module is part of Mail-Box-IMAP4 version 3.010, built on November 24, 2025. Website: F =head1 LICENSE For contributors see file ChangeLog. This software is copyright (c) 2001-2025 by Mark Overmeer. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/Fetch.pm0000644000175000001440000001546015111051626021556 0ustar00markovusers00000000000000# This code is part of Perl distribution Mail-Box-IMAP4 version 3.010. # The POD got stripped from this file by OODoc version 3.05. # For contributors see file ChangeLog. # This software is copyright (c) 2001-2025 by Mark Overmeer. # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later package Mail::Server::IMAP4::Fetch;{ our $VERSION = '3.010'; } use strict; use warnings; use Date::Parse; use Digest::MD5 qw/md5_base64/; #-------------------- sub new($) { my ($class, $part, %args) = @_; my $head = $part->head; my $body = $part->body; my $type = $body->type->study; my $self = bless +{ type => $type->body, typeattr => [ $type->attrPairs ], charset => $body->charset, bodylines => $body->nrLines, bodysize => $body->size }, $class; $self->{headbegin} = ($head->fileLocation)[0]; @{$self}{qw/bodybegin bodyend/} = $body->fileLocation; # The fields use the defined() check, to avoid accidental expensive # stringification by the field objects. my ($field, $value); $self->{date} = $field->unfoldedBody if defined($field = $head->get('Date')); $self->{subject} = $field->unfoldedBody if defined($field = $head->get('Subject')); $self->{description} = $field->unfoldedBody if defined($field = $head->get('Content-Description')); $self->{language} = $field->unfoldedBody if defined($field = $head->get('Content-Language')); $self->{filename} = $value if defined($value = $body->dispositionFilename); $self->{bodyMD5} = md5_base64($body->string) if $args{md5checksums}; if(defined($field = $body->transferEncoding)) { my $tf = $field->unfoldedBody; $self->{transferenc} = $tf unless $tf eq 'none'; } # Should become: # $self->{disposition} = [ $field->body, $field->study->attributes ] if(defined($field = $body->disposition)) { my $how = $field->body; $how = $body->isText ? 'inline' : 'attachment' if $how eq 'none'; $self->{disposition} = [ $how, $field->attributes ]; } else { $self->{disposition} = [ ($body->isText ? 'inline' : 'attachment') ]; } my $id = $head->get('Content-Message-ID') || $head->get("Message-ID"); if(defined $id) { my $msgid = $id->unfoldedBody =~ s/^\<*/*$/>/r; $self->{messageid} = $msgid if length $msgid; } foreach my $addr ( qw/to from sender reply-to cc bcc/ ) { my $addrs = $head->study($addr) or next; foreach my $group ($addrs->groups) { my @addrs = map +[ $_->phrase, $_->username, $_->domain ], $group->addresses; push @{$self->{$addr}}, [ $group->name, @addrs ]; } } if($body->isMultipart) { $self->{parts} = +[ map $class->new($_), $body->parts ]; } elsif($body->isNested) { $self->{nest} = $class->new($body->nested); } $self; } #-------------------- sub headLocation() { @{$_[0]}{ qw/headbegin bodybegin/ } } sub bodyLocation() { @{$_[0]}{ qw/bodybegin bodyend/ } } sub partLocation() { @{$_[0]}{ qw/headbegin bodyend/ } } #-------------------- sub fetchBody($) { my ($self, $extended) = @_; my $type = uc $self->{type}; my ($mediatype, $subtype) = split m[/], $type; if($self->{parts}) { # Multipart message # WARNING: no blanks between part descriptions my $parts = join '', map $_->fetchBody($extended), @{$self->{parts}}; my @fields = (\$parts, $subtype || 'MIXED'); if($extended) # only included when any valid info { my @attr; # don't know what to include here my @disp; # don't know about this either push @fields, \@attr, \@disp, $self->{language} if @attr || @disp || defined $self->{language}; } return $self->_imapList(@fields); } # # Simple message # my @fields = ( ($mediatype || 'TEXT'), ($subtype || 'PLAIN'), $self->{typeattr}, $self->{messageid}, $self->{description}, uc($self->{transferenc} || '8BIT'), \($self->{bodysize}), ); if(my $nest = $self->{nest}) { # type MESSAGE (message/rfc822 encapsulated) push @fields, \$nest->fetchEnvelope,, \$nest->fetchBody($extended); } push @fields, \$self->{bodylines}; push @fields, @{$self}{ qw/bodyMD5 disposition language/ } if $extended && ($self->{bodyMD5} || $self->{disposition} || $self->{language}); $self->_imapList(@fields); } sub fetchEnvelope() { my $self = shift; my @fields = ($self->{date}, $self->{subject}); foreach my $addr ( qw/from sender reply-to to cc bcc/ ) { unless($self->{$addr}) { push @fields, undef; # NIL next; } # For now, group information is ignored... RFC2060 is very # unclear about it... and seems incompatible with RFC2822 my $addresses = ''; foreach my $group (@{$self->{$addr}}) { my ($name, @addr) = @$group; # addr_adl is obsoleted by rfc2822 $addresses .= $self->_imapList($_->[0], undef, $_->[1], $_->[2]) for @addr; } push @fields, \$addresses; } push @fields, $self->{'in-reply-to'}, $self->{messageid}; $self->_imapList(@fields); } sub fetchSize() { $_[0]->{bodysize} } sub part(;$) { my $self = shift; my $nr = shift or return $self; my @nrs = split /\./, $nr; while(@nrs) { my $take = shift @nrs; if(exists $self->{nest} && $take==1) { $self = $self->{nest} } elsif(exists $self->{parts} && @{$self->{parts}} >= $take) { $self = $self->{parts}[$take-1] } else { return undef } } $self; } sub printStructure(;$$) { my $self = shift; my $fh = @_ ? shift : select; my $number = @_ ? shift : ''; my $buffer; # only filled if filehandle==undef defined $fh or open $fh, '>:raw', \$buffer; my $type = $self->{type}; my $subject = $self->{subject} || ''; my $text = "$number $type: $subject\n"; my $hbegin = $self->{headbegin} || 0; my $bbegin = $self->{bodybegin} || '?'; my $bodyend = $self->{bodyend} || '?'; my $size = $self->{bodysize} // '?'; my $lines = $self->{bodylines} // '?'; $text .= ' ' x (length($number) + 1); $text .= "@ $hbegin-$bbegin-$bodyend, $size bytes, $lines lines\n"; $fh->print($text); if(my $nest = $self->{nest}) { $nest->printStructure($fh, length($number) ? $number.'.1' :'1'); } elsif(my $parts = $self->{parts}) { my $count = 1; $number .= '.' if length $number; $_->printStructure($fh, $number.$count++) for @$parts; } $buffer; } #-------------------- # Concatenate the elements of a list, as the IMAP protocol does. # ARRAYS are included a sublist, and normal strings get quoted. # Pass a ref-scalar if something needs to be included without # quoting. sub _imapList(@) { my $self = shift; my @f; foreach (@_) { if(ref $_ eq 'ARRAY') { push @f, $self->_imapList(@$_) } elsif(ref $_ eq 'SCALAR') { push @f, ${$_} } elsif(!defined $_) { push @f, 'NIL' } else { my $copy = $_ =~ s/\\/\\\\/gr =~ s/\"/\\"/gr; push @f, qq#"$_"#; } } local $" = ' '; "(@f)"; } #-------------------- 1; Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/List.pm0000644000175000001440000000532415111051626021436 0ustar00markovusers00000000000000# This code is part of Perl distribution Mail-Box-IMAP4 version 3.010. # The POD got stripped from this file by OODoc version 3.05. # For contributors see file ChangeLog. # This software is copyright (c) 2001-2025 by Mark Overmeer. # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later package Mail::Server::IMAP4::List;{ our $VERSION = '3.010'; } use strict; use warnings; #-------------------- sub new($) { my ($class, %args) = @_; (bless {}, $class)->init(\%args); } sub init($) { my ($self, $args) = @_; my $user = $self->{MSIL_user} = $args->{user}; $self->{MSIL_folders} = $args->{folders}; $self->{MSIL_inbox} = $args->{inbox}; $self->{MSIL_delim} = exists $args->{delimiter} ? $args->{delimiter} : '/'; $self; } #-------------------- sub delimiter(;$) { my $delim = shift->{MSIL_delim}; ref $delim ? $delim->(shift) : $delim; } sub user() { $_[0]->{MSIL_user} } sub folders() { my $self = shift; $self->{MSIL_folders} || $self->user->topfolder; } sub inbox() { my $self = shift; $self->{MSIL_inbox} || $self->user->inbox; } #-------------------- sub list($$) { my ($self, $base, $pattern) = @_; return [ '(\Noselect)', $self->delimiter($base), '' ] if $pattern eq ''; my $delim = $self->delimiter($base); my @path = split $delim, $base; my $folder = $self->folders; while(@path && defined $folder) { $folder = $folder->folder(shift @path); } defined $folder or return (); my @pattern = split $delim, $pattern; return $self->_list($folder, $delim, @pattern); } sub _list($$@) { my ($self, $folder, $delim) = (shift, shift, shift); if(!@_) { my @flags; push @flags, '\Noselect' if $folder->onlySubfolders || $folder->deleted; push @flags, '\Noinferiors' unless $folder->inferiors; my $marked = $folder->marked; push @flags, ($marked ? '\Marked' : '\Unmarked') if defined $marked; local $" = ' '; # This is not always correct... should compose the name from the # parts... but in nearly all cases, the following is sufficient. my $name = $folder->fullname; for($name) { s/^=//; s![/\\]!$delim!g; } return [ "(@flags)", $delim, $name ]; } my $pat = shift; if($pat eq '%') { my $subs = $folder->subfolders or return $self->_list($folder, $delim); return map $self->_list($_, $delim, @_), $subs->sorted; } if($pat eq '*') { my @own = $self->_list($folder, $delim, @_); my $subs = $folder->subfolders or return @own; return @own, map $self->_list($_, $delim, '*', @_), $subs->sorted; } $folder = $folder->find(subfolders => $pat) or return (); $self->_list($folder, $delim, @_); } #-------------------- 1; Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4/User.pm0000644000175000001440000000567315111051626021450 0ustar00markovusers00000000000000# This code is part of Perl distribution Mail-Box-IMAP4 version 3.010. # The POD got stripped from this file by OODoc version 3.05. # For contributors see file ChangeLog. # This software is copyright (c) 2001-2025 by Mark Overmeer. # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later package Mail::Server::IMAP4::User;{ our $VERSION = '3.010'; } use base 'Mail::Box::Manage::User'; use strict; use warnings; #-------------------- sub init($) { my ($self, $args) = @_; $self->SUPER::init($args) or return (); $self->{MSNU_indexfile} = $args->{indexfile} // ($self->folderdir . '/index'); $self; } #-------------------- sub indexFilename() { $_[0]->{MSNU_indexfile} }; #-------------------- sub folderInfo($) { my $index = $_[0]->index or return (); $index->folder(shift); } sub delete($) { my ($self, $name) = @_; my $index = $self->index->startModify or return 0; unless($self->_delete($index, $name)) { $self->cancelModification($index); return 0; } $index->write; } sub _delete($$) { my ($self, $index, $name) = @_; # First clean all subfolders recursively foreach my $subf ($index->subfolders($name)) { $self->_delete($index, $subf) or return 0; } # Already disappeared? Shouldn't happen, but ok my $info = $index->folder($name) or return 1; # Bluntly clean-out the directory if(my $dir = $info->{Directory}) { # Bluntly try to remove, but error is not set if(remove(\1, $dir) != 0 && -d $dir) { $self->log(error => "Unable to remove folder $dir"); return 0; } } # Remove (sub)folder from index $index->folder($name, undef); 1; } sub create($@) { my ($self, $name) = (shift, shift); my $index = $self->index->startModify or return undef; if(my $info = $index->folder($name)) { $self->log(WARNING => "Folder $name already exists, creation skipped"); return $info; } my $uniq = $index->createUnique; # Create the directory # Also in this case, we bluntly try to create it, and when it doesn't # work, we check whether we did too much. This may safe an NFS stat. my $dir = $self->home . '/F' . $uniq; unless(mkdir $dir, 0750) { my $rc = "$!"; unless(-d $dir) # replaces $! { $self->log(ERROR => "Cannot create folder directory $dir: $rc"); return undef; } } # Write folder name in directory, for recovery purposes. my $namefile = "$dir/name"; my $namefh; unless(open $namefh, '>:encoding(utf-8)', $namefile) { $self->log(ERROR => "Cannot write name for folder in $namefile: $!"); return undef; } $namefh->print("$name\n"); unless($namefh->close) { $self->log(ERROR => "Failed writing folder name to $namefile: $!"); return undef; } # Add folder to the index my $facts = $self->folder( $name, Folder => $name, Directory => $dir, Messages => 0, Size => 0, ); $self->write && $facts; } #-------------------- 1; Mail-Box-IMAP4-3.010/lib/Mail/Server/IMAP4.pm0000644000175000001440000000132615111051626020521 0ustar00markovusers00000000000000# This code is part of Perl distribution Mail-Box-IMAP4 version 3.010. # The POD got stripped from this file by OODoc version 3.05. # For contributors see file ChangeLog. # This software is copyright (c) 2001-2025 by Mark Overmeer. # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later package Mail::Server::IMAP4;{ our $VERSION = '3.010'; } use parent 'Mail::Server'; use strict; use warnings; use Mail::Server::IMAP4::List; use Mail::Server::IMAP4::Fetch; use Mail::Server::IMAP4::Search; use Mail::Transport::IMAP4; #-------------------- #-------------------- 1; Mail-Box-IMAP4-3.010/lib/Mail/Box/0000755000175000001440000000000015111051631016625 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/lib/Mail/Box/IMAP4/0000755000175000001440000000000015111051631017437 5ustar00markovusers00000000000000Mail-Box-IMAP4-3.010/lib/Mail/Box/IMAP4/Head.pod0000644000175000001440000001540715111051627021020 0ustar00markovusers00000000000000=encoding utf8 =head1 NAME Mail::Box::IMAP4::Head - header fields related IMAP interface =head1 INHERITANCE Mail::Box::IMAP4::Head is a Mail::Message::Head is a Mail::Reporter =head1 SYNOPSIS =head1 DESCRIPTION This class implements a pure IMAP4 protocol interface, where as little data is retrieved from the header as possible. This may look nice to you, but is not sufficient for many tasks. For instance, you cannot removed or modify fields this way. Change L to C or C, to get a message header which is capable of performing all possible games with headers. On the other hand: the other settings are not 100% safe... Extends L<"DESCRIPTION" in Mail::Message::Head|Mail::Message::Head/"DESCRIPTION">. =head1 OVERLOADED Extends L<"OVERLOADED" in Mail::Message::Head|Mail::Message::Head/"OVERLOADED">. =over 4 =item overload: B<""> stringifaction Inherited, see L =item overload: B true/false Inherited, see L =back =head1 METHODS Extends L<"METHODS" in Mail::Message::Head|Mail::Message::Head/"METHODS">. =head2 Constructors Extends L<"Constructors" in Mail::Message::Head|Mail::Message::Head/"Constructors">. =over 4 =item $class-EB( [PAIR|$field]-LIST ) Inherited, see L =item $class-EB(%options) Inherited, see L -Option --Defined in --Default cache_fields false field_type Mail::Message::Head Mail::Message::Field::Fast log Mail::Reporter 'WARNINGS' message Mail::Message::Head undef modified Mail::Message::Head false trace Mail::Reporter 'WARNINGS' =over 2 =item cache_fields => BOOLEAN This is only a read-cache on fields, because this kind of header does not allow writing of fields. See L, this value is set to C for C and C for C.. =item field_type => CLASS =item log => LEVEL =item message => MESSAGE =item modified => BOOLEAN =item trace => LEVEL =back =back =head2 Attributes Extends L<"Attributes" in Mail::Message::Head|Mail::Message::Head/"Attributes">. =over 4 =item $obj-EB() Inherited, see L =back =head2 The header Extends L<"The header" in Mail::Message::Head|Mail::Message::Head/"The header">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$message] ) Inherited, see L =item $obj-EB( [BOOLEAN] ) Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Access to the header Extends L<"Access to the header" in Mail::Message::Head|Mail::Message::Head/"Access to the header">. =over 4 =item $obj-EB( $name, [$index] ) Get the information about the header line C<$name>. Realization will take place. Improves base, see L =item $obj-EB( $name, [$index] ) Inherited, see L =back =head2 About the body Extends L<"About the body" in Mail::Message::Head|Mail::Message::Head/"About the body">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Internals Extends L<"Internals" in Mail::Message::Head|Mail::Message::Head/"Internals">. =over 4 =item $obj-EB($field) Inherited, see L =item $obj-EB($fields) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB($distance) Inherited, see L =item $obj-EB($parser) Inherited, see L =item $obj-EB($field) Inherited, see L =back =head2 Error handling Extends L<"Error handling" in Mail::Message::Head|Mail::Message::Head/"Error handling">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB($object) Inherited, see L =item $any-EB( [$level]|[$loglevel, $tracelevel]|[$level, $callback] ) Inherited, see L =item $obj-EB() Inherited, see L =item $any-EB( [$level, [$strings]] ) Inherited, see L =item $any-EB($level) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB( [$level] ) Inherited, see L =item $obj-EB() Inherited, see L =back =head2 Cleanup Extends L<"Cleanup" in Mail::Message::Head|Mail::Message::Head/"Cleanup">. =over 4 =item $obj-EB() Inherited, see L =back =head1 DETAILS Extends L<"DETAILS" in Mail::Message::Head|Mail::Message::Head/"DETAILS">. =head1 DIAGNOSTICS =over 4 =item Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by C =back =head1 SEE ALSO This module is part of Mail-Box-IMAP4 version 3.010, built on November 24, 2025. Website: F =head1 LICENSE For contributors see file ChangeLog. This software is copyright (c) 2001-2025 by Mark Overmeer. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Mail-Box-IMAP4-3.010/lib/Mail/Box/IMAP4/Message.pod0000644000175000001440000005146315111051627021545 0ustar00markovusers00000000000000=encoding utf8 =head1 NAME Mail::Box::IMAP4::Message - one message on a IMAP4 server =head1 INHERITANCE Mail::Box::IMAP4::Message is a Mail::Box::Net::Message is a Mail::Box::Message is a Mail::Message is a Mail::Reporter =head1 SYNOPSIS my $folder = new Mail::Box::IMAP4 ... my $message = $folder->message(10); =head1 DESCRIPTION A C represents one message on a IMAP4 server, maintained by a L folder. Each message is stored as separate entity on the server, and maybe temporarily in your program as well. Extends L<"DESCRIPTION" in Mail::Box::Net::Message|Mail::Box::Net::Message/"DESCRIPTION">. =head1 METHODS Extends L<"METHODS" in Mail::Box::Net::Message|Mail::Box::Net::Message/"METHODS">. =head2 Constructors Extends L<"Constructors" in Mail::Box::Net::Message|Mail::Box::Net::Message/"Constructors">. =over 4 =item $obj-EB(%options) Inherited, see L =item $class-EB(%options) Inherited, see L -Option --Defined in --Default body Mail::Message undef body_type Mail::Box::Message Mail::Message::Body::Lines cache_body > cache_head > cache_labels > deleted Mail::Message false field_type Mail::Message undef folder Mail::Box::Message head Mail::Message undef head_type Mail::Message Mail::Message::Head::Complete labels Mail::Message +{} log Mail::Reporter 'WARNINGS' messageId Mail::Message undef modified Mail::Message false size Mail::Box::Message undef trace Mail::Reporter 'WARNINGS' trusted Mail::Message false unique Mail::Box::Net::Message write_labels > =over 2 =item body => $object =item body_type => CODE|$class =item cache_body => BOOLEAN =item cache_head => BOOLEAN =item cache_labels => BOOLEAN All standard IMAP labels can be cached on the local server to improve speed. This has the same dangers as setting C to C. The caching starts when the first label of the message was read. =item deleted => BOOLEAN =item field_type => $class =item folder => $folder =item head => $object =item head_type => $class =item labels => ARRAY|HASH =item log => LEVEL =item messageId => $id =item modified => BOOLEAN =item size => $bytes =item trace => LEVEL =item trusted => BOOLEAN =item unique => STRING =item write_labels => BOOLEAN When a label is changed or its value read, using L, that info should be sent to the IMAP server. But, this action could be superfluous, for instance because the label was already set or clear, and communication is expensive. On the other hand, someone else may use IMAP to make changes in the same folder, and will get the updates too late or never... =back =back =head2 Attributes Extends L<"Attributes" in Mail::Box::Net::Message|Mail::Box::Net::Message/"Attributes">. =over 4 =item $obj-EB( [$folder] ) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$integer] ) Inherited, see L =item $obj-EB( [STRING|undef] ) Inherited, see L =back =head2 Constructing a message Extends L<"Constructing a message" in Mail::Box::Net::Message|Mail::Box::Net::Message/"Constructing a message">. =over 4 =item $obj-EB( [<$rg_object|%options>] ) Inherited, see L =item $class-EB( [$message|$part|$body], @fields, %options ) Inherited, see L =item $class-EB($body, [$head], $headers) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB(STRING) Inherited, see L =item $class-EB($fh|STRING|SCALAR|ARRAY, %options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB( [STRING|$field|$address|ARRAY-$of-$things] ) Inherited, see L =item $any-EB(STRING) Inherited, see L =back =head2 The message Extends L<"The message" in Mail::Box::Net::Message|Mail::Box::Net::Message/"The message">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB($folder, %options) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB($folder, %options) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$fh] ) Inherited, see L =item $obj-EB( [$mailer], %options ) Inherited, see L =item $obj-EB() Returns the size of this message. If the message is still on the remote server, IMAP is used to ask for the size. When the message is already loaded onto the local system, the size of the parsed message is taken. These sizes can differ because the difference in line-ending representation. Improves base, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$fh] ) Inherited, see L =back =head2 The header Extends L<"The header" in Mail::Box::Net::Message|Mail::Box::Net::Message/"The header">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB($fieldname) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [$head] ) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB($fieldname) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =back =head2 The body Extends L<"The body" in Mail::Box::Net::Message|Mail::Box::Net::Message/"The body">. =over 4 =item $obj-EB( [$body] ) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB(%options) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB( [<'ALL'|'ACTIVE'|'DELETED'|'RECURSE'|$filter>] ) Inherited, see L =back =head2 Flags Extends L<"Flags" in Mail::Box::Net::Message|Mail::Box::Net::Message/"Flags">. =over 4 =item $obj-EB() Inherited, see L =item $obj-EB( [BOOLEAN] ) Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB() Inherited, see L =item $obj-EB