ui: add two log entries

embed
Manos Pitsidianakis 2019-09-15 21:53:25 +03:00
parent 9e2bfa22b1
commit 5cf620f43c
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
2 changed files with 25 additions and 10 deletions

View File

@ -787,16 +787,30 @@ pub fn send_draft(context: &mut Context, account_cursor: usize, draft: Draft) ->
}
}
if !failure {
context.replies.push_back(UIEvent::Notification(
Some("Sent.".into()),
format!(
"Mailer output: {:#?}",
msmtp
.wait_with_output()
.expect("Failed to wait on filter")
.stdout
),
));
let output = msmtp.wait().expect("Failed to wait on mailer");
if output.success() {
context
.replies
.push_back(UIEvent::Notification(Some("Sent.".into()), String::new()));
} else {
if let Some(exit_code) = output.code() {
log(
format!(
"Could not send e-mail using `{}`: Process exited with {}",
cmd, exit_code
),
ERROR,
);
} else {
log(
format!(
"Could not send e-mail using `{}`: Process was killed by signal",
cmd
),
ERROR,
);
}
}
}
!failure
}

View File

@ -199,6 +199,7 @@ impl State {
})
.collect();
accounts.sort_by(|a, b| a.name().cmp(&b.name()));
log(format!("Initialized {} accounts.", accounts.len()), INFO);
let _stdout = std::io::stdout();
_stdout.lock();