Description
Usually every command send to an imap server has one or several responses. Currently they don't always get treated and checked the way they should be.
This was discovered during a discussion on issue #263
For example the command APPEND
:
RFC references:
- https://www.rfc-editor.org/rfc/rfc3501#section-6.3.11
- https://datatracker.ietf.org/doc/html/rfc9051#section-6.3.12
Possible responses:
TAG3 OK APPEND completed
..or:
TAG3 OK [APPENDUID 38505 3955] APPEND completed
There are also intermediate responses like:
+ Ready for literal data
..which indicates the server is ready to accept additional data.
Bad commands or server errors are currently only partially handled and should be handled for every command send. Every command can fail in two ways. Either with a NO
or BAD
alongside some additional and provider specififc error message.
To improve the response handling, every command send to the server, should return an ImapResponse::class
instance which holds information such as the send command and received responses / errors. This response class might also include "magic" accessors to retrieve named data from the response (like the Attribute::class
class).