diff --git a/src/contact.rs b/src/contact.rs
index 08174f9e0..679ac6a4a 100644
--- a/src/contact.rs
+++ b/src/contact.rs
@@ -501,14 +501,12 @@ pub enum Origin {
MailinglistAddress = 0x2,
/// Hidden on purpose, e.g. addresses with the word "noreply" in it
+ /// or past members of the groups.
Hidden = 0x8,
/// From: of incoming messages of unknown sender
IncomingUnknownFrom = 0x10,
- /// Cc: of incoming messages of unknown sender
- IncomingUnknownCc = 0x20,
-
/// To: of incoming messages of unknown sender
IncomingUnknownTo = 0x40,
@@ -522,21 +520,9 @@ pub enum Origin {
/// Contacts with at least this origin value are shown in the contact list.
IncomingReplyTo = 0x100,
- /// Cc: of incoming message of known sender
- IncomingCc = 0x200,
-
- /// additional To:'s of incoming message of known sender
- IncomingTo = 0x400,
-
/// a chat was manually created for this user, but no message yet sent
CreateChat = 0x800,
- /// message sent by us
- OutgoingBcc = 0x1000,
-
- /// message sent by us
- OutgoingCc = 0x2000,
-
/// message sent by us
OutgoingTo = 0x4000,
diff --git a/src/imap.rs b/src/imap.rs
index 1462f5c6b..fc06a1e82 100644
--- a/src/imap.rs
+++ b/src/imap.rs
@@ -1885,20 +1885,19 @@ async fn should_move_out_of_spam(
None => return Ok(false),
};
// No chat found.
- let (from_id, blocked_contact, _origin) =
- match from_field_to_contact_id(context, &from, true)
- .await
- .context("from_field_to_contact_id")?
- {
- Some(res) => res,
- None => {
- warn!(
- context,
- "Contact with From address {:?} cannot exist, not moving out of spam", from
- );
- return Ok(false);
- }
- };
+ let (from_id, blocked_contact) = match from_field_to_contact_id(context, &from, true)
+ .await
+ .context("from_field_to_contact_id")?
+ {
+ Some(res) => res,
+ None => {
+ warn!(
+ context,
+ "Contact with From address {:?} cannot exist, not moving out of spam", from
+ );
+ return Ok(false);
+ }
+ };
if blocked_contact {
// Contact is blocked, leave the message in spam.
return Ok(false);
@@ -2243,11 +2242,10 @@ pub(crate) async fn prefetch_should_download(
Some(f) => f,
None => return Ok(false),
};
- let (_from_id, blocked_contact, _origin) =
- match from_field_to_contact_id(context, &from, true).await? {
- Some(res) => res,
- None => return Ok(false),
- };
+ let (_from_id, blocked_contact) = match from_field_to_contact_id(context, &from, true).await? {
+ Some(res) => res,
+ None => return Ok(false),
+ };
// prevent_rename=true as this might be a mailing list message and in this case it would be bad if we rename the contact.
// (prevent_rename is the last argument of from_field_to_contact_id())
diff --git a/src/receive_imf.rs b/src/receive_imf.rs
index efbe30d73..3a0d01095 100644
--- a/src/receive_imf.rs
+++ b/src/receive_imf.rs
@@ -322,7 +322,7 @@ pub(crate) async fn receive_imf_inner(
// For example, GitHub sends messages from `notifications@github.com`,
// but uses display name of the user whose action generated the notification
// as the display name.
- let (from_id, _from_id_blocked, incoming_origin) =
+ let (from_id, _from_id_blocked) =
match from_field_to_contact_id(context, &mime_parser.from, prevent_rename).await? {
Some(contact_id_res) => contact_id_res,
None => {
@@ -337,12 +337,10 @@ pub(crate) async fn receive_imf_inner(
let to_ids = add_or_lookup_contacts_by_address_list(
context,
&mime_parser.recipients,
- if !mime_parser.incoming {
- Origin::OutgoingTo
- } else if incoming_origin.is_known() {
- Origin::IncomingTo
- } else {
+ if mime_parser.incoming {
Origin::IncomingUnknownTo
+ } else {
+ Origin::OutgoingTo
},
)
.await?;
@@ -646,7 +644,7 @@ pub(crate) async fn receive_imf_inner(
/// Converts "From" field to contact id.
///
-/// Also returns whether it is blocked or not and its origin.
+/// Also returns whether it is blocked or not.
///
/// * `prevent_rename`: if true, the display_name of this contact will not be changed. Useful for
/// mailing lists: In some mailing lists, many users write from the same address but with different
@@ -658,7 +656,7 @@ pub async fn from_field_to_contact_id(
context: &Context,
from: &SingleInfo,
prevent_rename: bool,
-) -> Result