[GH-ISSUE #106] UI : add and attachment icon #70

Closed
opened 2026-03-15 12:23:36 +03:00 by kerem · 8 comments
Owner

Originally created by @jeromelaurens on GitHub (May 3, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/106

The UI would benefit having an attachment icon when an email in the list have attachments

Originally created by @jeromelaurens on GitHub (May 3, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/106 The UI would benefit having an attachment icon when an email in the list have attachments
kerem closed this issue 2026-03-15 12:23:41 +03:00
Author
Owner

@axllent commented on GitHub (May 3, 2023):

I am confused as Mailpit has always had this (paperclip icon), so maybe I don't understand you correctly?

Screenshot 2023-05-04 at 07-41-02 Mailpit

The only exception is "inline attachments" which are images embedded into an HTML email. Technically inline attachments are still attachments, however Mailpit does not show those as attachments as they haven't been specifically attached to the email (all email programs, Gmail etc do the same).

<!-- gh-comment-id:1533635996 --> @axllent commented on GitHub (May 3, 2023): I am confused as Mailpit has always had this (paperclip icon), so maybe I don't understand you correctly? ![Screenshot 2023-05-04 at 07-41-02 Mailpit](https://user-images.githubusercontent.com/1463435/236028371-a9a1da78-a8da-4ab4-a1a8-d520054785a1.png) The only exception is "inline attachments" which are images embedded into an HTML email. Technically inline attachments are still attachments, however Mailpit does not show those as attachments as they haven't been specifically attached to the email (all email programs, Gmail etc do the same).
Author
Owner

@jeromelaurens commented on GitHub (May 4, 2023):

Strange, may be a bug on specific os and browsers ?
I'm on macOS, Firefox

image

<!-- gh-comment-id:1534157574 --> @jeromelaurens commented on GitHub (May 4, 2023): Strange, may be a bug on specific os and browsers ? I'm on macOS, Firefox ![image](https://user-images.githubusercontent.com/2656354/236127459-b8ab70c0-fc77-4d2b-946f-b3d463c5c8d6.png)
Author
Owner

@axllent commented on GitHub (May 4, 2023):

Hmm, that is odd, mainly because the icon font is included in Mailpit, and that is clearly working (based on the other icons in your screenshot). I also just tested in a virtual MacOS desktop I have, works perfectly in both Safari and Firefox. I suspect it may be an issue with the email you are sending. If you open the email, does it show attachments or if the message all garbled?

Please could you try this test email which should display an icon too (I have just tested and it works here too)? (mailpit sendmail < mime-attachment.eml after you download it).

<!-- gh-comment-id:1534213282 --> @axllent commented on GitHub (May 4, 2023): Hmm, that is odd, mainly because the icon font is included in Mailpit, and that is clearly working (based on the other icons in your screenshot). I also just tested in a virtual MacOS desktop I have, works perfectly in both Safari and Firefox. I suspect it may be an issue with the email you are sending. If you open the email, does it show attachments or if the message all garbled? Please could you try [this test email](https://raw.githubusercontent.com/axllent/mailpit/develop/storage/testdata/mime-attachment.eml) which should display an icon too (I have just tested and it works here too)? (`mailpit sendmail < mime-attachment.eml` after you download it).
Author
Owner

@jeromelaurens commented on GitHub (May 4, 2023):

My email is displaying correctly, I can even download the attachment
image

With your mime-attachment.emlit is working fine.
image

The wrong email has been sent with macOS Mail.app, maybe something specific with attachments ?
Bellow is the raw email content (base64 of attachment has been truncated)

Received: from smtpclient.apple (localhost [127.0.0.1])
        by my_computer_name.local (Mailpit) with SMTP
        for <fake@mail.com>; Thu,  4 May 2023 08:29:09 +0200 (CEST)
From: Mailpit <mailpit@matartemilpit.com>
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_35F03913-AD0E-49DC-9889-943D57E9FA73"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\))
Subject: Email with attachment
Message-Id: <11EA53B2-9BEE-4B4B-9FE5-BEDA1A154221@matartemilpit.com>
Date: Thu, 4 May 2023 08:29:03 +0200
To: fake@mail.com
X-Mailer: Apple Mail (2.3731.500.231)


--Apple-Mail=_35F03913-AD0E-49DC-9889-943D57E9FA73
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

Body
--Apple-Mail=_35F03913-AD0E-49DC-9889-943D57E9FA73
Content-Disposition: inline;
	filename=avis-61963016a7b11b0006d475e7.pdf
Content-Type: application/pdf;
	x-unix-mode=0644;
	name="avis-61963016a7b11b0006d475e7.pdf"
Content-Transfer-Encoding: base64

JVBERi0xLjUKJeLjz9MKMyAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZUdyYXkvU3VidHlwZS9J
bWFnZS9IZWlnaHQgNTI5L0ZpbHRlci9GbGF0ZURlY29kZS9UeXBlL1hPYmplY3QvV2lkdGggMTY1
OC9MZW5ndGggMjE2MjMvQml0c1BlckNvbXBvbmVudCA4Pj5zdHJlYW0KeJzt3WeAFMXWBuDZXXIQ
JJkQwSwqohhQL1fMATP6iRlzVswZuV4DZsxZMaNizgHEjBlRvAYUREQEQZC4C7v9sQlmZ3tm6q06
p6uneZ/fTNWpHrZrurrqnFSK/Fip557HXjBoiTMO2XWTJr6jISKiJCva4Jj7Pp4VpCv/6fnLtm/q
OzAiIkqitocOmxmEW/DyMW18h0dERMnS/IgR5VmmnWplT+1U5DtIIiJKjG4PzMk57VT7ql+x70CJ
iCgRdnvLYNqp8sMevmMlIqLC13u06bxT6bW1fcdLRESFbeM3kHlnibkn83UPEVGBKV5r96Mvum3o
EncPPv+wzVv5jKX5dYvBiWeJV1r7DJmIiCAdDr7747kZN/IJj564pqdw9piEzztL/NjVU7xERITp
cf3YbPfysZd6eH3S9HareWeJ2f+KPloiIgJ1uvzHnDfzitf6RLxludt3thNPEMzfJdpYiYgItf2z
Bu9Txu4dZUgHzrOfeIKgtHeUsRIREWg3033LH20aVUjFV7nMO0vM3iSqUImICLUdcF5m8TXR5OZs
9JTjxBMEv68USaRERIRa7XHshj4uin1jzd90nniCYGRJBJESERGoaIBJPrQ65vZTj6rVJwITTxD8
Rz1QIiJCrfGOzR39IuWomn0sMvEEi7orB0pERKj/+8fuln6Tan6apiNlJp4gGNNAM04iIkI1uNH6
ln6TYljFz0hNPEFwomKcRESEajPK4ZZ+oV5cg8XmnSCY2kIvTiIiAnVyyBCwxEFacR0uNOlUu0Qr
<!-- gh-comment-id:1534275996 --> @jeromelaurens commented on GitHub (May 4, 2023): My email is displaying correctly, I can even download the attachment ![image](https://user-images.githubusercontent.com/2656354/236147224-40ca6199-067c-4e68-8e84-d4ad13adf262.png) With your `mime-attachment.eml`it is working fine. ![image](https://user-images.githubusercontent.com/2656354/236147548-190ba32b-1c53-4680-8c9c-cfd4bd953c7c.png) The wrong email has been sent with macOS Mail.app, maybe something specific with attachments ? Bellow is the raw email content (base64 of attachment has been truncated) ``` Received: from smtpclient.apple (localhost [127.0.0.1]) by my_computer_name.local (Mailpit) with SMTP for <fake@mail.com>; Thu, 4 May 2023 08:29:09 +0200 (CEST) From: Mailpit <mailpit@matartemilpit.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_35F03913-AD0E-49DC-9889-943D57E9FA73" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Email with attachment Message-Id: <11EA53B2-9BEE-4B4B-9FE5-BEDA1A154221@matartemilpit.com> Date: Thu, 4 May 2023 08:29:03 +0200 To: fake@mail.com X-Mailer: Apple Mail (2.3731.500.231) --Apple-Mail=_35F03913-AD0E-49DC-9889-943D57E9FA73 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Body --Apple-Mail=_35F03913-AD0E-49DC-9889-943D57E9FA73 Content-Disposition: inline; filename=avis-61963016a7b11b0006d475e7.pdf Content-Type: application/pdf; x-unix-mode=0644; name="avis-61963016a7b11b0006d475e7.pdf" Content-Transfer-Encoding: base64 JVBERi0xLjUKJeLjz9MKMyAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZUdyYXkvU3VidHlwZS9J bWFnZS9IZWlnaHQgNTI5L0ZpbHRlci9GbGF0ZURlY29kZS9UeXBlL1hPYmplY3QvV2lkdGggMTY1 OC9MZW5ndGggMjE2MjMvQml0c1BlckNvbXBvbmVudCA4Pj5zdHJlYW0KeJzt3WeAFMXWBuDZXXIQ JJkQwSwqohhQL1fMATP6iRlzVswZuV4DZsxZMaNizgHEjBlRvAYUREQEQZC4C7v9sQlmZ3tm6q06 p6uneZ/fTNWpHrZrurrqnFSK/Fip557HXjBoiTMO2XWTJr6jISKiJCva4Jj7Pp4VpCv/6fnLtm/q OzAiIkqitocOmxmEW/DyMW18h0dERMnS/IgR5VmmnWplT+1U5DtIIiJKjG4PzMk57VT7ql+x70CJ iCgRdnvLYNqp8sMevmMlIqLC13u06bxT6bW1fcdLRESFbeM3kHlnibkn83UPEVGBKV5r96Mvum3o EncPPv+wzVv5jKX5dYvBiWeJV1r7DJmIiCAdDr7747kZN/IJj564pqdw9piEzztL/NjVU7xERITp cf3YbPfysZd6eH3S9HareWeJ2f+KPloiIgJ1uvzHnDfzitf6RLxludt3thNPEMzfJdpYiYgItf2z Bu9Txu4dZUgHzrOfeIKgtHeUsRIREWg3033LH20aVUjFV7nMO0vM3iSqUImICLUdcF5m8TXR5OZs 9JTjxBMEv68USaRERIRa7XHshj4uin1jzd90nniCYGRJBJESERGoaIBJPrQ65vZTj6rVJwITTxD8 Rz1QIiJCrfGOzR39IuWomn0sMvEEi7orB0pERKj/+8fuln6Tan6apiNlJp4gGNNAM04iIkI1uNH6 ln6TYljFz0hNPEFwomKcRESEajPK4ZZ+oV5cg8XmnSCY2kIvTiIiAnVyyBCwxEFacR0uNOlUu0Qr
Author
Owner

@jeromelaurens commented on GitHub (May 4, 2023):

Reading at the raw message, it seems that Mail.app from macOS tries to attach a PDF as an inline.
Perhaps mailpit should consider displaying the icon in the list in the case it displays the attachment in the footer of the opened email.
This is just a suggestion to have some consistency in the UI.
Whatever you decide, it is not a big issue then.

<!-- gh-comment-id:1534315402 --> @jeromelaurens commented on GitHub (May 4, 2023): Reading at the raw message, it seems that Mail.app from macOS tries to attach a PDF as an inline. Perhaps mailpit should consider displaying the icon in the list in the case it displays the attachment in the footer of the opened email. This is just a suggestion to have some consistency in the UI. Whatever you decide, it is not a big issue then.
Author
Owner

@axllent commented on GitHub (May 4, 2023):

Thank you for the message source, very helpful. I was just about to point the same thing out: Content-Disposition: inline;. This means "it can be displayed inside the Web page, or as the Web page", and is not classified as an "attachment" as far as any email app overview is concerned. This behaviour is consistent with Gmail, Thunderbird, Outlook, various phone apps etc. The only difference is Mailpit will also display all attachments (including inline) as downloadable files when you open it to give the tester the ability to easily & identify see all attachments (Gmail for instance won't show inline images files as attachments). My guess is they probably have some work-around for broken email clients to still display an email like yours as having an attachment, but in reality this is wrong.

I'm curious as to how this email was created, did you drag the PDF into the email when you attached it (like one normally would for an inline image), or did you attach it via a button click etc?

Whilst I'd love to solve your issue, I feel that by showing any email containing just an inline image as having an attachment (think of email signatures etc) it would make it inconsistent with all other email programs. This isn't an issue with Mailpit (after all, it is a testing tool which just discovered a bug in your email :)), it is an issue with Mail.app. Thanks for the info though, handy to know for others!

<!-- gh-comment-id:1534363018 --> @axllent commented on GitHub (May 4, 2023): Thank you for the message source, very helpful. I was just about to point the same thing out: `Content-Disposition: inline;`. This [means](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#as_a_response_header_for_the_main_body) "it can be displayed inside the Web page, or as the Web page", and is not classified as an "attachment" as far as any email app overview is concerned. This behaviour is consistent with Gmail, Thunderbird, Outlook, various phone apps etc. The only difference is Mailpit will also display all attachments (including inline) as downloadable files when you open it to give the tester the ability to easily & identify see all attachments (Gmail for instance won't show inline images files as attachments). My guess is they probably have some work-around for broken email clients to still display an email like yours as having an attachment, but in reality this is wrong. I'm curious as to how this email was created, did you drag the PDF into the email when you attached it (like one normally would for an inline image), or did you attach it via a button click etc? Whilst I'd love to solve your issue, I feel that by showing any email containing just an inline image as having an attachment (think of email signatures etc) it would make it _inconsistent_ with all other email programs. This isn't an issue with Mailpit (after all, it is a testing tool which just discovered a bug in your email :)), it is an issue with Mail.app. Thanks for the info though, handy to know for others!
Author
Owner

@jeromelaurens commented on GitHub (May 4, 2023):

in Mail app macOS, this email was attached via button click, not vie dragging it. This is odd but Mail seems to inline it despite this.
I agree that this is an issue with Mail, and that mailpit should not display inline images such as image signature as attachment.
I also think that the workaround (displaying inline PDF as attachment) is not necessary in mailpit, since this is not the use case of mailpit (send emails to mailpit with macOS app).
BTW, you're doing great job here !

<!-- gh-comment-id:1534506539 --> @jeromelaurens commented on GitHub (May 4, 2023): in Mail app macOS, this email was attached via button click, not vie dragging it. This is odd but Mail seems to inline it despite this. I agree that this is an issue with Mail, and that mailpit should not display inline images such as image signature as attachment. I also think that the workaround (displaying inline PDF as attachment) is not necessary in mailpit, since this is not the use case of mailpit (send emails to mailpit with macOS app). BTW, you're doing great job here !
Author
Owner

@axllent commented on GitHub (May 4, 2023):

Thank you! I'm closing this ticket as there is nothing left for me to do here.

<!-- gh-comment-id:1534528700 --> @axllent commented on GitHub (May 4, 2023): Thank you! I'm closing this ticket as there is nothing left for me to do here.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#70
No description provided.