summaryrefslogtreecommitdiffstats
path: root/src/components/mail/view.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-07-15 14:38:43 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-07-15 15:24:01 +0300
commit77dc1d74bf6fa65048d425997d295909ea269d10 (patch)
tree8606e8d59a60d0968a1730ef02ed500da1bbdb6b /src/components/mail/view.rs
parentddafde7b3794b255e846fa20ba6f00ca2ef4eeed (diff)
Add smtp client support for sending mail in UI
`mailer_command` was removed, and a new setting `send_mail` was added. Its possible values are a string, consisting of a shell command to execute, or settings to configure an smtp server connection. The configuration I used for testing this is: [composing] send_mail = { hostname = "smtp.mail.tld", port = 587, auth = { type = "auto", username = "yoshi", password = { type = "command_eval", value = "gpg2 --no-tty -q -d ~/.passwords/msmtp/yoshi.gpg" } }, security = { type = "STARTTLS" } } For local smtp server: [composing] send_mail = { hostname = "localhost", port = 25, auth = { type = "none" }, security = { type = "none" } }
Diffstat (limited to 'src/components/mail/view.rs')
-rw-r--r--src/components/mail/view.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/components/mail/view.rs b/src/components/mail/view.rs
index 8f8e670d..930c4c5f 100644
--- a/src/components/mail/view.rs
+++ b/src/components/mail/view.rs
@@ -1495,14 +1495,23 @@ impl Component for MailView {
* on its own */
drop(detect);
drop(envelope);
- return super::compose::send_draft(
+ if let Err(err) = super::compose::send_draft(
ToggleFlag::False,
context,
self.coordinates.0,
draft,
SpecialUsageMailbox::Sent,
Flag::SEEN,
- );
+ true,
+ ) {
+ context.replies.push_back(UIEvent::StatusEvent(
+ StatusEvent::DisplayMessage(format!(
+ "Couldn't send unsubscribe e-mail: {}",
+ err
+ )),
+ ));
+ }
+ return true;
}
}
list_management::ListAction::Url(url) => {