mirror of
https://github.com/soywod/himalaya.git
synced 2024-11-22 02:50:19 +00:00
plug option email-sending-save-copy
This commit is contained in:
parent
5da1148dc9
commit
5a2d842cbe
4 changed files with 16 additions and 9 deletions
|
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Added required IMAP option `imap-auth` and SMTP option `smtp-auth`. Possible values: `passwd`, `oauth2`.
|
||||
- Added OAuth 2.0 support for IMAP and SMTP.
|
||||
- Added passwords and OAuth 2.0 configuration via the wizard.
|
||||
- Added `email-sending-save-copy` option to control whenever a copy of any sent email should be saved in the `sent` folder defined in `folder-aliases`.
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -382,11 +382,13 @@ pub fn send<P: Printer>(
|
|||
};
|
||||
trace!("raw email: {:?}", raw_email);
|
||||
sender.send(raw_email.as_bytes())?;
|
||||
backend.add_email(
|
||||
&folder,
|
||||
raw_email.as_bytes(),
|
||||
&Flags::from_iter([Flag::Seen]),
|
||||
)?;
|
||||
if config.email_sending_save_copy {
|
||||
backend.add_email(
|
||||
&folder,
|
||||
raw_email.as_bytes(),
|
||||
&Flags::from_iter([Flag::Seen]),
|
||||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,9 @@ pub fn send<P: Printer>(
|
|||
.some_pgp_encrypt_cmd(config.email_writing_encrypt_cmd.clone()),
|
||||
)?;
|
||||
sender.send(&email)?;
|
||||
backend.add_email(folder, &email, &Flags::default())?;
|
||||
if config.email_sending_save_copy {
|
||||
backend.add_email(folder, &email, &Flags::default())?;
|
||||
}
|
||||
printer.print("Template successfully sent!")?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -79,9 +79,11 @@ pub fn edit_tpl_with_editor<P: Printer>(
|
|||
.some_pgp_encrypt_cmd(config.email_writing_encrypt_cmd.clone()),
|
||||
)?;
|
||||
sender.send(&email)?;
|
||||
let sent_folder = config.sent_folder_alias()?;
|
||||
printer.print_log(format!("Adding email to the {} folder…", sent_folder))?;
|
||||
backend.add_email(&sent_folder, &email, &Flags::from_iter([Flag::Seen]))?;
|
||||
if config.email_sending_save_copy {
|
||||
let sent_folder = config.sent_folder_alias()?;
|
||||
printer.print_log(format!("Adding email to the {} folder…", sent_folder))?;
|
||||
backend.add_email(&sent_folder, &email, &Flags::from_iter([Flag::Seen]))?;
|
||||
}
|
||||
remove_local_draft()?;
|
||||
printer.print("Done!")?;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue