cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]
http://cypht.org
GNU Lesser General Public License v2.1
949 stars 146 forks source link

Auto detect IMAP special folders when configuring account #1022

Closed Yannick243 closed 1 month ago

Yannick243 commented 1 month ago

PR

After https://github.com/cypht-org/cypht/pull/625, cypht was unable to auto detect IMAP special folders (Trash/Sent/Drafts) even though they exist on the server. Based on "RFC 6154: IMAP LIST Extension for Special-Use Mailboxes"

Related issue:

https://github.com/cypht-org/cypht/issues/817

marclaporte commented 1 month ago

After #625, cypht was unable

I don't remember ever seeing this work before. #625 arrived in Cypht 2.0.0

Can you confirm if this works OK in Cypht 1.4.x?

Thanks!

Yannick243 commented 1 month ago

The feature was introduced here: https://github.com/cypht-org/cypht/pull/586 After testing on version 1.4.x, it appears that it was working partially (on some folders).

With this adjustment to 2.0.0, it is working with all folders when using the configuration form below. CleanShot 2024-05-14 at 20 52 11@2x As we can see the folders are automatically detected: CleanShot 2024-05-14 at 20 53 08@2x

For now, the remaining part that is not working is when using the advanced configuration form below: https://imgur.com/a/HW4yFZZ

marclaporte commented 1 month ago

Ok, but is it working because we are matching folder names or via "RFC 6154: IMAP LIST Extension for Special-Use Mailboxes"?

marclaporte commented 1 month ago

@josaphatim any wisdom?

josaphatim commented 1 month ago

Ok, but is it working because we are matching folder names or via "RFC 6154: IMAP LIST Extension for Special-Use Mailboxes"?

@josaphatim any wisdom?

RFC 6154 says that: This extension adds new optional mailbox attributes that a server may include in IMAP LIST command responses to identify special-use mailboxes to the client. This being said, special-use mailboxes will not always be present for all providers and some will only provide a few special-use mailboxes. However the feature was working fine before #625 was merged.

marclaporte commented 1 month ago

Ok. So @Yannick243: please make sure to leverage RFC 6154 and not just folder names.

Yannick243 commented 1 month ago

Hello @josaphatim, @marclaporte The code below that we have in Cypht takes advantage of RFC 6154. With the command LIST (SPECIAL-USE) "" "*", we request mailboxes along with their special-use attributes and later filter them with their corresponding folders (if they exist). Are you okay with this so I can proceed to the next step ?

CleanShot 2024-05-16 at 15 15 25@2x

marclaporte commented 1 month ago

Sounds good to me. @josaphatim?

josaphatim commented 1 month ago

@Yannick243 why this still in draft ?

Yannick243 commented 1 month ago

This is not working when using the new advanced configuration form https://github.com/cypht-org/cypht/pull/855. That's what I am fixing.

Yannick243 commented 1 month ago

The PR is ready for a review.