-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support to add or remove flag(s) on a message #205
Comments
I dug around a bit and stumbled upon this comment: #179 (comment) Is there a reason the "protocol" is protected? If so, would a PR be accepted which introduces this |
In general, exposing internals increases the API surface, and therefore removes flexibility in upgrade/refactoring and increases the likeliness of breaking changes. What is the use-case for exposing |
I'm porting some code which was using a different IMAP implementation that didn't support OAuth 2.0. There, in some cases, it turned out the IMAP "deleted" flag was accidentally set. So before processing this IMAP folder, I just added a bit of code which removed the "delete" flag. Basically it would do the opposite of this method: laminas-mail/src/Storage/Imap.php Line 281 in bf75042
The legacy implementation relies on this native PHP method: https://www.php.net/manual/en/function.imap-undelete.php |
Well, the protocol is given at creation time, so you should be able to get an instance without asking it to the storage: laminas-mail/src/Storage/Imap.php Lines 201 to 206 in fe1ac4a
The fact that laminas-mail/src/Storage/Imap.php Lines 221 to 235 in fe1ac4a
My endorsement would be to create the protocol upfront, then keeping a reference to it when you need it: this also removes a lot of responsibilities from Sadly, we can't change that constructor anymore: too many BC implications. |
Thanks for your time and detailed explanation! So the best workaround is like the one in the comment I linked to earlier? |
I think the best workaround would be to operate on the protocol itself, before passing it to the storage: is that workable? |
Thanks for the advice, but for now it would be too complicated. Currently trying to make the replacement as much "drop in" as possible rather than revising the entire logic :) |
Two workarounds endorsed:
The correct solution is having the transport upfront, but these should work. Meanwhile, closing as "won't fix" here. |
Feature Request
Allow this method to specify which flags need to be added or removed:
laminas-mail/src/Storage/Imap.php
Line 550 in bf75042
It seems to be available through the storage, but not on the message? Is this a limitation or just not implemented (yet) for some reason?
Summary
Allow this method to specify the mode:
laminas-mail/src/Storage/Imap.php
Line 550 in bf75042
It seems to be available through the protocol's
store()
method, but not directly on the message? Is this a limitation or just not implemented (yet) for some reason?The text was updated successfully, but these errors were encountered: