mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
check From: address without creating/altering a contact-record if it is not SELF
This commit is contained in:
@@ -17,8 +17,8 @@ use num_traits::FromPrimitive;
|
|||||||
use crate::chat;
|
use crate::chat;
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::constants::{
|
use crate::constants::{
|
||||||
Chattype, ShowEmails, Viewtype, DC_CONTACT_ID_SELF, DC_FETCH_EXISTING_MSGS_COUNT,
|
Chattype, ShowEmails, Viewtype, DC_FETCH_EXISTING_MSGS_COUNT, DC_FOLDERS_CONFIGURED_VERSION,
|
||||||
DC_FOLDERS_CONFIGURED_VERSION, DC_LP_AUTH_OAUTH2,
|
DC_LP_AUTH_OAUTH2,
|
||||||
};
|
};
|
||||||
use crate::context::Context;
|
use crate::context::Context;
|
||||||
use crate::dc_receive_imf::{
|
use crate::dc_receive_imf::{
|
||||||
@@ -768,17 +768,12 @@ impl Imap {
|
|||||||
let msg = fetch?;
|
let msg = fetch?;
|
||||||
match get_fetch_headers(&msg) {
|
match get_fetch_headers(&msg) {
|
||||||
Ok(headers) => {
|
Ok(headers) => {
|
||||||
let (from_id, _, _) = from_field_to_contact_id(
|
if let Some(from) = mimeparser::get_from(&headers).first() {
|
||||||
context,
|
if context.is_self_addr(&from.addr).await? {
|
||||||
&mimeparser::get_from(&headers),
|
result.extend(mimeparser::get_recipients(&headers));
|
||||||
false,
|
}
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
if from_id == DC_CONTACT_ID_SELF {
|
|
||||||
result.extend(mimeparser::get_recipients(&headers));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
warn!(context, "{}", err);
|
warn!(context, "{}", err);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user