Imap_Client icon indicating copy to clipboard operation
Imap_Client copied to clipboard

Added new function to allow keeping the flags original case

Open Barry3D opened this issue 1 year ago • 1 comments

According to RFC 9051 "Servers MAY permit the client to define new keywords in the mailbox".

For my use-case this makes it necessary that I change the encoding of keywords from UTF-8 to UTF7-IMAP to allow Umlauts in keywords.

Example: "Bööm" will be encoded as "B&APYA9g-m"

If I insert the lowercase Version of this string into mb_convert_encoding(), I receive a different result ("b??m").

Therefore I propose a method that allows us to fetch keywords in their original case to prevent encoding from becoming corrupted.

I created a patch that simply adds a new method to fetch flags, that hopefully has no impact on the existing code. The constant I added for flags with their original case is currently 999 since I don't know if you're simply counting up or if the values of the constants have a system.

Barry3D avatar Oct 08 '24 06:10 Barry3D

PR Summary

  • Introduction of a New Constant A new constant, FETCH_FLAGS_ORIGINAL_CASE, has been established with a designated value of 999 to enhance our system's functionality.

  • Updating Method to Store Original IMAP Flags The setFlags method in our code has been updated. It now makes use of this new constant to store the original case of IMAP flags, improving our system's ability to retain essential details.

  • New Method for Retrieving Flag Information A fresh method, getFlagsOriginalCase(), has been introduced. This method retrieves IMAP flags while maintaining their original capitalization. This has the potential to enhance reliability when handling these flags in the future.

what-the-diff[bot] avatar Oct 08 '24 06:10 what-the-diff[bot]