diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 23:02:41 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 23:02:41 +0100 |
| commit | 5bc877d3fa9025180020d0b25104cc22333e6252 (patch) | |
| tree | d25f26a48c8d40b1d1bd97a26ab65c7785c497c9 | |
| parent | 35b52518008f10a39bb52b335bf0e1ae310bda40 (diff) | |
Send the MAILBOX OK
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | src/middleware/find_mailboxes_compatibility.rs | 4 |
2 files changed, 16 insertions, 0 deletions
@@ -59,8 +59,20 @@ environment variables) % REMOTE_IMAP_HOST=imap.coolmailsite.example REMOTE_SMTP_HOST=smtp.coolmailsite.example olden-mail ``` +## Middleware + +In order to work with some older clients, middleware allow transformation of +messages. The current middleware are: + +- `FindMailboxesCompatibility` - Transforms IMAPv3 FIND MAILBOX commands to + IMAPv4 LIST commands. + ## Debugging You can control how much it prints by setting `RUST_LOG`. Setting it to `debug` will output the whole protocol stream. The default level is `info`. + +Messages coming from the client are prefixed with `>>>`, and messages coming +from the server with `<<<`. If a middleware modified a command, you'll see +the message that was actually sent prefixed with `###`. diff --git a/src/middleware/find_mailboxes_compatibility.rs b/src/middleware/find_mailboxes_compatibility.rs index daf0dc0..42db396 100644 --- a/src/middleware/find_mailboxes_compatibility.rs +++ b/src/middleware/find_mailboxes_compatibility.rs @@ -56,6 +56,10 @@ impl Middleware for FindMailboxesCompatibility { } } + if line.contains("OK") { + return Some("{tag} OK MAILBOX Completed.".to_string()); + } + Some(line.to_string()) }) .collect(); |