]> git.r.bdr.sh - rbdr/olden-mail/commitdiff
Send the MAILBOX OK
authorRuben Beltran del Rio <redacted>
Mon, 27 Jan 2025 22:02:41 +0000 (23:02 +0100)
committerRuben Beltran del Rio <redacted>
Mon, 27 Jan 2025 22:02:41 +0000 (23:02 +0100)
README.md
src/middleware/find_mailboxes_compatibility.rs

index fa87603d6065845c2bd468eaffeed13031894567..c494ef5edbae4621815f4a323a8b2e14a77ca217 100644 (file)
--- a/README.md
+++ b/README.md
@@ -59,8 +59,20 @@ environment variables)
 % REMOTE_IMAP_HOST=imap.coolmailsite.example REMOTE_SMTP_HOST=smtp.coolmailsite.example olden-mail
 ```
 
 % 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`.
 ## 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 `###`.
index daf0dc04856f4cbe444e5fd5096cc00c2e4611d5..42db39615e8b8316e6eb9bf1e3ea372091f74599 100644 (file)
@@ -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();
                 Some(line.to_string())
             })
             .collect();