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

Allow adding/removing multiple headers in one method call #298

glassfishrobot opened this issue Dec 27, 2017 · 2 comments


None yet
1 participant
Copy link

commented Dec 27, 2017

It would be nice to have convenience methods to add and remove multiple headers in InternetHeaders and subsequently MimeMessage and MimeBodyPart.

These could include:

addHeader(Header header)
addHeadersWithHeaderList(List<Header> headers)
addHeadersWithStringList(List<String> headers)
setHeader(Header header)
removeHeader(Header header)
removeHeadersWithHeaderList(List<Header> headers)
removeHeadersWithStringList(List<String> headers)

This comment has been minimized.

Copy link

commented Jan 10, 2018

@bshannon Commented
This would be a change to the public JavaMail API, which normally requires going through the JCP.
This will be considered for JavaMail 1.7.

I'm not sure addHeadersWithStringList(List<String> headers) makes any sense since there
would be no header values.

Likewise, I'm not sure removeHeadersWithHeaderList(List<Header> headers) and
removeHeader(Header header) makes any sense since the header values wouldn't be used,
unless you expected it to match the header values as well. (Is there really a use case for that?)


This comment has been minimized.

Copy link

commented Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.