RFC 5322 (section 2.2.3) supports header folding so headers with more than 998 characters can be used in email.
unfortunately office-js doesn't support that and has a fixed maximum length of 998 which it seems to check with a simple check for string length.
For a company project, I need to be compliant with the standards of a certain organisation which requests header data, but this header needs to be folded as it will always be larger than 998 characters.
This person/post is the same issue I would want adressed. https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/support-folding-headers-according-to-rfc5322-for-outlook-add-in/idc-p/4200151#M2634
here is the link to the github issue -> https://github.com/OfficeDev/office-js/issues/3546