-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Add support for composing 'multipart/related' emails #3197
Conversation
It works! |
Using a Neomutt macro to pipe the primary attachment (in Markdown format) to a sufficiently complex script does allow you to construct and send a Consider initial email structure like this:
We can send the message with a single macro:
In the above case
The final email structure before sending will be:
At send time Neomutt then wraps all this in a And provided you haven't forgot to attach anything, misspelled anything, or omitted the |
adffaee
to
0a0f353
Compare
ea1dc6c
to
f6e0c1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Rebased
- Clang-formatted
- A couple of minor tweaks to the docs
Looking good
f6e0c1a
to
1ee148b
Compare
1ee148b
to
c330bad
Compare
Rebased over a bunch of huge Compose-function renames. |
14fa3a2
to
a2c6cec
Compare
- Reads from and writes into the Body parameter list.
a2c6cec
to
5dd9fe2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! It was going so well... and you blew it :-)
It doesn't work; the Content-ID
that gets sent is garbage.
However, I've pushed some fixes.
In mutt_write_mime_header()
, you id = cont->attribute;
but you actually wanted cont->value
Just below that, pl_conts
gets freed: mutt_param_free(&pl_conts);
which means that id
is no longer valid. I've added a strdup()
and free()
to work around this.
I've added a mutt_buffer_dealloc()
to check_cid()
to cover the possibility of an error.
Finally, in the docs it says: "an HTML part ... needs to contain ... <img src="cid:content-id">
"
I've removed the reference to alt="Alt Text"
as that's not required.
Oops! It definitely worked at one stage.
Great.
Fine. |
What does this PR do?
Adds support for composing
multipart/related
emails.Example
run
./neomutt -n -F multipart-related.rc
Needs:
multipart-related.rc
html-part.html
Final email structure
Behaviour at receiving end
¹ Also displays embedded image as attachment (but emails from other clients display like this too).
² Embedded image is not displayed and isn't available in attachment list. (Also fails on messages from Thunderbird.)
³ Embedded image is not displayed, but is available in attachment list. (Also fails on messages from Thunderbird.)
⁴ Thinks there is remote content for some reason.
Notes on constructing emails
multipart/related
group should probably have inline disposition. (Microsoft Outlook shows also shows them as a separate attachment if they have disposition attachment, but Gmail doesn't.) So ensure embedded images have the headerContent-Disposition: inline; filename="image.png"
. The attachment needs to be given ad_filename
(with<rename-attachment>
) for thefilename
field to be included.multipart/related
group.