Releases: Webklex/php-imap
Releases · Webklex/php-imap
5.5.0
Fixed
- Error token length mismatch in
ImapProtocol::readResponse
#400 - Attachment name parsing fixed #410 #421 (thanks @nuernbergerA)
- Additional Attachment name fallback added to prevent missing attachments
- Attachment id is now static (based on the raw part content) instead of random
- Always parse the attachment description if it is available
Added
- Attachment content hash added
5.4.0
Fixed
- Legacy protocol support fixed (object to array conversion) #411
- Header value decoding improved #410
- Protocol exception handling improved (bad response message added) #408
- Prevent fetching singular rfc partials from running indefinitely #407
- Subject with colon ";" is truncated #401
- Catching and handling iconv decoding exception #397
Added
5.3.0 - Security patch
Fixed
Security Impact and Mitigation
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
Timeline
- 17.06.23 21:30: Vulnerability reported
- 18.06.23 19:14: Vulnerability confirmed
- 19.06.23 18:41: Vulnerability fixed via PR #414
- 20.06.23 13:45: Security patch released
5.2.0
Fixed
- Use all available methods to detect the attachment extension instead of just one
- Allow the
LIST
command response to be empty #393 - Initialize folder children attributes on class initialization
Added
- Soft fail option added to all folder fetching methods. If soft fail is enabled, the method will return an empty collection instead of throwing an exception if the folder doesn't exist
5.1.0
Fixed
- IMAP Quota root command fixed
- Prevent line-breaks in folder path caused by special chars
- Partial fix for #362 (allow overview response to be empty)
Message::setConfig()
config parameter type set to array- Reset the protocol uid cache if the session gets expunged
- Set the "seen" flag only if the flag isn't set and the fetch option isn't
IMAP::FT_PEEK
Message::is()
date comparison fixedMessage::$client
could not be set to nullin_reply_to
andreferences
parsing fixed- Prevent message body parser from injecting empty lines
- Don't parse regular inline message parts without name or filename as attachment
Message::hasTextBody()
andMessage::hasHtmlBody()
should returnfalse
if the body is empty- Imap-Protocol "empty response" detection extended to catch an empty response caused by a broken resource stream
iconv_mime_decode()
is now used withICONV_MIME_DECODE_CONTINUE_ON_ERROR
to prevent the decoding from failing- Date decoding rules extended to support more date formats
- Unset the currently active folder if it gets deleted (prevent infinite loop)
- Attachment name and filename parsing fixed and improved to support more formats
- Check if the next uid is available (after copying or moving a message) before fetching it #381
- Default pagination
$total
attribute value set to 0 #385 (thanks @hhniao) - Use attachment ID as fallback filename for saving an attachment
- Address decoding error detection added #388
Added
- Extended UTF-7 support added (RFC2060) #383
Protocol::sizes()
support added (fetch the message byte size via RFC822.SIZE). Accessible throughMessage::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 flags- Live mailbox and fixture tests added
Attribute::map()
method added to map all attribute valuesHeader::has()
method added to check if a header attribute / value exist- All part attributes are now accessible via linked attribute
- Restore a message from string
Message::fromString()
5.0.1
Fixed
- More unique ID generation to prevent multiple attachments with same ID #363 (thanks @Guite)
- Not all attachments are pushed to the collection #372 (thanks @AdrianKuriata)
- Partial fix for #362 (allow search response to be empty)
- Unsafe usage of switch case. #354 #366 (thanks @shuergab)
- Fix use of ST_MSGN as sequence method #356 (thanks @gioid)
- Prevent infinite loop in ImapProtocol #316 (thanks @thin-k-design)
5.0.0
Fixed
- The message uid and message number will only be fetched if accessed and wasn't previously set #326 #285 (thanks @szymekjanaczek)
- Fix undefined attachment name when headers use "filename*=" format #301 (thanks @JulienChavee)
- Fixed
ImapProtocol::logout
always throws 'not connected' Exception after upgraded to 4.1.2 #351 - Protocol interface and methods unified
- Strict attribute and return types introduced where ever possible
- Parallel messages during idle #338
- Idle timeout / stale resource stream issue fixed
- Syntax updated to support php 8 features
- Get the attachment file extension from the filename if no mimetype detection library is available
- Prevent the structure parsing from parsing an empty part
- Convert all header keys to their lower case representation
- Restructure the decode function #355 (thanks @istid)
Added
- Unit tests added #347 #242 (thanks @sergiy-petrov, @boekkooi-lengoo)
Client::clone()
method added to clone a client instance- Save an entire message (including its headers)
Message::save()
- Restore a message from a local or remote file
Message::fromFile()
- Protocol resource stream accessor added
Protocol::getStream()
- Protocol resource stream meta data accessor added
Protocol::meta()
- ImapProtocol resource stream reset method added
ImapProtocol::reset()
- Protocol
Response::class
introduced to handle and unify all protocol requests - Static mask config accessor added
ClientManager::getMask()
added - An
Attribute::class
instance can be treated as array - Get the current client account configuration via
Client::getConfig()
- Delete a folder via
Client::deleteFolder()
Breaking changes
- PHP ^8.0.2 required
nesbot/carbon
version bumped to ^2.62.1phpunit/phpunit
version bumped to ^9.5.10Header::get()
always returns anAttribute::class
instanceAttribute::class
accessor methods renamed to shorten their names and improve the readability- All protocol methods that used to return
array|bool
will now always return aResponse::class
instance. ResponseException::class
gets thrown if a response is empty or contains errors- Message client is optional and can be null (e.g. if used in combination with
Message::fromFile()
) - The message text or html body is now "" if its empty and not
null
4.1.2
4.1.1
Fixed
- Fix for extension recognition #325 (thanks @pwoszczyk)
- Missing null check added #327 (thanks @spanjeta)
- Leading white-space in response causes an infinite loop #321 (thanks @thin-k-design)
- Fix error when creating folders with special chars #319 (thanks @thin-k-design)
Client::getFoldersWithStatus()
recursive loading fixed #312 (thanks @szymekjanaczek)- Fix Folder name encoding error in
Folder::appendMessage()
#306 #307 (thanks @rskrzypczak)