summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/move.rs12
-rw-r--r--src/cmd/raw.rs5
-rw-r--r--src/cmd/search.rs2
3 files changed, 15 insertions, 4 deletions
diff --git a/src/cmd/move.rs b/src/cmd/move.rs
index c852d6c..7fc762f 100644
--- a/src/cmd/move.rs
+++ b/src/cmd/move.rs
@@ -11,7 +11,17 @@ pub fn r#move(
if let Some(p) = ms.maildir_path.read().unwrap().clone() {
let from = open_submaildir(p.clone(), &from_folder);
let to = open_submaildir(p, &to_folder);
- from.move_to(&mid, &to).unwrap();
+ if from.move_to(&mid, &to).is_err() {
+ // This is not neccessarily true!
+ // The error needs to be investigated to find out the actual cause.
+ //
+ // Other plausible causes:
+ //
+ // InvalidFolder(folder: from_folder)
+ // InvalidMid(folder: from_folder, mid: mid)
+ //
+ return call.reply_invalid_folder(to_folder);
+ }
call.reply()
} else {
call.reply_not_initialized()
diff --git a/src/cmd/raw.rs b/src/cmd/raw.rs
index a20eded..0a4df86 100644
--- a/src/cmd/raw.rs
+++ b/src/cmd/raw.rs
@@ -36,6 +36,7 @@ pub fn raw(
.map(|x| x.parse())
.collect::<std::result::Result<Vec<usize>, std::num::ParseIntError>>()
{
+ let mut s;
let mut m = mail.parsed().unwrap();
if path[0] != 0 {
@@ -56,8 +57,8 @@ pub fn raw(
mime_path.to_owned(),
);
}
- let s: &'static _ = m.get_body_raw().unwrap().leak();
- m = mailparse::parse_mail(s).unwrap();
+ s = m.get_body_raw().unwrap();
+ m = mailparse::parse_mail(&s).unwrap();
}
x if x.starts_with("multipart/") => {
if *i >= m.subparts.len() {
diff --git a/src/cmd/search.rs b/src/cmd/search.rs
index 7cf0fb0..00cc192 100644
--- a/src/cmd/search.rs
+++ b/src/cmd/search.rs
@@ -9,7 +9,7 @@ pub fn search(
) -> varlink::Result<()> {
if let Some(p) = ms.maildir_path.read().unwrap().clone() {
let md = open_submaildir(p, &folder);
-
+
todo!();
} else {
call.reply_not_initialized()