1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-05 10:39:27 +02:00

do not add SELF to To:, only to SMTP-recipient-list

This commit is contained in:
B. Petersen 2018-10-24 23:32:48 +02:00
parent 8412e2e45b
commit f082191f11
No known key found for this signature in database
GPG key ID: 3B88E92DEA8E9AFC
2 changed files with 13 additions and 3 deletions

View file

@ -285,8 +285,7 @@ static void dc_job_do_DC_JOB_SEND_MSG_TO_SMTP(dc_context_t* context, dc_job_t* j
}
}
/* send message - it's okay if there are no recipients, this is a group with only OURSELF; we only upload to IMAP in this case */
if (clist_count(mimefactory.recipients_addr) > 0)
/* send message */
{
if (!dc_mimefactory_render(&mimefactory)) {
dc_set_msg_failed(context, job->foreign_id, mimefactory.error);
@ -299,6 +298,12 @@ static void dc_job_do_DC_JOB_SEND_MSG_TO_SMTP(dc_context_t* context, dc_job_t* j
goto cleanup; /* unrecoverable */
}
/* add SELF to the recipient list (it's no longer used elsewhere, so a copy of the whole list is needless) */
if (clist_search_string_nocase(mimefactory.recipients_addr, mimefactory.from_addr)==0) {
clist_append(mimefactory.recipients_names, NULL);
clist_append(mimefactory.recipients_addr, (void*)dc_strdup(mimefactory.from_addr));
}
if (!dc_smtp_send_msg(context->smtp, mimefactory.recipients_addr, mimefactory.out->str, mimefactory.out->len)) {
if (MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION==context->smtp->error_etpan
|| MAILSMTP_ERROR_INSUFFICIENT_SYSTEM_STORAGE==context->smtp->error_etpan) {

View file

@ -126,9 +126,13 @@ int dc_mimefactory_load_msg(dc_mimefactory_t* factory, uint32_t msg_id)
factory->req_mdn = 0;
if (dc_chat_is_self_talk(factory->chat))
{
clist_append(factory->recipients_names, (void*)dc_strdup_keep_null(factory->from_displayname));
clist_append(factory->recipients_addr, (void*)dc_strdup(factory->from_addr));
}
else
{
stmt = dc_sqlite3_prepare(context->sql,
"SELECT c.authname, c.addr "
" FROM chats_contacts cc "
@ -168,6 +172,7 @@ int dc_mimefactory_load_msg(dc_mimefactory_t* factory, uint32_t msg_id)
&& dc_sqlite3_get_config_int(context->sql, "mdns_enabled", DC_MDNS_DEFAULT_ENABLED)) {
factory->req_mdn = 1;
}
}
/* Get a predecessor of the mail to send.
For simplicity, we use the last message send not by us.