excerpt
file: smtp.mail.inc
line: 310
description: if either text/plain or text/html is used as text in the mail body, checks done to discern the message content-type are prone to erroneous results


hi,

though this module is awesome, I did spend some time figuring out that having any of either:

  • text/plain
  • text/html

in the mail body wrecks the delivery ;-)

being more precise:

smtp.mail.inc beginning with line 310 does checks in the following manner:

if (strpos($body_part, 'text/plain')) {

thus - if besides the desired text/plain in the header, text/plain is anywhere in the message body, the result could be false-positive.

matter of factly, I encountered mysterious mail-non-deliveries and started backtracing the missing body element. it turned out to be due to a text/plain within the message body of my mail (intendedly, as I want to mail some CURL protocol parts). this triggered the content-type detection, double filled the AltBody part and left Body empty - resulting in non-delivered mails ;-)

greets,

attisan

CommentFileSizeAuthor
#1 smtp-content_type_fix-2011592-2.patch2.35 KBattisan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attisan’s picture

Status: Active » Needs review
FileSize
2.35 KB

if anyone is interested in my fix - see attachment.

hth

attisan

attisan’s picture

DamienMcKenna’s picture

Issue summary: View changes
Status: Needs review » Needs work

The patch needs some tidying up to match the Drupal coding standards.

wundo’s picture

Priority: Major » Minor
TR’s picture

Version: 7.x-1.0 » 8.x-1.x-dev

This still appears to be an issue with the 8.x-1.x version of SMTP in the SMTPMailSystem.

Moving this issue to 8.x-1.x, as the problem should be solved in the current version first then backported if there is interest and community participation.

japerry’s picture

Status: Needs work » Active

Oh ick. Marking as active because there is no valid D8 patch for it yet.