-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
Add OAuth support #443
Comments
Ouch :\ |
Hi I am are using your library to get emails from gmail. I want to switch to googles new oauth system quite soon. Is there any progress on this issue for ddeboer/imap? |
No one is working on it, as far as I know |
I believe ddboer/imap can do nothing unless something is done to the PHP extension: https://wiki.php.net/todo/ext/imap |
This gives me hope: https://wiki.php.net/todo/ext/imap/xoauth2 |
There are also some workarounds for G Suite: https://medium.com/@freescout/oauth-2-0-g-suite-microsoft-365-and-php-7da16ca74314 |
Huh, nice, I've always used App password indeed. I consider this topic closed. |
Hi! @Slamdunk @freescout-helpdesk @croensch @LinusBrockmeyer @sombatos The strategy to overcome the problem is replacing all the
etc... The idea behind the I'm waiting from your feedback! I hope that |
Hi @francescobianco, I guess you are referring to your library https://github.com/javanile/php-imap2 I have to say App passwords are now well spread and supported, so I'm not intended to change this library auth methods. |
Hi @Orgoth , please, get you a chance to PHP-IMAP2 (https://github.com/javanile/php-imap2) This was full tested, every input to imap2_* functions get back the same output of imap_* equivalent The IMAP2 works well with OAUTH This libray can be installed with composer composer require javanile/php-imap2 This libray introduce a easy way to replace the old PHP-IMAP with new one: JUST replace all imap_(...) functions with imap2_(...) NO OTHER AMENDS are required. Please give me the opportunity to make my sacrifices useful to the community. |
Thanks! @Orgoth ! I'm not scared by hard work, my mission is to work full time on it, to build a professional replacement for standard IMAP. I'm looking for people who believe in this project to have the peace of mind to invest all my time on it. I will do an update of the compatibility table later this month of course both imap_open and many others will be 100% by that date. |
Hi @Orgoth, Does this competeer work for you? After I'm trying this I get a lot of errors inside isAttachment function, event when I fix this other errors fetching the body occurs. |
javanile/php-imap2#12 I've fixed most of the issues in BodyStructure.php, perhaps that will help you as well. |
@Orgoth I've tested this version on over 2000 e-mails and compared the output to the original imap_fetchstructure function to make sure these matched exactly, I think I got most of them covered, not sure about charsets though. |
@Orgoth probably caused by yet another flashy structured e-mail indeed, causing it to break much earlier in parsing and landing here with wrong item data. If you need help just let me know. Fyi what I did to compare the outputs was running both imap2_fetchstructure and imap_fetchstructure and json_encoding the results and compare them :-) quick and dirty. |
@Orgoth To me it seems something before we get into getEncoding is broken, a list of attachments should never arrive at that function. Although your fix hides the issue I think we should determine the real issue. If you could send me a json encoded version of the structure I'll have a look into it. You can do this easily by enabling line 33 (and 34) in BodyStructure |
@Orgoth could you also supply the json encode of the original imap_fetchstructure of the message? |
@Orgoth I've fixed the array version, only there is some discrepancy in the output/source for the text/html part
vs
but these two values match your input, so that's strange. The root cause however is fixed. |
@Orgoth I will update my patch shortly. For the "*" e-mail, is it possible to get the raw IMAP response from the FETCH command? Perhaps by using telnet to speak IMAP yourself to the server or by adding a print/echo in Roundcube/ImapClient.php around line 2472 with the $line data? |
javanile/php-imap2@2874eb9 is the new commit for the array issue, this was caused by how a related part was parsed. |
Fixed in javanile/php-imap2@f119d25 No need to compensate, I need this php-imap2 library working properly too :-) |
Fixed in javanile/php-imap2@2fe8fad However the output still differs in line/bytes on the RFC822 part but possible thats caused by the different imap servers used. |
@Orgoth sorry had a few days off :-) You fixed the last issue afaik? So all works now? Then I'll all your 2 updates in my pull request. |
@Orgoth I've taken a new approach which simplifies everything. I've updated the PR javanile/php-imap2#12 for those interested |
Original Comment:
In case anyone else is having the same question, I will leave this here, but the answer is "just do not install the php-imap official module." ie yum/apt remove php-imap if you installed via package, and such. |
I am aware that, general conscious on this is to not integrate oAuth in this library. However, with two major Email Providers out of 3 phasing out IMAP completely, it's a good opportunity to revisit it. Google is phasing out IMAP : https://workspaceupdates.googleblog.com/2023/09/winding-down-google-sync-and-less-secure-apps-support.html Unfortunately, the reliability of the library https://github.com/javanile/php-imap2 is a major concern, as it breaks at multiple levels, even critical PRs on it are not integrated. Not to mention, the roundcube library it uses under the hood, has it's own issues with getting stuck and time-outs. |
I came to this issue looking for a solution to connect via OAuth using my existing ddeboer/imap code / integration and I'm now leaving certain that IMAP in general is in its way out of commercial email services as it's now deemed unsafe / obsolete. |
Imap will not be discontinued, only the login procedure via username and password. As far as I know "I can be wrong", there is currently no developer who maintains the imap extension within PHP and integrates new functions such as oAuth. https://wiki.php.net/todo/ext/imap/xoauth2 Edit: |
@Orgoth at least regarding MS or Google, it seems IMAP as a protocol is being removed from user's settings, regardless of auth method, maybe I didn't got that right? I understand IMAP itself lives on elsewhere. |
https://support.google.com/mail/answer/78892 https://support.microsoft.com/de-de/office/pop-imap-und-smtp-einstellungen-f%C3%BCr-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040 It is possible, you have misunderstood something, but I can also be wrong. At the moment, my partners did not report problems regarding fetching emails from their office365/exchange-servers. |
Starting February 15, 2021, G Suite accounts will only allow access to apps using OAuth
google/gmail-oauth2-tools#18
The text was updated successfully, but these errors were encountered: