Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have a site that sends lots of emails to extensive address lists. In order to not expose those lists to everyone, we merge To and Cc into the Bcc list and empty those fields. This is still a valid email.
Unfortunately, SMTP seems to think an empty To field is invalid and throws the email away. This is horribly wrong.
Comments
Comment #2
neorush CreditAttribution: neorush as a volunteer commentedI'm having the same issue where _get_components() returns a blank address for a comma separated list of addresses. The log just has "smtp Invalid address: " (and the whole email is dropped). I found the previous bug submissions where this would occur when an email list had a space in it, and there are trims now in the _get_components() function so it's odd it still returns one. The fix I came up with was to add a trim() before it is sent to _get_components()
On line 176 of smtp.mail.inc
Fixes the issue.