mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
- introduce and test BccSelf config, to prevent bcc-self on outgoing mails
- introduce context.get_config_int() which respects default values declared in config.rs (Config)
This commit is contained in:
13
src/job.rs
13
src/job.rs
@@ -4,6 +4,7 @@ use deltachat_derive::{FromSql, ToSql};
|
||||
use rand::{thread_rng, Rng};
|
||||
|
||||
use crate::chat;
|
||||
use crate::config::Config;
|
||||
use crate::configure::*;
|
||||
use crate::constants::*;
|
||||
use crate::context::Context;
|
||||
@@ -666,11 +667,13 @@ pub fn job_send_msg(context: &Context, msg_id: u32) -> Result<(), Error> {
|
||||
mimefactory.msg.param.get_int(Param::GuranteeE2ee),
|
||||
);
|
||||
}
|
||||
if !vec_contains_lowercase(&mimefactory.recipients_addr, &mimefactory.from_addr) {
|
||||
mimefactory.recipients_names.push("".to_string());
|
||||
mimefactory
|
||||
.recipients_addr
|
||||
.push(mimefactory.from_addr.to_string());
|
||||
if context.get_config_bool(Config::BccSelf) {
|
||||
if !vec_contains_lowercase(&mimefactory.recipients_addr, &mimefactory.from_addr) {
|
||||
mimefactory.recipients_names.push("".to_string());
|
||||
mimefactory
|
||||
.recipients_addr
|
||||
.push(mimefactory.from_addr.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
if mimefactory.recipients_addr.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user