emersion / hydroxide

A third-party, open-source ProtonMail CardDAV, IMAP and SMTP bridge
MIT License
1.57k stars 120 forks source link

Post request failed upon saving drafts with Thunderbird #174

Open Spoons opened 3 years ago

Spoons commented 3 years ago

Hey, this is a great project and I appreciate the work that has been put into it.

When Thunderbird attempts to save a message into the drafts folder, I observe the following output:

2021/05/02 21:28:24 CardDAV server listening on 127.0.0.1:3657
2021/05/02 21:28:24 IMAP server listening on 127.0.0.1:1143
2021/05/02 21:28:24 SMTP server listening on 127.0.0.1:1025
2021/05/02 21:28:37 User "username" logged in via IMAP
2021/05/02 21:28:37 Synchronizing mailbox Drafts...
2021/05/02 21:28:38 Synchronizing mailbox Drafts: done.
2021/05/02 21:28:38 request failed: POST https://mail.protonmail.com/api/messages: [2000] The Sender is required

I may be misunderstanding the intention of the output but the From and To fields are selected/filled respectively.

emersion commented 3 years ago

Yup, this is a hydroxide bug.

streaps commented 3 years ago

Is there an easy way to fix it?

faithanalog commented 2 years ago

having the same issue in Claws

as2875 commented 2 years ago

The problem seems to be that the message that is submitted in the POST request to the /messages endpoint has "Sender" set to null.

The problem appears to be in smtp/smtp.go in the function SendMail. Lines 65 onwards are where the MIME headers are parsed to generate the Sender field. The message is defined on line 120. I don't know enough Go to submit a patch but perhaps this will be useful for a fellow user.

Tommimon commented 6 months ago

The issue is still relevant in version 0.2.27

emersion commented 6 months ago

It's in maintenance mode. I only use the SMTP part of this project, and I try to review PRs that come in, but it's not on the top of my priority list.