NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #739 most downloaded on Packagist
PHP IMAP client
Last release 1 years ago
25 Apr 2025
Ships unpredictably
gaps range from 2 weeks to 1.6 years
Nearly every release is documented
notes for 57 of 58 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
60 releases · first in 2018
When using the chunk function, some messages do not have an element with index 0 #552 #553 (thanks @zeddmaster )
One column per quarter.
Filename sanitization is now optional (enabled via default)
Client::clone() looses account configuration #521 (thanks @netpok)Fix implicit marking of parameters as nullable, deprecated in PHP 8.4 #518 (thanks @campbell-m )
Client::getFolderPath() return null if folder is not set #506 (thanks @arnolem)Folder::status() #424 (thanks @InterLinked1)Config::class to allow class serialization (sponsored by elb-BIT GmbH)options.decoder to decoding and contains now the decoder class to used as well as their decoding fallbacksFolder::getStatus() no longer returns the results of EXAMINE but STATUS instead. If you want to use EXAMINE you can use the Folder::examine() method instead.ClientManager::class has now longer access to all configs. Config handling has been moved to its own class Config::class. If you want to access the config you can use the retriever method ::getConfig() instead. Example: $client->getConfig() or $message->getConfig(), etc.ClientManager::get isn't available anymore. Use the regular config accessor instead. Example: $cm->getConfig()->get($key)M̀essage::getConfig() now returns the client configuration instead of the fetching options configuration. Please use $message->getOptions() instead.Attachment::getConfig() now returns the client configuration instead of the fetching options configuration. Please use $attachment->getOptions() instead.Header::getConfig() now returns the client configuration instead of the fetching options configuration. Please use $header->getOptions() instead.M̀essage::setConfig now expects the client configuration instead of the fetching options configuration. Please use $message->setOptions instead.Attachment::setConfig now expects the client configuration instead of the fetching options configuration. Please use $attachment->setOptions instead.Header::setConfig now expects the client configuration instead of the fetching options configuration. Please use $header->setOptions instead.Config::class instanceClient::class constructor now require a Config::class instancePart::class constructor now require a Config::class instanceHeader::class constructor now require a Config::class instanceMessage::fromFile method now requires a Config::class instanceMessage::fromString method now requires a Config::class instanceMessage::boot method now requires a Config::class instanceMessage::decode method has been removed. Use Message::getDecoder()->decode($str) instead.Message::getEncoding method has been removed. Use Message::getDecoder()->getEncoding($str) instead.Message::convertEncoding method has been removed. Use Message::getDecoder()->convertEncoding() instead.Header::decode method has been removed. Use Header::getDecoder()->decode($str) instead.Error token length mismatch in ImapProtocol::readResponse #400
ImapProtocol::readResponse #400Legacy protocol support fixed (object to array conversion) #411
If you are using this method without providing a sanitized path, you are affected by this vulnerability. If you are not using this method or are provi…
Impacted are all versions below v5.3.0.
If possible, update to >= v5.3.0 as soon as possible. Impacted was the Attachment::save
method which could be used to write files to the local filesystem. The path was not
properly sanitized and could be used to write files to arbitrary locations.
However, the Attachment::save method is not used by default and has to be called
manually. If you are using this method without providing a sanitized path, you are
affected by this vulnerability.
If you are not using this method or are providing a sanitized path, you are not affected
by this vulnerability and no immediate action is required.
If you have any questions, please feel welcome to join this issue: #416
Impacted are all versions below v5.3.0.
If possible, update to >= v5.3.0 as soon as possible. Impacted was the Attachment::save
method which could be used to write files to the local filesystem. The path was not
properly sanitized and could be used to write files to arbitrary locations.
However, the Attachment::save method is not used by default and has to be called
manually. If you are using this method without providing a sanitized path, you are
affected by this vulnerability.
If you are not using this method or are providing a sanitized path, you are not affected
by this vulnerability and no immediate action is required.
If you have any questions, please feel welcome to join this issue: https://github.com/Webklex/php-imap/issues/416
Use all available methods to detect the attachment extension instead of just one
LIST command response to be empty #393Prevent line-breaks in folder path caused by special chars
Message::setConfig() config parameter type set to arrayIMAP::FT_PEEKMessage::is() date comparison fixedMessage::$client could not be set to nullin_reply_to and references parsing fixedMessage::hasTextBody() and Message::hasHtmlBody() should return false if the body is emptyiconv_mime_decode() is now used with ICONV_MIME_DECODE_CONTINUE_ON_ERROR to prevent the decoding from failing$total attribute value set to 0 #385 (thanks @hhniao)Protocol::sizes() support added (fetch the message byte size via RFC822.SIZE). Accessible through Message::getSize() #379 (thanks @didi1357)Message::hasFlag() method added to check if a message has a specific flagMessage::getConfig() method added to get the current message configurationFolder::select() method added to select a folderMessage::getAvailableFlags() method added to get all available flagsAttribute::map() method added to map all attribute valuesHeader::has() method added to check if a header attribute / value existMessage::fromString()More unique ID generation to prevent multiple attachments with same ID #363 (thanks @Guite )
The message uid and message number will only be fetched if accessed and wasn't previously set #326 #285 (thanks @szymekjanaczek )
ImapProtocol::logout always throws 'not connected' Exception after upgraded to 4.1.2 #351Client::clone() method added to clone a client instanceMessage::save()Message::fromFile()Protocol::getStream()Protocol::meta()ImapProtocol::reset()Response::class introduced to handle and unify all protocol requestsClientManager::getMask() addedAttribute::class instance can be treated as arrayClient::getConfig()Client::deleteFolder()nesbot/carbon version bumped to ^2.62.1phpunit/phpunit version bumped to ^9.5.10Header::get() always returns an Attribute::class instanceAttribute::class accessor methods renamed to shorten their names and improve the readabilityarray|bool will now always return a Response::class instance.ResponseException::class gets thrown if a response is empty or contains errorsMessage::fromFile())nullAttachment ID can return an empty value #318
Fix for extension recognition #325 (thanks @pwoszczyk)
Client::getFoldersWithStatus() recursive loading fixed #312 (thanks @szymekjanaczek)Folder::appendMessage() #306 #307 (thanks @rskrzypczak)Fix assumedNextTaggedLine bug #288 (thanks @Blear)
RFC 822 3.1.1. long header fields regular expression fixed #268 #269 (thanks @hbraehne)
Type casting added to several ImapProtocol return values #261
NONEXISTENT errors while selecting or examining a folder #266PaginatedCollection::paginate #267 (thanks @rogerb87)The $auto_reconnect used with Folder::indle() is deprecated and doesn't serve any purpose anymore.
DONE method refactoredHasEvent::getEvent return value set to mixed to allow multiple event typesfread (stream_context timeout issue fixed)Folder::idle() method reworked and several issues fixed #170 #229 #237 #249 #258HasEvent::getEvent returns a mixed result. Either an Event or a class string representing the event class.empty response instead of failed to read - connection closed?.$auto_reconnect used with Folder::indle() is deprecated and doesn't serve any purpose anymore.Fix attribute serialization #179 (thanks @netpok)
InvalidWhereQueryCriteriaExceptionstream_set_timeout() removedgetByUidLower, getByUidLowerOrEqual , getByUidGreaterOrEqual , getByUidGreater to fetch certain ranges of uids #201 (thanks @HelloSebastian)Folder::idle() is called #199 (thanks @HelloSebastian)options.fallback_date is used as fallback date is it is set. Otherwise, an exception will be thrown #198Folder::query(["FEATURE_NAME"])WhereQuery::where() accepts now a wide range of criteria / values. #104Folder::idle will throw an Webklex\PHPIMAP\Exceptions\NotSupportedCapabilityException exception if IMAP isn't supported by the mail serverboolean $uid option no longer support a boolean value. Use IMAP::ST_UID or IMAP::NIL instead. If you want to use an alternative to UID just use the string instead.options.sequence changed from IMAP::ST_MSGN to IMAP::ST_UID.Folder::query() no longer accepts a charset string. It has been replaced by an extension array, which provides the ability to automatically fetch additional features.Fix attribute serialization #179 (thanks @netpok)
Extend date parsing error message #173
InvalidWhereQueryCriteriaExceptionstream_set_timeout() removedFolder::query(["FEATURE_NAME"])WhereQuery::where() accepts now a wide range of criteria / values. #104boolean $uid option no longer support a boolean. Use IMAP::ST_UID or IMAP::NIL instead. If you want to use an alternative to UID just use the string instead.options.sequence changed from IMAP::ST_MSGN to IMAP::ST_UID.Folder::query() no longer accepts a charset string. It has been replaced by an extension array, which provides the ability to automatically fetch additional features.Fixed problem with skipping last line of the response. #166 (thanks @szymekjanaczek)
Added UID as available search criteria #161 (thanks @szymekjanaczek)
UID as available search criteria #161 (thanks @szymekjanaczek)Fixes handling of long header lines which are seperated by \r\n\t (thanks @Oliver-Holz)
\r\n\t (thanks @Oliver-Holz)POP3 fixes #151 (thanks @Korko)
Fix setting default mask from config #133 (thanks @shacky)
Attachment saving filename fixed
Client::getTimeout()Folder:idle() auto mode #89Client::getFolder() updated to circumvent special edge cases #79message_no removed from Message::class$message->from[0])Query::chunked(). Just in case you can't fetch all messages at onceAttribute:class\Webklex\PHPIMAP\Exceptions\MessageNotFoundException::class)Message::move() and Message::copy() no longer accept folder names as folder pathMessage::class instance might no longer have a message_no attributeBoundary detection simplified #90
Attachment detection updated #82 #90
Folder::idle() #89Attachment::save() return error 'A facade root has not been set' #87
Handle incomplete address to string conversion #83
Get partial overview when IMAP::ST_UID is set #74
IMAP::ST_UID is set #74Message::attachments() for Message::getAttachments() addedMessage::addFlag() for Message::setFlag() addedMessage::removeFlag() for Message::unsetFlag() addedMessage::flags() for Message::getFlags() addedMessageFlagException::class addedMessage::setSequenceId($id) addedÀttribute::class instance (should behave the same way as before, but might cause some problem in certain edge cases)Address::class instance (should behave the same way as before, but might cause some problem in certain edge cases)MessageFlagException::class exception can be thrown if a runtime error occursAttribute class here: www.php-imap.com/api/attributeAddress class here: www.php-imap.com/api/addressSet the message sequence when idling
Allow boundaries ending with a space or semicolon (thanks @smartilabs)
options.fetch set to IMAP::FT_PEEKMessage::getTextBody() fallback value fixedoptions.message_key option uid addedHeader::class attribute keys are now in a snake_format and no longer minus-separated.Message::getTextBody() no longer returns false if no text body is present. null is returned instead.Missing array decoder method added #51 (thanks @lutchin)
Search performance increased by fetching all headers, bodies and flags at once #42
Folder::overview() method added to fetch all headers of all messages in the current folderText/Html body fetched as attachment if subtype is null #34
IMAP::FT_PEEK removing "Seen" flag issue fixed #33
Header decoding problem fixed #31
Message::thread()Prevent text bodies from being fetched as attachment #27
in_reply_to "unified" to be always an array #26Protocol::moveMessage() instead of Protocol::copyMessage() and Message::delete() #29Protocol::moveMessage() method added #29Message::$in_reply_to type changed from mixed to arrayBoundary detection problem fixed (#28 @DasTobbel)
If content disposition is multiline, implode the array to a simple string (#25 @DasTobbel)
Potential problematic prefixed white-spaces removed from header attributes
Client::getFolder($name, $deleimiter = null) to accept either a folder name or path (@DasTobbel)ClientManager::make() method added to support undefined accounts
ClientManager::make() method added to support undefined accountsFix inline attachments and embedded images (#22 @dwalczyk)
Possible error during address decoding fixed (#16 @Slauta)
Fixed Query::paginate() (#13 #14 by @Max13)
Message::getAttributes() hasn't returned all parameters
Wrong message content property reference fixed
Part header detection method changed
Possible decoding problem fixed
Str::class dependency removed from Header::classDependency problem in Attachement::getExtension() fixed
Attachement::getExtension() fixed (#9)Missing default config parameter added
Event system and callbacks added
### Fixed - Carbon dependency fixed
Missing pagination item records fixed
.csv attachement is not processed
Pagination count total bug #213
Folder delimiter check added #137
Nothing published for this version
new php-imap package (fork from webklex/laravel-imap)
Error in Attachment::__construct #3
Your coding agent can read these notes before it upgrades. Set up the MCP server →