Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is more of a proof of concept or an outline of an idea, so don't merge this.
This adds a
make_mime
function to thesend
module which can generate a mime message from a mime lua table (a formatted table).See
send.example_mime
to get an idea.It also adds a test command you can run called
:AttachTest
which will generate a mime message in the current buffer from thesend.example_mime
table.If you want to test sending a mime message, make the appropriate modifications to
send.example_mime
and then run:AttachTest
in nvim, write the buffer to a temporary file and run the following command:cat FILENAME | msmtp -t
.You will need to have configured msmtp first.
These functions should help in adding attachments feature as I talked about in #5
Also, I am not to familiar with the mime message format, so I might have gotten some of it wrong, but I tested it with a pdf attachment and it works.
To get base64 encoding working for attachments, I used this module (https://github.com/iskolbin/lbase64)