Mail::...:IMAP4s(3pm)
π¦ Mail::Box::IMAP4s π¦
okay bestie, welcome to the Mail::...:IMAP4s(3pm) page from the User Contributed Perl Documentation π
(yes the title is literally abbreviated like that, no cap).
β¨ NAME β¨
Mail::Box::IMAP4s β handle IMAP4 folders as client, with ssl connection π
πΈ INHERITANCE πΈ
the family tree, and she's got generations:
Mail::Box::IMAP4s
is a Mail::Box::IMAP4
is a Mail::Box::Net
is a Mail::Box
is a Mail::Reporter
π«Ά SYNOPSIS π«Ά
the entire vibe, verbatim:
my $url = 'imap4s://user:passwd@host:port/INBOX';
my $url = 'imaps://user:passwd@host:port/INBOX';
use Mail::Box::IMAP4s;
my $folder = Mail::Box::IMAP4s->new(folder => $url, ...);
my $mgr = Mail::Box::Manager->new;
my $folder = $msg->open($url, retry => 3, interval => 5);
π DESCRIPTION π
See Mail::Box::IMAP4.
Extends "DESCRIPTION" in Mail::Box::IMAP4.
π OVERLOADED π
Extends "OVERLOADED" in Mail::Box::IMAP4.
- overload:
""stringification β inherited, see "OVERLOADED" inMail::Box - overload:
@{}use as ARRAY β inherited, see "OVERLOADED" inMail::Box - overload:
cmpstring comparison β inherited, see "OVERLOADED" inMail::Box
π οΈ METHODS π οΈ
Extends "METHODS" in Mail::Box::IMAP4.
π± Constructors π±
Extends "Constructors" in Mail::Box::IMAP4.
$class->new(%options)β inherited, see "METHODS" inMail::Box::IMAP4
and the moment you've all been waiting for, the full option roster π (three columns: option, where it's defined, and its default β nope, we're not skipping a single one):
accessβ defined inMail::Box, default'r'body_delayed_typeβ defined inMail::Box, defaultMail::Message::Body::Delayedbody_typeβ defined inMail::Box, defaultMail::Message::Body::Linescache_bodyβ defined inMail::Box::IMAP4, defaultNOcache_headβ defined inMail::Box::IMAP4, defaultNO or DELAYcache_labelsβ defined inMail::Box::IMAP4, defaultNO or DELAYcoerce_optionsβ defined inMail::Box, default+[]createβ defined inMail::Box, defaultfalseextractβ defined inMail::Box, default10240field_typeβ defined inMail::Box, defaultundeffix_headersβ defined inMail::Box, defaultfalsefolderβ defined inMail::Box, default/folderdirβ defined inMail::Box, default<network location>head_delayed_typeβ defined inMail::Box, defaultMail::Message::Head::Delayedhead_typeβ defined inMail::Box, defaultMail::Box::IMAP4::Head or Mail::Message::Head::Completejoin_connectionβ defined inMail::Box::IMAP4, defaulttruekeep_dupsβ defined inMail::Box, defaultfalselock_fileβ defined inMail::Box, defaultundeflock_timeoutβ defined inMail::Box, default1 hourlock_typeβ defined inMail::Box, default'NONE'lock_waitβ defined inMail::Box, default10 secondslockerβ defined inMail::Box, defaultundefmanagerβ defined inMail::Box, defaultundefmessage_typeβ defined inMail::Box, defaultMail::Box::IMAP4::Messagemultipart_typeβ defined inMail::Box, defaultMail::Message::Body::Multipartpasswordβ defined inMail::Box::Net, defaultundefremove_when_emptyβ defined inMail::Box, default<false>save_on_exitβ defined inMail::Box, defaulttrueserver_nameβ defined inMail::Box::Net, defaultundefserver_portβ defined inMail::Box::Net, default993sslβ default{ SSL_verify_mode => SSL_VERIFY_NONE }starttlsβ defaultfalsetransporterβ defined inMail::Box::IMAP4, defaultMail::Transport::IMAP4trustedβ defined inMail::Box, default<false>usernameβ defined inMail::Box::Net, defaultundef
now the same squad again, with their lil signatures π:
access => $modebody_delayed_type => CLASSbody_type => CLASS|CODEcache_body => 'NO'|'YES'|'DELAY'cache_head => 'NO'|'PARTIAL'|'DELAY'cache_labels => 'NO'|'WRITE'|'DELAY'coerce_options => ARRAYcreate => BOOLEANextract => INTEGER|CODE|METHOD|'LAZY'|'ALWAYS'field_type => CLASSfix_headers => BOOLEANfolder => $namefolderdir => $directoryhead_delayed_type => CLASShead_type => CLASSjoin_connection => BOOLEANkeep_dups => BOOLEANlock_file => $filelock_timeout => $secondslock_type => CLASS|STRING|ARRAYlock_wait => $secondslocker => OBJECTmanager => $managermessage_type => CLASSmultipart_type => CLASSpassword => $passwordremove_when_empty => BOOLEANsave_on_exit => BOOLEANserver_name => $hostserver_port => $numberssl => \%config|\@pairsβ parameters to initialize the SSL connection. πstarttls => BOOLEANtransporter => $object|$classtrusted => BOOLEANusername => $username
πͺ Attributes πͺ
Extends "Attributes" in Mail::Box::IMAP4.
$obj->fixHeaders()β inherited, see "Attributes" inMail::Box$obj->folderdir( [$directory] )β inherited, see "Attributes" inMail::Box$obj->isTrusted()β inherited, see "Attributes" inMail::Box$obj->name()β inherited, see "Attributes" inMail::Box$obj->removeEmpty()β inherited, see "Attributes" inMail::Box$obj->type()β inherited, see "Attributes" inMail::Box
π The folder π
Extends "The folder" in Mail::Box::IMAP4.
$obj->addMessage($message, %options)β inherited, see "The folder" inMail::Box$obj->addMessages(@messages)β inherited, see "The folder" inMail::Box$class->appendMessages(%options)β inherited, see "The folder" inMail::Box$obj->close(%options)β inherited, see "METHODS" inMail::Box::IMAP4$obj->copyTo($folder, %options)β inherited, see "The folder" inMail::Box$obj->delete(%options)β inherited, see "The folder" inMail::Box$obj->organization()β inherited, see "The folder" inMail::Box$obj->size()β inherited, see "The folder" inMail::Box$obj->update(%options)β inherited, see "The folder" inMail::Box$obj->url()β inherited, see "The folder" inMail::Box
π© Folder flags π©
Extends "Folder flags" in Mail::Box::IMAP4.
$obj->access()β inherited, see "Folder flags" inMail::Box$obj->isModified()β inherited, see "Folder flags" inMail::Box$obj->modified( [BOOLEAN] )β inherited, see "Folder flags" inMail::Box$obj->writable()β inherited, see "Folder flags" inMail::Box
π The messages π
Extends "The messages" in Mail::Box::IMAP4.
$obj->current( [$number|$message|$message_id] )β inherited, see "The messages" inMail::Box$obj->find($message_id)β inherited, see "The messages" inMail::Box$obj->findFirstLabeled( $label, [BOOLEAN, [\@msgs]] )β inherited, see "The messages" inMail::Box$obj->message( $index, [$message] )β inherited, see "The messages" inMail::Box$obj->messageId( $message_id, [$message] )β inherited, see "The messages" inMail::Box$obj->messageIds()β inherited, see "The messages" inMail::Box$obj->messages( <'ALL'|$range|'ACTIVE'|'DELETED'|$label| !$label|$filter> )β inherited, see "The messages" inMail::Box$obj->nrMessages(%options)β inherited, see "The messages" inMail::Box$obj->scanForMessages($message, $message_ids, $timespan, $window)β inherited, see "The messages" inMail::Box
ποΈ Sub-folders ποΈ
Extends "Sub-folders" in Mail::Box::IMAP4.
$any->listSubFolders(%options)β inherited, see "Sub-folders" inMail::Box$any->nameOfSubFolder( $subname, [$parentname] )β inherited, see "Sub-folders" inMail::Box$obj->openRelatedFolder(%options)β inherited, see "Sub-folders" inMail::Box$obj->openSubFolder($subname, %options)β inherited, see "Sub-folders" inMail::Box$any->topFolderWithMessages()β inherited, see "Sub-folders" inMail::Box
π§ Internals π§
Extends "Internals" in Mail::Box::IMAP4.
$obj->body( [$body] )β inherited, see "Internals" inMail::Box::IMAP4$obj->coerce($message, %options)β inherited, see "Internals" inMail::Box$any->create($folder, %options)β inherited, see "METHODS" inMail::Box::Net$obj->createTransporter($class, %options)β inherited, see "Internals" inMail::Box::IMAP4$obj->determineBodyType($message, $head)β inherited, see "Internals" inMail::Box$obj->fetch( <$messages|$selection>, $info )β inherited, see "Internals" inMail::Box::IMAP4$class->foundIn( [$foldername], %options )β inherited, see "Internals" inMail::Box$obj->getHead($message)β inherited, see "Internals" inMail::Box::IMAP4$obj->getHeadAndBody($message)β inherited, see "Internals" inMail::Box::IMAP4$obj->lineSeparator( [<STRING|'CR'|'LF'|'CRLF'>] )β inherited, see "Internals" inMail::Box$obj->locker()β inherited, see "Internals" inMail::Box$obj->read(%options)β inherited, see "Internals" inMail::Box$obj->readMessages(%options)β inherited, see "Internals" inMail::Box$obj->storeMessage($message)β inherited, see "Internals" inMail::Box$obj->toBeThreaded($messages)β inherited, see "Internals" inMail::Box$obj->toBeUnthreaded($messages)β inherited, see "Internals" inMail::Box$obj->transporter( [$object] )β inherited, see "Internals" inMail::Box::IMAP4$obj->updateMessages(%options)β inherited, see "Internals" inMail::Box$obj->write(%options)β inherited, see "Internals" inMail::Box::IMAP4$obj->writeMessages(%options)β inherited, see "Internals" inMail::Box::IMAP4
π Other methods π
Extends "Other methods" in Mail::Box::IMAP4.
$any->timespan2seconds($time)β inherited, see "Other methods" inMail::Box
π©Ή Error handling π©Ή
Extends "Error handling" in Mail::Box::IMAP4.
$obj->AUTOLOAD()β inherited, see "Error handling" inMail::Reporter$obj->notImplemented()β inherited, see "Error handling" inMail::Reporter
π§Ό Cleanup π§Ό
Extends "Cleanup" in Mail::Box::IMAP4.
$obj->DESTROY()β inherited, see "Cleanup" inMail::Box
π DETAILS π
Extends "DETAILS" in Mail::Box::IMAP4.
β¨ DIAGNOSTICS β¨
okay bestie, sometimes this module is gonna yell at you, and here's the whole mood-ring of things it can say so you're never confused, k? π
Warning: cannot find head back for $id in $folder.β we did read that header earlier, but now it's giving empty vibes: the IMAP4 server just isn't handing over those header lines anymore. Cast bygetHeadAndBody()πWarning: cannot read body for $id in $folder.β we got the header from the IMAP4 server, but the body? nowhere. no cap, no reason given, just mystery. Cast bygetHeadAndBody()πError: class $package does not implement method $method.β fatal, fr fr. That specific$package(or literally any of its superclasses) doesn't implement this method even though it should. Which means some other related classes do have it and this one just... doesn't. Investigate, bestie, and probably tell the author of the package about it. Cast bynotImplemented()πError: copying failed for one message.β something blocked the copy of one message. Could be disk full, the message got removed by some external process, or it's read-protected, whatever. Long story short, that one message is not going anywhere, but copying keeps going for all the rest. Cast bycopyTo()β¨Error: couldn't select IMAP4 folder $name.β Cast bytransporter()πΈError: destination folder $name is not writable.β the folder you're copying messages into wasn't opened with write access (peepnew(access)). And lowkey this has nothing to do with filesystem write permission, that's your operating system's whole separate thing. Cast bycopyTo()πWarning: different messages with id $msgid.β same message id showed up more than once in one folder, but the content looks different?? Which should not be possible β every message is supposed to be unique. Iconic, but in the bad way. Cast bymessageId()π¦Warning: folder $name not deleted: not writable.β to remove a folder it has to be opened with write access vianew(access), otherwise the removal is refused. So yeah, you might have write access per the operating system and still get blocked here β this method just doesn't care, and the reverse is true as well. Cast bydelete()πNotice: impossible to keep deleted messages in IMAP folder $name.β some folder types have a 'deleted' flag they can stash in the folder to deal with later, and they remember that even after the folder gets rewritten. IMAP4? cannot play that trick, sorry. Cast bywrite()βError: invalid timespan '$span'.β that string just doesn't follow the strict rules of the time span syntax you're allowed to pass as a parameter. Cast bytimespan2seconds()π₯Warning: message $id disappeared from $folder.β we went to grab that specific message from the server and it's just... gone. poof. Cast bygetHeadAndBody()πWarning: message {id} disappeared from {folder}.β same situation, same gone-ness, just trying to get the specific message and it appears to be gone. Cast bygetHead()π§Warning: message-id '$msgid' does not contain a domain.β per the RFCs, message-ids need a unique random part, then an"@", then a domain name, and that's specifically so two messages never end up with the same id. The warning shows up when the"@"is missing from the string. Cast bymessageId()πError: no IMAP4 transporter configured.β Cast bytransporter()πΈError: you cannot add a message which is already part of a folder to a new one. Please use moveTo or copyTo.β exactly what it says, bestie. Cast byaddMessage()π
π SEE ALSO π
This module is part of Mail-Box-IMAP4 version 4.01, built on December 13, 2025. Website: http://perl.overmeer.net/CPAN/ π«Ά
π 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.
and that's the whole page, bestie!! you made it to the end π the docs you just read are from perl v5.40.1, dated 2026-01-21 β yeah she's got a timestamp and a Perl version, and now you know every single one of her secrets. go forth and IMAP responsibly πβ¨
π¦ where this page comes from
- ubuntu resolute: libmail-box-imap4-perl 4.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmail-box-imap4-perl 4.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms