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

Support multipart/alternative, rather than just /mixed, ideally with nesting #71

Open
jwdevel opened this issue Nov 30, 2023 · 2 comments
Milestone

Comments

@jwdevel
Copy link

jwdevel commented Nov 30, 2023

When using attachments, swaks will use multipart/mixed for the container, and each attachment becomes a sibling in it.

But, this is not always desired.

Sometimes a user may want multipart/alternative for the container, or they may want a nested structure, with sub-parts within sub-parts.

Some relevant discussion here: https://stackoverflow.com/questions/3902455/mail-multipart-alternative-vs-multipart-mixed/23853079#23853079

I guess at a minimum, it would be good to be able to specify the type of the top-level multipart container.

A more thorough feature would be to support an arbitrary nested structure of MIME parts.

@jetmore
Copy link
Owner

jetmore commented Dec 1, 2023

There is a nod to this issue in that, if multiple bodies are added using --attach-body, multipart/alternative is used. Essentially the 'body' component of the message is special and can have explicitly set alternative parts. Every other attachment is multipart/mixed. If this should satisfy your need but isn't working, let me know because it's a bug. Otherwise it's a feature request and I don't have an ETA. This is part of the "how much do I want to be a test tool specifically for SMTP and how much do I want to be an easy, command line MUA" argument I'm having with myself over the future of swaks

@jetmore jetmore added this to the MUA milestone Dec 1, 2023
@jwdevel
Copy link
Author

jwdevel commented Dec 1, 2023

if multiple bodies are added using --attach-body, multipart/alternative is used.

Ah, my version of swaks (20181104.0) does not have --attach-body. Looks like that came around 2020 — sorry for not checking latest!

I tried it, and it does work as advertised. I was able to create the mail I originally wanted with:

$ swaks --to $USER@localhost --attach-type text/plain --attach-body @mail.txt --attach-type text/html --attach-body @mail.html

Otherwise it's a feature request and I don't have an ETA. This is part of the "how much do I want to be a test tool specifically for SMTP and how much do I want to be an easy, command line MUA" argument I'm having with myself over the future of swaks

Understood (:

I do find myself using it for reason # 2 most often, but I know feature creep's a pain.

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

No branches or pull requests

2 participants