Open hpfr opened 2 years ago
+1 for getting this fixed.
When working on items with sr.ht it requires that emails be text/plain
and never multipart. Without this being fixed you simply can't use org-msg for dealing with sourcehut.
A temporary fix is the following:
(defun +org-msg-separate-mml-and-org/remove-empty-mml (orig &rest args)
(cl-multiple-value-bind (mml org)
(apply orig args)
(cl-values
(if (string-empty-p mml)
nil
mml)
org)))
(advice-add 'org-msg-separate-mml-and-org :around '+org-msg-separate-mml-and-org/remove-empty-mml)
I've composed a reply to an email with no attachments and only
(utf-8)
for alternatives.When I send the message, it is sent as
Content-Type: multipart/mixed
, even though it only has one part, the body.I did some basic debugging of
org-msg-prepare-to-send
(where I found(mml-insert-multipart "mixed")
) and it looks likeorg-msg-build-alternatives
returns a list with"text/plain"
for the only alternative,nil
for attachments, and""
for MML.I believe the empty MML string is truthy, so multipart/mixed is inserted. Assuming I fully understand what's going on with MML (a poor assumption), is it possible to update this check to something like
(or attachments (not (string-empty-p mml)))
so thattext/plain
is sent instead? I would send a patch, but again I'm not fully sure if I understand what's going on with MML.As an aside, what is MML for? It looks like it was added in May, and although I can tell there are functions for parsing it, I'm not sure how MML gets into an OrgMsg buffer in the first place. What do you use it for, out of curiosity? Or is it a Gnus-only thing?
Thanks for your work on this package!