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

Add ability to send attachments #6

Closed
wants to merge 0 commits into from

Conversation

simonhughxyz
Copy link

@simonhughxyz simonhughxyz commented Feb 6, 2025

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 the send 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 the send.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)

@simonhughxyz simonhughxyz force-pushed the main branch 2 times, most recently from 6d0578f to 74cf812 Compare February 11, 2025 15:00
@simonhughxyz
Copy link
Author

I added the ability too add attachment from ComposeMail by using the <ctrl>g<ctrl>a mapping.
This will open a new window where you can add the path to each attachment one per line.
This needs to be the full path

@simonhughxyz simonhughxyz changed the title Add mime message builder Add ability to send attachments Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant