IMAP: server response codes are dropped, so a temporary outage looks like a rejected sign-in
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- swift
- Domain
- authentication, networking
Research direction
Start with AuthenticateHandler and the IMAPError.authenticationFailed and IMAPError.commandFailed cases, where tagged NO replies currently keep only their text. Carry the bracketed response code on those errors, then check that UNAVAILABLE, AUTHENTICATIONFAILED, EXPIRED and ALERT are handled as the issue describes. Done means the code survives to the error and the sign-in failure is classified from it, which needs a test for each code.
Written by the indexing model from the issue text.
Description
Summary
When a command fails, the IMAP handlers keep the human-readable text of the server's reply and drop the response code in square brackets. For sign-in that code is what tells a wrong credential from a server that is temporarily down.
(Found by reading the code.)
Details
With the work for #535, AuthenticateHandler turns every tagged NO into IMAPError.authenticationFailed carrying the text only. NO [UNAVAILABLE] … and NO [AUTHENTICATIONFAILED] … produce the same error. The other handlers do the same with commandFailed.
This starts to matter as soon as something acts on a rejected sign-in, for example by refreshing the token or asking the user to sign in again.
Expected behavior
- The response code is kept on the error.
UNAVAILABLEis treated as temporary: try again later, don't touch the credential.AUTHENTICATIONFAILEDandEXPIREDare treated as a credential problem.ALERTtext reaches the user.
Suggested fix
Carry the response code on IMAPError.authenticationFailed and IMAPError.commandFailed, and classify the sign-in failure from it.
References
- RFC 5530, section 3,
UNAVAILABLE: "Temporary failure because a subsystem is down." - RFC 5530, section 3,
AUTHENTICATIONFAILED: "when a client sees AUTHENTICATIONFAILED, it knows that the problem wasn't, e.g., UNAVAILABLE, so there's no point in trying the same login/password again later." - RFC 5530, section 3,
EXPIRED: "Either authentication succeeded or the server no longer had the necessary data; either way, access is no longer permitted using that passphrase." - RFC 3501, section 7.1,
ALERT: "The human-readable text contains a special alert that MUST be presented to the user in a fashion that calls the user's attention to the message."
In thunderbird-android
- Android has the same gap, with a TODO in
authWithOAuthToken: "Check response code so we don't needlessly invalidate the token."
Links are pinned to ac1f0e8.
- Dominant language
- Swift
- Stars
- 1.3k
- Forks
- 51
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 33
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thunderbird/thunderbird-ios
-
Account: Authorization's description returns the stored credential, including the refresh tokenOpen
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
thunderbird/thunderbird-ios#666 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
thunderbird/thunderbird-ios#664 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
thunderbird/thunderbird-ios#658 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
thunderbird/thunderbird-ios#657 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
thunderbird/thunderbird-ios#647 ·
Maintainers usually reply within 1 day
All issues in thunderbird/thunderbird-ios
Similar issues
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
heysidhant/appvanish#4 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
timfraedrich/OutRun#121 ·
-
deferred tooling
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
mauwii/pokerchipcase#157 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100