Skip to content

Releases: Webklex/php-imap

5.5.0

28 Jun 01:57
Compare
Choose a tag to compare

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

24 Jun 01:47
Compare
Choose a tag to compare

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

20 Jun 11:44
Compare
Choose a tag to compare

Fixed

  • Potential RCE through path traversal fixed #414 (special thanks @angelej)

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

10 Apr 22:24
Compare
Choose a tag to compare

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

16 Mar 00:05
Compare
Choose a tag to compare

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 fixed
  • Message::$client could not be set to null
  • in_reply_to and references 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() and Message::hasHtmlBody() should return false 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 with ICONV_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 through Message::getSize() #379 (thanks @didi1357)
  • Message::hasFlag() method added to check if a message has a specific flag
  • Message::getConfig() method added to get the current message configuration
  • Folder::select() method added to select a folder
  • Message::getAvailableFlags() method added to get all available flags
  • Live mailbox and fixture tests added
  • Attribute::map() method added to map all attribute values
  • Header::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

01 Mar 01:27
Compare
Choose a tag to compare

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

18 Jan 18:37
Compare
Choose a tag to compare

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.1
  • phpunit/phpunit version bumped to ^9.5.10
  • Header::get() always returns an Attribute::class instance
  • Attribute::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 a Response::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

14 Dec 15:45
Compare
Choose a tag to compare

Fixed

4.1.1

16 Nov 07:27
Compare
Choose a tag to compare

Fixed

4.1.0

18 Oct 04:18
Compare
Choose a tag to compare

Fixed

Added