emersion / hydroxide

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

Inline images get stripped from multipart/alternative emails #191

Closed Marcool04 closed 2 years ago

Marcool04 commented 3 years ago

Hi there,

It appears hydroxide somehow truncates images placed in multipart/alternative emails, under the multipart/related, this happens for instance when using HTML to compose an email in Thunderbird, selecting the image insertion dropdown, then "Image", selecting a file and ticking "attach image to the message".

My guess is it is happening somewhere in the few lines after this : https://github.com/emersion/hydroxide/blob/b122ca8a1f0fe1203d58b99c716f282de4a4a3df/smtp/smtp.go#L192 when the SMTP data gets converted into internal structures, since in the log, the POST data looks good, but the uploaded "Draft" email already has the image missing, right after. Possibly something to do with this line? https://github.com/emersion/hydroxide/blob/b122ca8a1f0fe1203d58b99c716f282de4a4a3df/smtp/smtp.go#L240

$ /Users/mark/Software/hydroxide/hydroxide -debug serve
2021/08/18 18:10:45 CardDAV server listening on 127.0.0.1:8080
2021/08/18 18:10:45 IMAP server listening on 127.0.0.1:1143
2021/08/18 18:10:45 SMTP server listening on 127.0.0.1:1025
220 localhost ESMTP Service Ready
EHLO [127.0.0.1]
250-Hello [127.0.0.1]
250-PIPELINING
250-8BITMIME
250-ENHANCEDSTATUSCODES
250-CHUNKING
250-AUTH PLAIN
250 SIZE
AUTH PLAIN REDACTED_AUTH_HASH
2021/08/18 18:11:29 >> POST /api/auth/refresh
2021/08/18 18:11:29 {"RefreshToken":"REDACTED_TOKEN","ResponseType":"token","GrantType":"refresh_token","RedirectURI":"http://www.protonmail.ch"}
2021/08/18 18:11:30 << POST /api/auth/refresh
2021/08/18 18:11:30 &protonmail.authResp{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Auth:protonmail.Auth{ExpiresAt:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}, Scope:"full self payments keys parent user loggedin nondelinquent mail calendar", UID:"REDACTED_UID", AccessToken:"REDACTED_TOKEN", RefreshToken:"REDACTED_TOKEN", UserID:"", EventID:"", PasswordMode:0, TwoFactor:struct { Enabled int; U2F interface {}; TOTP int }{Enabled:0, U2F:interface {}(nil), TOTP:0}}, ExpiresIn:864000, TokenType:"Bearer", ServerProof:""}
2021/08/18 18:11:30 >> GET /api/addresses
2021/08/18 18:11:30 << GET /api/addresses
2021/08/18 18:11:30 &struct { protonmail.resp; Addresses []*protonmail.Address }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Addresses:[]*protonmail.Address{(*protonmail.Address)(0xc000262280), (*protonmail.Address)(0xc000262320), (*protonmail.Address)(0xc0002623c0)}}
2021/08/18 18:11:31 >> GET /api/users
2021/08/18 18:11:31 << GET /api/users
2021/08/18 18:11:31 &struct { protonmail.resp; User *protonmail.User }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, User:(*protonmail.User)(0xc0002d03f0)}
2021/08/18 18:11:31 >> GET /api/addresses
2021/08/18 18:11:31 << GET /api/addresses
2021/08/18 18:11:31 &struct { protonmail.resp; Addresses []*protonmail.Address }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Addresses:[]*protonmail.Address{(*protonmail.Address)(0xc000114dc0), (*protonmail.Address)(0xc000114f00), (*protonmail.Address)(0xc000114fa0)}}
2021/08/18 18:11:31 REDACTED_SENDER_EMAIL logged in
235 2.0.0 Authentication succeeded
MAIL FROM:<REDACTED_SENDER_EMAIL> BODY=8BITMIME SIZE=2619
250 2.0.0 Roger, accepting mail from <REDACTED_SENDER_EMAIL>
RCPT TO:<REDACTED_DEST_EMAIL>
250 2.0.0 I'll make sure <REDACTED_DEST_EMAIL> gets this
DATA
354 2.0.0 Go ahead. End your data with <CR><LF>.<CR><LF>
To: "REDACTED_DEST_EMAIL" <REDACTED_DEST_EMAIL>
From: Mark Collins <REDACTED_SENDER_EMAIL>
Message-ID: <3978d4fc-a594-9dca-7a47-ae21aabc5d4a@protonmail.com>
Date: Wed, 18 Aug 2021 18:11:29 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
 Gecko/20100101 Thunderbird/78.13.0
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------A42800B4B1A2192FE87A9ACA"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------A42800B4B1A2192FE87A9ACA
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

image

--------------A42800B4B1A2192FE87A9ACA
Content-Type: multipart/related;
 boundary="------------38B018168954AF09B0DB8602"

--------------38B018168954AF09B0DB8602
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <img moz-do-not-send="false"
      src="cid:part1.27F789DB.7284EACC@protonmail.com" alt="image"
      width="256" height="256"><br>
  </body>
</html>

--------------38B018168954AF09B0DB8602
Content-Type: image/gif;
 name="img.gif"
Content-Transfer-Encoding: base64
Content-ID: <part1.27F789DB.7284EACC@protonmail.com>
Content-Disposition: inline;
 filename="img.gif"

R0lGODlhAAEAAYAAAPz+/P7//yH5BAEAAAEALAAAAAAAAQABAAL+jI+py+0Po5y02ouzTqD7
D4biSJbmiabqyrbuC8dGTNf2jef6/s78DwwKh0SVr4hMKpdM0rEJjUqnsCf1is1Ordqu98vj
gsfkckpsTqvN6LX7jW3D53SlvI7PhwP6vv939yc4eBJIeIjYYZjI+LfYCIn3GEn5NlmJycaX
yZl32Qma9RlKKjVairp0mspKtNoKC7gZS2s6W4urepvL67rbCywbPAz0SnwsYoy8rPjL/Gzk
DD1dokwdbH3dm62dy91d+w0eKz7eWm6eip5eus4e6v7eGS+fSV9feY8fqb/f2O8vEcCAhwYS
HGTwoCNpCrcxbOjtIcRwEieSq2jxHMb+jOo2cmzn8SO8kCLnkSxp7yTKfCpX8mvp8h/MmAJn
0ixo8ybCnDoX9mSV8OeXoEK7EC0qiifSOkeXUmnq1FZUk1M5Qa3K5CpWO0q3ptHqtQjYsEPG
kg1i9qwwtTXZtnWLE25cuTvp1rXrE6+ftHpldO0rFbCnv4Kb8C3M4jDiaIvpKG5ciDBksZIn
l61sGS3mzGs5a/L8dTPoHI9HeyhtGgBq06tHtwb92nNszrMz17Z8e3JuyLsb9178G3HwwsMF
Fwd8vG9yvcvxNrf7nG50udPhVnd7nW12tdvPdif7PWx4r+O3lsd6vmr6qeujtnf6fml8pPOL
1hd6/2f+nvv+dfa/+R9NAcY0oEsFrnQgSgmWtKBIDX70IEcRZjShRRVOdCFEGTa0oUIdHvQh
QSEGNKI/Je5zIj4p1rOiPC2+8yI7MaYzozk1jnMjODl2s6M2PV7zIzVBTjMkNEU+cyQzSS6z
JDJNHvMkMVEOMyU2oqVWQ5XAaOkQlmBwyQuYEXk51JVk9mDmmS2IiQubFKmphZu0yHkRnEnZ
GUeaeKJAJyx9arTnU3oGWs2ghI7wJ1CGHhpCoh0xCoWjqEgKEqSGLWppM5nqsilXnSZBKSmh
jvQpEqOCcipVpfqyKqutCpGqVZhmGmtKr8I6q6W1YrIrS7dq9msxuULaKyXFvhQabGfJkjYs
o8dC8qxMG0xLbbXWXottttpCUAAAOw==
--------------38B018168954AF09B0DB8602--

--------------A42800B4B1A2192FE87A9ACA--
.
2021/08/18 18:11:31 creating draft message
2021/08/18 18:11:31 >> POST /api/messages
2021/08/18 18:11:31 {"Message":{"ID":"","Order":0,"ConversationID":"","Subject":"","Unread":0,"Type":0,"Sender":{"Address":"REDACTED_SENDER_EMAIL","Name":"Mark Collins"},"ToList":[{"Address":"REDACTED_DEST_EMAIL","Name":"REDACTED_DEST_EMAIL"}],"Time":0,"Size":0,"NumAttachments":0,"IsEncrypted":0,"ExpirationTime":0,"IsReplied":0,"IsRepliedAll":0,"IsForwarded":0,"SpamScore":0,"AddressID":"sQNAv7kIQ0Y4ew4icDdV_3_jiCERWGRvpri0OSdJnyKnwGMy5P3dBIrGiJCrm9Upsi0gg8spLdpbXmf6-3ytRQ==","Body":"-----BEGIN PGP MESSAGE-----\n\nwcBMA+auHLVtWhBjAQf+O+ukYw9RTfWLSsarxcsHkh4hRf+dC3zhUzh9QNcN2vcW\njGqrWSOEYPHk/l9a7MKS/Kw0ytlrU35MiiMpTEVCAW0F+p0EJvPS4wsUS09FQX8z\nCnEGDlkmUMIfrt+nqf3KCOwSnkqkX0YVL6uy8pA7vsgfjkd9Yrn5IHWX5Hg22B5h\nNI2NyP9iFf/hvEY/tshyat4uXyd+Vc516VLTrHKurCrM0sd22bto7VupCmpNp/Un\nhkcDTl0pNF9z2AfJbXyPzNePOpQ7xAmKJYNHtjNUKF+E4qX073uJl6mK8E8oqg8C\nYJpnBUcOsVS4jc2UiC3re4JUfUWOmY8Zr2gznhq0xNLAtgH1XL60Mlmka7TA8Aa8\nRoN2Gp41fYiF66Sgc7O97xZneuCK5h4SsFHk70YwpID34U+NGgs27cA5cKZegvWu\n8TpdyogP84jqRtvUtMA8gEu82j03V3kRMXnV/WCxKT9eNIwX/uN3MN3iQCIKzHe/\noyJPJRq/G/1NsFXNq+MK88ZXDPQ/oOuWhIgSPsjWtKGEpqA8Z7Q0+5Nesg74tfaR\nMxKM7wm0BNyj2pqv0oeWTe7hbiGIcDLQDfq7GZSagBsmZ9eNS33TVuncCMGkbOrE\nfmVvH2XNid8jBJtrAhyj/LaJ/JTpE+PCWcMT8bLh115Bsy25bBcOamSjryYMFxBD\nfak8rgdrtpmaEcZ0S6vTJtsbuDVTzFAzMDFSc0uh7F6u7d0G9puVug13m1NdlaCt\npAnxGWLytj/JB4Evn+ZZogf5YPHkTdZ2/9nvjIb5sQcAwL3KLiNPIdeO9ME0mkv1\nLJS8cAy4EKfgQyo+TyqDo0k91tmIrWI8\n=7uHt\n-----END PGP MESSAGE-----","CCList":[],"BCCList":[],"ReplyTos":null,"Header":"To: \"REDACTED_DEST_EMAIL\" \u003cREDACTED_DEST_EMAIL\u003e\r\nFrom: Mark Collins \u003cREDACTED_SENDER_EMAIL\u003e\r\nMessage-Id: \u003c3978d4fc-a594-9dca-7a47-ae21aabc5d4a@protonmail.com\u003e\r\nDate: Wed, 18 Aug 2021 18:11:29 +0200\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0\r\nMime-Version: 1.0\r\nContent-Type: multipart/alternative; boundary=\"------------A42800B4B1A2192FE87A9ACA\"\r\nContent-Language: en-US\r\n","Attachments":null,"LabelIDs":null,"ExternalID":""}}
2021/08/18 18:11:31 << POST /api/messages
2021/08/18 18:11:31 &struct { protonmail.resp; Message *protonmail.Message }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Message:(*protonmail.Message)(0xc00019e780)}
2021/08/18 18:11:31 uploading message body
2021/08/18 18:11:31 >> PUT /api/messages/EAKMxll1TMBXzWNEmIvoX25f6m2cUe5ks7XgMxYE50TLmGtsXr3osYxnkhSc3HZm4pXIW0NDrdicRqCBqgs8Tw==
2021/08/18 18:11:31 {"Message":{"ID":"EAKMxll1TMBXzWNEmIvoX25f6m2cUe5ks7XgMxYE50TLmGtsXr3osYxnkhSc3HZm4pXIW0NDrdicRqCBqgs8Tw==","Order":3488012052,"ConversationID":"vEs9OwqBEBhssbUN8aCjY3CD7TMoGHGe1w_fFF6ACCMs4eURwueACVFOToXdK8o7qBiy3U5WI6SYL4sjCxSGLA==","Subject":"(No Subject)","Unread":0,"Type":1,"Sender":{"Address":"REDACTED_SENDER_EMAIL","Name":"Mark Collins"},"ToList":[{"Address":"REDACTED_DEST_EMAIL","Name":"REDACTED_DEST_EMAIL"}],"Time":1629303091,"Size":377,"NumAttachments":0,"IsEncrypted":5,"ExpirationTime":0,"IsReplied":0,"IsRepliedAll":0,"IsForwarded":0,"SpamScore":0,"AddressID":"sQNAv7kIQ0Y4ew4icDdV_3_jiCERWGRvpri0OSdJnyKnwGMy5P3dBIrGiJCrm9Upsi0gg8spLdpbXmf6-3ytRQ==","Body":"-----BEGIN PGP MESSAGE-----\n\nwcBMA+auHLVtWhBjAQgAoIA5B9YMtjxlWqmK6OA26Do5Hb+EolFfzAp0GL2utJLe\nGS5hbgNPYIufgi5V2FjWVeI2YU2yhefsdqvmQMchOvf3RTJ6FioFLSvZ/SpkdO8x\n+LVa5rUCyjj599B/UwUzud6zCMFPWar+kRJ7rNtPFmNdPaJ/5lpi49o9TzJKnD52\n677QoRdFGUfuiCv75LDudD7R6r84kisvooyoduAtUAmLH4T1oN8bz4f6XBQQLe6H\nm5ZYT8Ryi+oCWvnMjlQ3IEPOTJZhky9JjT5Vq9HwAgKeuVD9uKCM3HnhbDzQq4Ye\naelpZDpj9hDNOO1j8atLXTTFwITRdKsiB6dHhE4q/NLpAUrI3RnS7ppgjuJbJ1oq\nD0yjt9Ysz1+sIgQr9lIaPT/21mWVuE2nvhnvGbe9mVK6OcYII+jvzVzzSzwzLjEU\nPjIuBJdjZihYYDy1vT+ZFAtQt8x/JIdeZeOkUQ2xOewteo/eD5SO7JLSRSsM/EyG\nzqsQuynClMXI+6ypDZestYWlIyQQE3cg10uMXSjVCph5zq/AXKh+JYoNBhaBq7xd\nNOT09uk9zp9EbwPD5hrrPlNT0CPSe3Lqdev8YKTLWhFuWgvZ6i5NCrcYoLmSwPmw\nf8futkGUnMnHJu/1jgeecF4GooKBOUQtIWshVRPAzpIkxGZryfO9i3MzqnavesmU\nDX0MH0xl0k8g3xDdHCSjZZwTShwH7+sa032I4qRat0NlWOaXB1HmQ1C9YFRuL0oL\nGY7BXqYkeci0mobhTf+hViTJ5Qn7feyDs8QOvSp4H8tqmgV9nVnwQY7Qmy2ahhr+\n6UP8r/RedUx1YR9fXI+ThxvdYn7hfBYxRS3425pJu2l7ey6rhOm+O1CT6P1IatzE\nkKi9eXJ7MX3sFpZyr7tET6HwOMCLqEh0qqd+GIiaw+2aUlLVMGqHS+m43X3WzrK1\nzfQXXNwhwOxVQmG8Q+K3o1nP1KvbclQq1vxhCpGtyEnlVP5QTyd2S6GMRh1tDkqR\nM5KxHSByyM13bzRhBqRSzFeI2AzEAogYY4CaS9nbPtM6rQQpzaB/q/L7i6I4Hze4\nkjZuO3aTsgIryRoG64IF1I/wBPamjsz1Y8YBis4ZzM1+RTAfiFJLbY85vtvhL1la\nLKaf07nXqmF4sfjrI/az2PjIJhjzsyWDmV4mXB/DuBNTgSOHFWS5SwhC9HW104o1\nnpQ333fl8MPLcQ==\n=AylN\n-----END PGP MESSAGE-----","MIMEType":"text/html","CCList":[],"BCCList":[],"ReplyTos":[{"Address":"REDACTED_SENDER_EMAIL","Name":"Mark Collins"}],"Header":"X-Pm-Origin: internal\r\nX-Pm-Content-Encryption: end-to-end\r\nSubject: (No Subject)\r\nTo: REDACTED_DEST_EMAIL \u003cREDACTED_DEST_EMAIL\u003e\r\nFrom: Mark Collins \u003cREDACTED_SENDER_EMAIL\u003e\r\nDate: Wed, 18 Aug 2021 16:11:31 +0000\r\nMime-Version: 1.0\r\nContent-Type: text/html\r\n","Attachments":[],"LabelIDs":["1","5","8"],"ExternalID":""}}
2021/08/18 18:11:31 << PUT /api/messages/EAKMxll1TMBXzWNEmIvoX25f6m2cUe5ks7XgMxYE50TLmGtsXr3osYxnkhSc3HZm4pXIW0NDrdicRqCBqgs8Tw==
2021/08/18 18:11:31 &struct { protonmail.resp; Message *protonmail.Message }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Message:(*protonmail.Message)(0xc000256a80)}
2021/08/18 18:11:31 >> GET /api/keys
2021/08/18 18:11:32 << GET /api/keys
2021/08/18 18:11:32 &struct { protonmail.resp; *protonmail.PublicKeyResp }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, PublicKeyResp:(*protonmail.PublicKeyResp)(0xc000228900)}
2021/08/18 18:11:32 sending message
2021/08/18 18:11:32 >> POST /api/messages/EAKMxll1TMBXzWNEmIvoX25f6m2cUe5ks7XgMxYE50TLmGtsXr3osYxnkhSc3HZm4pXIW0NDrdicRqCBqgs8Tw==
2021/08/18 18:11:32 {"ID":"EAKMxll1TMBXzWNEmIvoX25f6m2cUe5ks7XgMxYE50TLmGtsXr3osYxnkhSc3HZm4pXIW0NDrdicRqCBqgs8Tw==","ExpirationTime":0,"Packages":[{"Type":4,"Addresses":{"REDACTED_DEST_EMAIL":{"Type":4,"BodyKeyPacket":"","AttachmentKeyPackets":null,"Signature":0,"PasswordHint":"","Auth":null,"Token":"","EncToken":""}},"MIMEType":"text/html","Body":"0ukBY/E93OZcqaXeL+ufQ5CHhL/hQenwO+ypn1yky27Ga0rW774nXh8/91D1KFnxJfuQxTdZEOzHUpbO7B/RbtiIeYqMAWIZetMdae0AXHRXsoOM146RRzGa3lYsexPyWMz7qx12l5Z/J6Sc0o2dRGXAzfERvZZDgAYuoWJBlF+JsnJq0k8Jp6DWPU+cSB7hsa9G2/bbzEj7/jYOw+/bmIdkb2czG9+sWkHgeJIwEsc1bKTouDcD2CQupO0b2P+nG0r/rifXe8lG6Gxg7PUPfTh26YfN298UA3qedML88waavEi2ItP7crI2w9j5ZoJWXrmIPeBGD16OxwhZqWoYZIk7OAyolaN+qDWXAX/Ufop/uxQcG4FVsMufuLhMdQgwcZRKEW/J4sgIVm/TE+/lHN4VRxSw3s7pW4NRcS+/yEItu1Wh1u4UdtadFwru/Lp5lQe94HlXarywI077pmPpOPu4Ja1AsL17ZJNkDokrHGU5nja+VBV3+GyWF5dDDhWw7jUXaLOALUXwcM43RwfVapU8GiSt8MBjVRYu6cLbpHmjm+rnwAiiF0chVFz0i0kafo0i4fZcelX0XZeZvC6cvQLjchDtespjBUOhX2Pl6w5T0rsLJqQhas0N5DEb2fQIbcaXgBVDKZKC9GFDwrd2RxysLaFQArl8yBXeg4VumMxpvIgOw0OvHClprbeoLGbz7b8pgAnGMw/M6qU7CmEdpi8VOdrGNZTEF01F+RY1NR0/oxT2rWO6BPigA9jy2QFRb87Gwe/YsL8SQl50FPtZsajMvQTqx+EsZuBDLC1P2TU1209HfFEGgAXapXl5LUJd9gwVKoy7v4JRC4oWzkpyWiXbTLjFWTFBgT15","BodyKey":{"Algorithm":"aes256","Key":"avMZB19ni9TAyaJ1remfux5cSb5/POLms2JBbYbhsvs="}}]}
2021/08/18 18:11:32 << POST /api/messages/EAKMxll1TMBXzWNEmIvoX25f6m2cUe5ks7XgMxYE50TLmGtsXr3osYxnkhSc3HZm4pXIW0NDrdicRqCBqgs8Tw==
2021/08/18 18:11:32 &struct { protonmail.resp; Sent *protonmail.Message; Parent *protonmail.Message }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Sent:(*protonmail.Message)(0xc000082c00), Parent:(*protonmail.Message)(nil)}
250 2.0.0 OK: queued
QUIT
221 2.0.0 Bye

As you can see, in the POST data we have:

Content-Type: multipart/alternative;
 boundary="------------A42800B4B1A2192FE87A9ACA"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------A42800B4B1A2192FE87A9ACA
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

image

--------------A42800B4B1A2192FE87A9ACA
Content-Type: multipart/related;
 boundary="------------38B018168954AF09B0DB8602"

--------------38B018168954AF09B0DB8602
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <img moz-do-not-send="false"
      src="cid:part1.27F789DB.7284EACC@protonmail.com" alt="image"
      width="256" height="256"><br>
  </body>
</html>

--------------38B018168954AF09B0DB8602
Content-Type: image/gif;
 name="img.gif"
Content-Transfer-Encoding: base64
Content-ID: <part1.27F789DB.7284EACC@protonmail.com>
Content-Disposition: inline;
 filename="img.gif"

R0lGODlhAAEAAYAAAPz+/P7//yH5BAEAAAEALAAAAAAAAQABAAL+jI+py+0Po5y02ouzTqD7
D4biSJbmiabqyrbuC8dGTNf2jef6/s78DwwKh0SVr4hMKpdM0rEJjUqnsCf1is1Ordqu98vj
gsfkckpsTqvN6LX7jW3D53SlvI7PhwP6vv939yc4eBJIeIjYYZjI+LfYCIn3GEn5NlmJycaX
yZl32Qma9RlKKjVairp0mspKtNoKC7gZS2s6W4urepvL67rbCywbPAz0SnwsYoy8rPjL/Gzk
DD1dokwdbH3dm62dy91d+w0eKz7eWm6eip5eus4e6v7eGS+fSV9feY8fqb/f2O8vEcCAhwYS
HGTwoCNpCrcxbOjtIcRwEieSq2jxHMb+jOo2cmzn8SO8kCLnkSxp7yTKfCpX8mvp8h/MmAJn
0ixo8ybCnDoX9mSV8OeXoEK7EC0qiifSOkeXUmnq1FZUk1M5Qa3K5CpWO0q3ptHqtQjYsEPG
kg1i9qwwtTXZtnWLE25cuTvp1rXrE6+ftHpldO0rFbCnv4Kb8C3M4jDiaIvpKG5ciDBksZIn
l61sGS3mzGs5a/L8dTPoHI9HeyhtGgBq06tHtwb92nNszrMz17Z8e3JuyLsb9178G3HwwsMF
Fwd8vG9yvcvxNrf7nG50udPhVnd7nW12tdvPdif7PWx4r+O3lsd6vmr6qeujtnf6fml8pPOL
1hd6/2f+nvv+dfa/+R9NAcY0oEsFrnQgSgmWtKBIDX70IEcRZjShRRVOdCFEGTa0oUIdHvQh
QSEGNKI/Je5zIj4p1rOiPC2+8yI7MaYzozk1jnMjODl2s6M2PV7zIzVBTjMkNEU+cyQzSS6z
JDJNHvMkMVEOMyU2oqVWQ5XAaOkQlmBwyQuYEXk51JVk9mDmmS2IiQubFKmphZu0yHkRnEnZ
GUeaeKJAJyx9arTnU3oGWs2ghI7wJ1CGHhpCoh0xCoWjqEgKEqSGLWppM5nqsilXnSZBKSmh
jvQpEqOCcipVpfqyKqutCpGqVZhmGmtKr8I6q6W1YrIrS7dq9msxuULaKyXFvhQabGfJkjYs
o8dC8qxMG0xLbbXWXottttpCUAAAOw==
--------------38B018168954AF09B0DB8602--

--------------A42800B4B1A2192FE87A9ACA--

but in the JSON sent to the Protonmail API this has become:

"Body":"-----BEGIN PGP MESSAGE----- [CLIP] -----END PGP MESSAGE-----","MIMEType":"text/html",

where I have checked that the clipped PGP encrypted data above decrypts to the HTML only:

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <img moz-do-not-send="false"
      src="cid:part1.27F789DB.7284EACC@protonmail.com" alt="image"
      width="256" height="256"><br>
  </body>
</html>

Let me know if I can help further. Thanks, as always, for this mighty useful piece of software 👍 Regards, Mark.

emersion commented 3 years ago

Yeah, even regular attachments aren't supported yet. So inline attachments, which are one step further, aren't either.

Ref https://github.com/emersion/hydroxide/pull/86

Marcool04 commented 3 years ago

But this is to a non-encrypted, non-protonmail recipient… (outlook, as the headers make clear) Attachments work there with no problem for me 🤨

emersion commented 3 years ago

Ah, then yeah. Need to update the code to do whatever the webapp is doing to make that work, probably setting a few more fields in the attachment JSON object to set the content disposition and the content ID.

coffseducation commented 2 years ago

Is there a solution yet?

Marcool04 commented 2 years ago

@coffseducation since the front page has the warning :+1:

warning Warning: IMAP support is work-in-progress. Here be dragons. For now, it only supports unencrypted local connections.

and the maintainer/author of hydroxide, @emersion has create an issue announcing that he is going to "Drop IMAP support", I think it's pretty safe to assume no solution to this will be forthcoming unless somebody else decides to start developing and maintaining the IMAP side of hydroxide.

As also mentioned in that issue, since the point of hydroxide was never to bypass Proton Mails pricing, and that the official client is now open source (which the similar project peroxide builds on), the point of actually putting effort into this seems a bit mute to me...