MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.6k stars 625 forks source link

Email sent using mailcore2 IOS contains multiple content-depositions #1584

Open fans3210 opened 7 years ago

fans3210 commented 7 years ago

As shown below. I sent an email with only one normal attachment, but as I checked the source of the email, I found there are two extra multi parts with content-deposition of 'inline'. Which confuses my friend's email app which was written using javamail. He always thought I sent him an email with inline attachments while I wasn't.

Is this a normal behavior? How to avoid sending such extra things?

_____sample____

Message-ID: 089f27a2-d82e-4fda-a648-e08246cd7faf@YAO-DONG-LIs-iPhone Subject: Qq MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5847ea52_46e87ccd_be1d"

--5847ea52_46e87ccd_be1d Content-Type: multipart/alternative; boundary="5847ea52_238e1f29_be1d"

--5847ea52_238e1f29_be1d Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline

Q --5847ea52_238e1f29_be1d Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

Q --5847ea52_238e1f29_be1d--

--5847ea52_46e87ccd_be1d Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="53B6C757-20DA-45E9-AF09-2580DE78F4A3.jpg"

jack4oahin commented 2 years ago

I had the same problem and was looking for an answer

jack4oahin commented 2 years ago

I tried to fix this problem by modifying the code in the "mailcore2/src/core/rfc822/MCMessageBuilder.cpp " file, as shown below. I changed "disposition" to "NULL" .

截屏2021-10-27 下午2 38 46