Not possible to send Cc to Gmail email addresses due to duplicate headers

Created on 13 April 2023, almost 2 years ago

Problem/Motivation

When adding a Cc email address to the header of an email, Gmail refuses them because there duplicates.

I'm not sure if this would be the same with other email providers but as Gmail refuses due to RFC compliance I would guess so.

Steps to reproduce

  1. Add a Cc (or cc) to the header of an email using a hook_mail_alter()
  2. Notice the emails will soft-bounce

The emails will soft-bounce with the following message:
This message is not RFC 5322 compliant, the issue is: 550-5.7.1 duplicate CC headers. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please review 550 5.7.1 RFC 5322 specifications for more information.

Proposed resolution

Remove the Cc headers from the $message after they have been added to the $receivers variable. This ensures there are no duplicates in the 'to" or "headers' element of the $mailchimp_transactional_message variable.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom joekers UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024