Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mu4e bug] mu4e exports the same image in html exports if the attachments have the same name, even if the cid is different #2460

Closed
3 tasks done
husainaloos opened this issue Apr 2, 2023 · 2 comments
Labels
bug mu4e specific for mu4e

Comments

@husainaloos
Copy link

Describe the bug
Please provide a clear and concise description of what you expected to happen
and what actually happened.

When an email has multiple inlined images, all have the same name but different cids, the "view in browser" functionality inlines a single image in place of all the images in the email.

How to Reproduce
Include the exact steps of what you were doing (commands executed etc.). Include
any relevant logs and outputs. Best start with emacs -Q and a minimal mu4e setup.

  1. Open the email (attached)
  2. View in the browser (a v)

If this is about a specific (kind of) message, attach an example message. (Open
the message, press . (mu4e-view-raw-message), then C-x C-w and attach.
Anonymize as needed, all that matters is that the issue still reproduces.

Attached.

Environment
Please describe the versions of OS, Emacs, mu/mu4e etc. you are using.

1.8.6

Checklist

  • you are running either an 1.8.x/1.10.x release or master (otherwise please upgrade)
  • you can reproduce the problem without 3rd party extensions (including Doom/Evil, various extensions etc.)
  • you have read all of the above

Please make sure you all items in the checklist are set/met before filing the ticket. Thank you!

image_issue_email.txt

@husainaloos husainaloos added bug mu4e specific for mu4e new labels Apr 2, 2023
@djcb djcb removed the new label Apr 4, 2023
@djcb
Copy link
Owner

djcb commented Apr 4, 2023

The html export is very rudimentary; CIDs are not supported; we're at the mercy of Gnus here. See mu4e-action-view-in-browser for the implementation.

@djcb
Copy link
Owner

djcb commented Nov 8, 2023

It's a bit of a corner-case, and the fix must be in Gnus-proper. I have a small patch for that,

@@ -2871,11 +2871,14 @@ gnus-article-browse-html-save-cid-content
 			      cid handle directory))
 	      (throw 'found file)))
 	   ((equal (concat "<" cid ">") (mm-handle-id handle))
-	    (setq file (or (mm-handle-filename handle)
-			   (concat
-			    (make-temp-name "cid")
-			    (car (rassoc (car (mm-handle-type handle))
-					 mailcap-mime-extensions))))
+	    ;; Files are randomized since declared filenames may not be unique.
+	    (setq file (format "cid-%d-%s"
+			       (random 99)
+			       (or (mm-handle-filename handle)
+				   (concat
+				    (make-temp-name "cid")
+				    (car (rassoc (car (mm-handle-type handle))
+						 mailcap-mime-extensions)))))
 		  afile (expand-file-name file directory))

I opened a Gnus bug for this, should show up in https://debbugs.gnu.org/cgi/pkgreport.cgi?package=gnus soon hopefully.

Anyway, there's nothing more we can do on the mu side, so closing this...

@djcb djcb closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mu4e specific for mu4e
Projects
None yet
Development

No branches or pull requests

2 participants