Skip to content

Do not add messages into smtp queue if the only recipient is self and bcc_self is off or deletion is set to immediate #6661

@link2xt

Description

@link2xt

Since change
#5190
even if delete_server_after is immediate, we send a message to self when bcc_self is enabled. However, we should not send any messages over SMTP if delete_server_after is immediate and the only recipient is self, e.g. in Saved messages chat or in a group with only self.

Current code is here:

core/src/chat.rs

Lines 3020 to 3038 in 82f6103

// Send BCC to self if it is enabled.
//
// Previous versions of Delta Chat did not send BCC self
// if DeleteServerAfter was set to immediately delete messages
// from the server. This is not the case anymore
// because BCC-self messages are also used to detect
// that message was sent if SMTP server is slow to respond
// and connection is frequently lost
// before receiving status line. NB: This is not a problem for chatmail servers, so `BccSelf`
// disabled by default is fine.
//
// `from` must be the last addr, see `receive_imf_inner()` why.
if context.get_config_bool(Config::BccSelf).await?
&& !recipients
.iter()
.any(|x| x.to_lowercase() == lowercase_from)
{
recipients.push(from);
}

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions