summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIMAP
AgeCommit message (Collapse)Author
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-09-21LibIMAP: Remove unused Variant optionBen Wiederhake
2021-09-11AK: Replace the mutable String::replace API with an immutable versionIdan Horowitz
This removes the awkward String::replace API which was the only String API which mutated the String and replaces it with a new immutable version that returns a new String with the replacements applied. This also fixes a couple of UAFs that were caused by the use of this API. As an optimization an equivalent StringView::replace API was also added to remove an unnecessary String allocations in the format of: `String { view }.replace(...);`
2021-09-03Everywhere: Prevent risky implicit casts of (Nonnull)RefPtrDaniel Bertalan
Our existing implementation did not check the element type of the other pointer in the constructors and move assignment operators. This meant that some operations that would require explicit casting on raw pointers were done implicitly, such as: - downcasting a base class to a derived class (e.g. `Kernel::Inode` => `Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp), - casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>` in LibIMAP/Client.cpp) This, of course, allows gross violations of the type system, and makes the need to type-check less obvious before downcasting. Luckily, while adding the `static_ptr_cast`s, only two truly incorrect usages were found; in the other instances, our casts just needed to be made explicit.
2021-09-01LibIMAP: Stop leaking a Core::Promise<bool> in IMAP::Client::connect()Andreas Kling
2021-09-01LibIMAP: Remove accidental use of STLAndreas Kling
2021-08-03Everywhere: Make use of container version of all_ofLenny Maiorani
Problem: - New `all_of` implementation takes the entire container so the user does not need to pass explicit begin/end iterators. This is unused except is in tests. Solution: - Make use of the new and more user-friendly version where possible.
2021-07-24LibIMAP: Parse (but ignore) OK [HIGHESTMODSEQ <mod-sequence-value>]Linus Groh
Parse it to avoid dbgln() spam, but ignore the value for now. See: https://datatracker.ietf.org/doc/html/rfc4551#section-3.1.1
2021-07-24LibIMAP: Parse OK [CLOSED]Linus Groh
In my case the mail server responded with the following after selecting a mailbox (in the Mail application): * OK [CLOSED] Previous mailbox closed. * FLAGS (\Answered \Flagged ...) * OK [PERMANENTFLAGS (\Answered \Flagged ... \*)] Flags permitted. * 2 EXISTS * 0 RECENT * OK [UIDVALIDITY 1234567890] UIDs valid * OK [UIDNEXT 12345] Predicted next UID * OK [HIGHESTMODSEQ 123456] Highest A6 OK [READ-WRITE] Select completed (0.002 secs). The [CLOSED] part threw the parser off as it was expecting a space after the atom following the opening bracket, which would actually lead to a crash of Mail (AK::Optional::value() without value).
2021-07-24LibIMAP: Replace abuse of String::matches() with == in the parserLinus Groh
matches() is for globs. These are not globs.
2021-07-24LibIMAP: Add and use Parser::consume_until_end_of_line()Linus Groh
2021-07-24LibIMAP: Clean up Parser.h a bitLinus Groh
Move members after methods, remove useless parameter names ('x', 's'), more sensible method grouping.
2021-07-24LibIMAP: Rename IMAP::Parser::{parse => consume}_while()Linus Groh
This isn't parsing anything.
2021-07-24LibIMAP: Add a bunch of serialize_astring in command constructionLuke
These were putting the raw string values into the command, where they should be astrings as per the grammar: https://datatracker.ietf.org/doc/html/rfc3501#section-9
2021-07-24LibIMAP: Use try_parse_number instead of parse_number when parsing partsLuke
This makes it so we can use Optional instead of relying on an error number.
2021-07-24LibIMAP: Make Section::parts unsignedLuke
2021-07-24LibIMAP: Add method to get data out of BodyStructureLuke
2021-07-24LibIMAP: Add quoted printable decoderLuke
This is a very common encoding for e-mail. Gmail seems to encode all HTML e-mail in it. imap qp clang
2021-07-15LibCore+LibIMAP: Move Promise to LibCoreTimothy
This makes Promise available without having to link LibIMAP.
2021-06-11LibIMAP: Support for remaining IMAP commandsx-yl
These include APPEND, AUTHENTICATE, CHECK, CLOSE, EXAMINE, EXPUNGE, LSUB, SUBSCRIBE, UNSUBSCRIBE
2021-06-11LibIMAP: Support for APPENDx-yl
2021-06-11LibIMAP: Support for COPY, CREATE, DELETE and RENAMEx-yl
2021-06-11LibIMAP: Support for STORE and STATUSx-yl
2021-06-11LibIMAP: Support for the SEARCH commandx-yl
2021-06-11LibIMAP: Support for FETCH BodyStructurex-yl
This completes the implementation of the FETCH command.
2021-06-11LibIMAP: Support for the FETCH command (*mostly)x-yl
This commit doesn't include support for FETCH BODY, because it's a bit big already. Rest assured, FETCH is the most complicated IMAP command, and we'll go back to simple boring ones shortly.
2021-06-11LibIMAP: Support for the IDLE commandx-yl
2021-06-11LibIMAP: Support for LOGIN and LOGOUTx-yl
2021-06-11LibIMAP: Support for the LIST and SELECT commandsx-yl
2021-06-11LibIMAP: Support for CAPABILITY command & responsex-yl
This involves parsing messages with untagged responses
2021-06-11LibIMAP: Add a new IMAP client and support NOOPx-yl
A large commit, but sets up the framework for how the IMAP library will work. Right now only the NOOP command and response is supported.