deltachat / deltachat-core

Delta.Chat C-Library with e2e chat-over-email functionality & Python bindings
https://c.delta.chat
Other
304 stars 27 forks source link

"Stream error" during SMTP-SSL connection #605

Open link2xt opened 5 years ago

link2xt commented 5 years ago

I am running deltachat-fat-debug-0.101.0.apk on Android, but the issue seems to be in deltachat-core.

I have an SMTP server that only accepts SSL/TLS on port 465, but not port 587. When trying to connect, I get error "SMTP-Socket connection to SERVER_REDACTED:587 failed (Connection refused)". This error is irrelevant due to the bug https://github.com/deltachat/deltachat-core/issues/594

Attaching adb to DeltaChat, I get the following log:

I DeltaChat: Configure ...
I DeltaChat: Trying: LOGIN_REDACTED LOGIN_REDACTED:***:SERVER_REDACTED:993 LOGIN_REDACTED:***:SERVER_REDACTED:465 AUTH_NORMAL IMAP_SSL SMTP_SSL
I DeltaChat: IMAP-server SERVER_REDACTED:993 SSL-connected.
E DeltaChat: SMTP-SSL connection to SERVER_REDACTED:465 failed (Stream error)
I DeltaChat: Trying: LOGIN_REDACTED LOGIN_REDACTED:***:SERVER_REDACTED:993 LOGIN_REDACTED:***:SERVER_REDACTED:587 AUTH_NORMAL IMAP_SSL SMTP_STARTTLS
E DeltaChat: SMTP-Socket connection to SERVER_REDACTED:587 failed (Connection refused)
I DeltaChat: IMAP disconnected.

I can trace this "Stream error" down to https://github.com/deltachat/deltachat-core/blob/dddae8beccb41d37cebb773f687f25f96e08c33e/libs/libetpan/src/low-level/smtp/mailsmtp.c#L1202 but there is no context available on where exactly this MAILSMTP_ERROR_STREAM is returned.

link2xt commented 5 years ago

If deltachat is going to move to deltachat-core-rust, I may just stop caring about this since libetpan is going away: https://github.com/deltachat/deltachat-core-rust/commit/83917ef93e9d2e829e201ab51ba4e47450589af3#diff-a7b0a2dee0126cddf994326e705a91ea

(or not, looks like mmime is a c2rust translation of libetpan)

r10s commented 5 years ago

yip, i would not put much effort into this and see how deltachat-core-rust behaves.

mmime is only used for mime-parsing, there is no network involved in this part. the imap- and smtp-parts of libetpan are going to be rewritten in pure-rust, resp. this is already done :)

link2xt commented 5 years ago

Everything works on 0.500.0, closing this.

link2xt commented 5 years ago

Reopening. The interface works, but nothing is actually sent/received. After some timeout, I get errors on the screen, both for SMTP and IMAP.

Waiting for Rust version, then. I have been able to receive a message sent from example REPL with an ordinary MUA.