summaryrefslogtreecommitdiff
path: root/src/cmd/move_mail.rs
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2024-11-21 21:14:40 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2024-11-21 21:14:40 +0100
commit48c2945172b88c35c187d298a35bf26716af4e91 (patch)
tree2af21ddb4dcacd191e07fef156609b7c1488ebaf /src/cmd/move_mail.rs
parent6ed535387df0dffa72a10e601b8ea37c99345d84 (diff)
Switch to varlink as IPC protocol
This is a lot! Whole new design on top of a statefult varlink interface. You can now handle multiple request response cycles over a single connection. The error responses are lot more refined than just status codes with optional messages and finally part of the protocol. TODO: A lot of error handling needs to be improved.
Diffstat (limited to 'src/cmd/move_mail.rs')
-rw-r--r--src/cmd/move_mail.rs18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/cmd/move_mail.rs b/src/cmd/move_mail.rs
deleted file mode 100644
index 146e906..0000000
--- a/src/cmd/move_mail.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-use std::path::PathBuf;
-
-use protobuf::Message as _;
-
-use crate::cmd::open_submaildir;
-use crate::error::Result;
-use crate::pb3::jwebmail::{MoveReq, MoveResp};
-
-pub fn move_mail(p: PathBuf, req: &[u8]) -> Result<Vec<u8>> {
- let r = MoveReq::parse_from_bytes(req)?;
-
- let from = open_submaildir(p.clone(), &r.from_f);
- let to = open_submaildir(p, &r.to_f);
- from.move_to(&r.mid, &to)?;
-
- let resp = MoveResp::new();
- resp.write_to_bytes().map_err(|e| e.into())
-}