mirror of
https://github.com/FliegendeWurst/inboxid.git
synced 2024-11-09 10:50:40 +00:00
filter: set flags when moving
This commit is contained in:
parent
b100b96bc8
commit
07d5862e16
@ -37,8 +37,13 @@ fn do_filtering(mailbox: &str, config: &str) -> Result<()> {
|
|||||||
for action in action.0.action.as_ref().unwrap() {
|
for action in action.0.action.as_ref().unwrap() {
|
||||||
match &*action[0] {
|
match &*action[0] {
|
||||||
"mv" => {
|
"mv" => {
|
||||||
|
let uid = mail.id.to_imap();
|
||||||
println!(" moving to mailbox {}", action[1]);
|
println!(" moving to mailbox {}", action[1]);
|
||||||
imap_session.uid_mv(mail.id.uid.to_string(), &action[1])?;
|
// update flags
|
||||||
|
let flags = mail.get_flags();
|
||||||
|
let flags = maildir_flags_to_imap(&flags);
|
||||||
|
imap_session.uid_store(&uid, &format!("FLAGS.SILENT {}", imap_flags_to_cmd(&flags)))?;
|
||||||
|
imap_session.uid_mv(&uid, &action[1])?;
|
||||||
},
|
},
|
||||||
x => {
|
x => {
|
||||||
println!("WARNING: unknown action {:?}", x);
|
println!("WARNING: unknown action {:?}", x);
|
||||||
|
Loading…
Reference in New Issue
Block a user