# Emails generated with python smtplib do not show up reliably, also a feature suggestion

**URL:** <https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028>\
**Category:** Uncategorized\
**Created:** [February 24, 2022, 10:40pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028 "2022-02-24T22:40:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkd](https://forum.delta.chat/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@rkd](https://forum.delta.chat/u/rkd)\
**Post date:** [February 24, 2022, 10:40pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028/1 "2022-02-24T22:40:47Z")

</div>

Thanks for your work creating Delta Chat.

How does Delta Chat determine whether to show an email? I’ve been having trouble getting emails that I generated in python and sent to myself (that I can see in Thunderbird) to show up in Delta Chat. Are there required headers?

And the feature suggestion: What if Delta Chat had an option to show all emails in the imap folder, and the chat selection menu on the left grouped by contact like normal texting apps (is it trying to group by subject now?). And turn off the Accept/Reject feature, again to be similar to normal texting apps, just show everything. If I want to delete a conversation, delete on Delta Chat AND imap. Don’t store any meta data outside the imap inbox/sent folder. And don’t wait for new emails to come - display all emails that are there even before Delta Chat was installed. Just give it normal email client features, no more or less, but with the chat interface style. This would let you run a Delta Chat client on multiple devices (don’t know if you can do that now).

I’m using desktop Arch Linux AUR version

---

<div class="post-metadata">

**Author:** ![Simon](https://forum.delta.chat/user_avatar/forum.delta.chat/simon/32/287_2.png) [@Simon](https://forum.delta.chat/u/Simon)\
**Post date:** [February 25, 2022, 4:21pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028/2 "2022-02-25T16:21:21Z")

</div>

> [@rkd](#):
>
> How does Delta Chat determine whether to show an email?

In the settings you can select wether to only show “chat emails” or “all emails”.  
“Only chat emails” is the default, because there are people that want to use DeltaChat next to their normal email client with the same account.

> [@rkd](#):
>
> This would let you run a Delta Chat client on multiple devices (don’t know if you can do that now).

Backup import/export + BCC self option let you do that.

---

<div class="post-metadata">

**Author:** ![rkd](https://forum.delta.chat/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@rkd](https://forum.delta.chat/u/rkd)\
**Post date:** [February 25, 2022, 6:14pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028/3 "2022-02-25T18:14:59Z")

</div>

I just now uninstalled and reinstalled Delta Chat and sent two emails to myself. One showed up in Delta Chat and the other didn’t. I selected to show all classic emails. Is this a bug? During this time I also received two “non python generated” emails both of which showed up in Delta Chat on the left labeled “request”.

Details below. some information changed of course for privacy.

[5555555555@example.com](mailto:5555555555@example.com) and [4444444444@example.com](mailto:4444444444@example.com) are aliases (go to the same inbox / imap account) as [username@example.com](mailto:username@example.com). 5555555555 and 4444444444 are real phone numbers without any +1 or country code.

```auto
> sudo pacman -Rs deltachat
> rm -R deltachat-desktop
> git clone https://aur.archlinux.org/deltachat-desktop.git
> cd deltachat-desktop/
> sudo pacman -Syu

```

(restart computer)

```auto
> cd deltachat-desktop/
> makepkg -sirc

```

start Delta Chat  
(looks like account information didn’t get removed with reinstallation, so I now delete it)  
… → “Switch Accounts”  
delete [5555555555@example.com](mailto:5555555555@example.com)? → “DELETE ACCOUNT”  
“LOG IN TO YOUR SERVER”

E-Mail Address: [5555555555@example.com](mailto:5555555555@example.com)  
Password: password

IMAP Login Name: [username@example.com](mailto:username@example.com)  
IMAP Server: [mail.gandi.net](http://mail.gandi.net)  
IMAP Port: 993  
IMAP Security: SSL/TLS

SMTP Login Name: (blank - smtp server not secured)  
SMTP Password: (blank)  
SMTP Server: [example.com](http://example.com)  
SMTP Port: 8025  
SMTP Security: Off

Certificate Checks: Automatic

Use SOCKS5: (switched off)

“LOG IN”  
10 chats are showing up on the left (still didn’t delete data? is there a data folder/file/database I can try manually deleting)  
I have 65 messages in the DeltaChat folder in Thunderbird

… → Settings  
Show Classic E-Mails → All

Send an email (shows up in Thunderbird AND Delta chat)  
Send a response via Delta Chat  
Send another email ( **shows up in Thunderbird BUT NOT Delta chat** )

```auto
Return-Path: <4444444444@example.com>
Delivered-To: username@example.com
X-Envelope-To: 5555555555@example.com
Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [xxx.xx.xxx.xxx])
	by spool.mail.gandi.net (Postfix) with ESMTPS id E2158D8067D
	for <5555555555@example.com>; Fri, 25 Feb 2022 17:46:39 +0000 (UTC)
Received: (Authenticated sender: username@example.com)
	by mail.gandi.net (Postfix) with ESMTPSA id 9C899FF805
	for <5555555555@example.com>; Fri, 25 Feb 2022 17:46:39 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
From: 4444444444@example.com
To: 5555555555@example.com
X-GND-Status: LEGIT
Received-SPF: pass (spool5: domain of example.com designates xxx.xx.xxx.xxx as permitted sender) client-ip=xxx.xx.xxx.xxx; envelope-from=4444444444@example.com; helo=relay9-d.mail.gandi.net;
Authentication-Results: spool.mail.gandi.net;
	dkim=none;
	dmarc=none;
	spf=pass (spool.mail.gandi.net: domain of 4444444444@example.com designates xxx.xx.xxx.xxx as permitted sender) smtp.mailfrom=4444444444@example.com

Test email

```

```auto
Return-Path: <4444444444@example.com>
Delivered-To: username@example.com
X-Envelope-To: 5555555555@example.com
Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [xxx.xx.xxx.xxx])
	by spool.mail.gandi.net (Postfix) with ESMTPS id 8EAB5740039
	for <5555555555@example.com>; Fri, 25 Feb 2022 17:48:14 +0000 (UTC)
Received: (Authenticated sender: username@example.com)
	by mail.gandi.net (Postfix) with ESMTPSA id 56BA7FF807
	for <5555555555@example.com>; Fri, 25 Feb 2022 17:48:14 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
From: 4444444444@example.com
To: 5555555555@example.com
X-GND-Status: LEGIT
Received-SPF: pass (spool2: domain of example.com designates xxx.xx.xxx.xxx as permitted sender) client-ip=xxx.xx.xxx.xxx; envelope-from=4444444444@example.com; helo=relay9-d.mail.gandi.net;
Authentication-Results: spool.mail.gandi.net;
	dkim=none;
	spf=pass (spool.mail.gandi.net: domain of 4444444444@example.com designates xxx.xx.xxx.xxx as permitted sender) smtp.mailfrom=4444444444@example.com;
	dmarc=none

Another test email

```

Edit: at one time I had the account [4444444444@example.com](mailto:4444444444@example.com) set up on Delta Chat. Although that account has been deleted, maybe that data is still sitting around that might contribute to the intermittent behavior?

---

<div class="post-metadata">

**Author:** ![rkd](https://forum.delta.chat/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@rkd](https://forum.delta.chat/u/rkd)\
**Post date:** [February 25, 2022, 6:32pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028/4 "2022-02-25T18:32:14Z")

</div>

> [@Simon](#):
>
> Backup import/export + BCC self option let you do that.

Thanks for tip, I may try in the future. I still recommend my suggestions of not using meta data and just using imap data, and removing the accept/reject feature, although I admit less intimate knowledge regarding your codebase and what you’re trying to do.

> [@Simon](#):
>
> because there are people that want to use DeltaChat next to their normal email client with the same account.

They could still do this. If they didn’t want normal emails and Delta Chat emails to mix:

- the user can create a separate imap folder (like the DeltaChat folder)
- add an interface option on Delta Chat to select the current imap folder (inbox/sent/DeltaChat/Work/whatever). The chats available on the left will adjust to show **all** the messages in the folder.
- have Delta Chat detect (based on sender, thread/subject, headers, preferably not meta data) if a new email in the inbox is a continuation of an existing chat and move to the appropriate folder.

---

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [February 26, 2022, 6:53pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028/5 "2022-02-26T18:53:23Z")

</div>

The fact that Delta Chat treats second message without `Message-ID` as a duplicate and deletes it is a known bug:

> <https://github.com/deltachat/deltachat-core-rust/issues/3094>
>
> \<!--
> This is a bug report tracker. New features are discussed in the forum: htt…ps://support.delta.chat
> Please fill out as much of this form as you can (leaving out stuff that is not applicable is ok).
> \--\>
> 
> \- Operating System (Linux/Mac/Windows/iOS/Android): Android 11
> \- Delta Chat Version: 1.28.1-fat
> \- Expected behavior: When I receive e-mails on Delta Chat they should not be deleted from the server, for no apparent reason.
> \- Actual behavior: Some e-mails are deleted for no apparent reason.
> \- Steps to reproduce the problem: I don't know how to reproduce it. All I know is that it's some e-mails sent by the bank 😅
> \- Screenshots:
> \- Logs: 
> \[deltachat-log-20220224-123543.txt\](https://github.com/deltachat/deltachat-core-rust/files/8132458/deltachat-log-20220224-123543.txt)

Anyway, it’s a good idea to always add an unique `Message-ID` to your messages. Your message `SHOULD` (according to [RFC 5322 - Internet Message Format](https://datatracker.ietf.org/doc/html/rfc5322#section-3.6.4)) have an unique `Message-ID` header. Without this header it is impossible to reliably detect duplicates and impossible to reply to mails.

---

<div class="post-metadata">

**Author:** ![rkd](https://forum.delta.chat/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@rkd](https://forum.delta.chat/u/rkd)\
**Post date:** [February 26, 2022, 9:14pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028/6 "2022-02-26T21:14:18Z")

</div>

> [@link2xt](#):
>
> The fact that Delta Chat treats second message without `Message-ID` as a duplicate and deletes it is a known bug:

Did not know about this header and its importance. Thanks! works now

---

<div class="post-metadata">

**Author:** ![r10s](https://forum.delta.chat/user_avatar/forum.delta.chat/r10s/32/1513_2.png) [@r10s](https://forum.delta.chat/u/r10s)\
**Post date:** [October 6, 2026, 3:04pm UTC](https://forum.delta.chat/t/emails-generated-with-python-smtplib-do-not-show-up-reliably-also-a-feature-suggestion/2028/7 "2026-10-06T15:04:26Z")

</div>


