mail-api
mail-api copied to clipboard
Allow adding/removing multiple headers in one method call
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)
- Issue Imported From: https://github.com/javaee/javamail/issues/298
- Original Issue Raised By:@jhult
- Original Issue Assigned To: Unassigned
@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?)