email headers are http encoded

Neil Baleva 10 Reputation points

When sending email through Azure Communication Services (either via the rest endpoint or smtp), oneclick unsubscribe headers are being http encoded. Please let me know if there is a way to ensure these headers are set correctly ?

Date: Tue, 25 Jun 2024 19:59:38 +0000
List-Unsubscribe: =?utf-8?q?=3Chttp=3A=2F=2Fcybercoders-dev=2Ecybercoders=2Enet=2Funsubscribe=2Fjobalerts?=
List-Unsubscribe-Post: =?utf-8?q?List-Unsubscribe=3Dccjobalert=3BEnv=3Ddev=3BEncEmail=3D0x0200000076E19F?=
MIME-Version: 1.0
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
804 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,366 Reputation points

    @Neil Baleva The issue you're encountering is related to how Azure Communication Services is encoding the email headers, specifically the List-Unsubscribe and List-Unsubscribe-Post headers. These headers are being encoded using MIME Encoded-Word syntax (RFC 2047), which is typically used for non-ASCII characters in email headers. The encoding is happening because the headers contain special characters (like ":", "/", "?", "&", "=") that might be interpreted incorrectly by email clients if left unencoded.To resolve this issue and ensure the headers are set correctly, you can try the following solutions:

    1. Use plain ASCII characters only: If possible, modify your unsubscribe URLs to use only plain ASCII characters. This might involve URL-encoding certain parts of the link before setting it as a header.
    2. Instead of relying on Azure Communication Services to set these headers, try setting them yourself as custom headers. This might bypass the automatic encoding.

    Hope that helps.