This module sends empty or null Bcc/Cc in headers to drupal_mail..
On our project we are using SMTP module for sending module and it causes problems because SMTP prints "Invalid email: " if Bcc/Cc is not valid (or empty) email (there is patch to log instead print for SMTP here: https://www.drupal.org/node/1292490). But anyway I think it is not correct to send here empty data. I'll create patch for it.

Comments

mkolar’s picture

I also see the Undefined index notices:

Notice: Undefined index: mail_bcc in entity_email_create() (line 344 of /.../sites/all/modules/contrib/entity_email/entity_email.module).

Notice: Undefined index: mail_cc in entity_email_create() (line 347 of /.../sites/all/modules/contrib/entity_email/entity_email.module).

mkolar’s picture

Assigned: Unassigned » mkolar
mkolar’s picture

StatusFileSize
new1.64 KB

Here is the patch file...

mkolar’s picture

StatusFileSize
new1.67 KB

Looks like you didn't use unix line endings so the path don't want to apply through drush make. You should use unix line endings. Here is path with windows endings.

mkolar’s picture

Status: Active » Needs review

The last submitted patch, 3: entity_email_bcc_cc-2444887-2.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: entity_email_bcc_cc-2444887-4.patch, failed testing.

mkolar’s picture

Tests died because Windows line endings..

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: entity_email_bcc_cc-2444887-4.patch, failed testing.

mojzis’s picture

StatusFileSize
new1.64 KB

resubmitting with unix line ends in the patch :)

mojzis’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: entity_email_bcc_cc-2444887-5.patch, failed testing.

mkolar’s picture

StatusFileSize
new1.64 KB

Patch against latest 7.x branch

mkolar’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 14: entity_email_bcc_cc-2444887-14.patch, failed testing.

mkolar’s picture

Honestly I don't know what's wrong now.. I didn't find anything useful in log.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 14: entity_email_bcc_cc-2444887-14.patch, failed testing.

yepa’s picture

StatusFileSize
new1.65 KB

Another patch based on 7.x-1.x (dev version)

yepa’s picture

yepa’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 20: entity_email-bcc-cc-2444887-20.patch, failed testing.

yepa’s picture

StatusFileSize
new1.68 KB

patch based on 7.x-1.3

yepa’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 24: entity_email-bcc-cc-2444887-24.patch, failed testing.

yepa’s picture

Status: Needs work » Needs review
StatusFileSize
new1.68 KB

Status: Needs review » Needs work

The last submitted patch, 27: entity_email-bcc-cc-2444887-27.patch, failed testing.

yepa’s picture

After clone entity email with this command on linux system :
git clone --branch 7.x-1.3 http://git.drupal.org/project/entity_email.git
I have files with crlf (windows line end).
I tried on another project like entity (no CRLF)...

mkolar’s picture

Hi, there have to be some other problem probably with tests, because patch #14 is against latest and there is no windows line endings..

mojzis’s picture

interesting ... was this : https://www.drupal.org/node/2445071 merged to 1.3 then ?

David Hernández’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.84 KB

Just rerolling the patch from #14:

sites/all/modules/contrib/entity_email$ git apply entity_email-bcc-cc-2444887-27.patch
entity_email-bcc-cc-2444887-27.patch:10: trailing whitespace.
  $values['mail_bcc'] = (isset($values['mail_bcc'])) ? $values['mail_bcc'] : NULL;
entity_email-bcc-cc-2444887-27.patch:14: trailing whitespace.
  // Get CC.
entity_email-bcc-cc-2444887-27.patch:15: trailing whitespace.
  $values['mail_cc'] = (isset($values['mail_cc'])) ? $values['mail_cc'] : NULL;
entity_email-bcc-cc-2444887-27.patch:29: trailing whitespace.
      $params['headers'] = array();
entity_email-bcc-cc-2444887-27.patch:30: trailing whitespace.
      if (valid_email_address($this->mail_bcc)) {
error: Patch failed: entity_email.module:341
error: entity_email.module: The patch doesn't apply
error: Patch failed: includes/entity_email.entity_email.inc:188
error: includes/entity_email.entity_email.inc: The patch doesn't apply

I created a new patch, also removing all the trailing whitespaces of the module itself to comply with the Drupal Code standards.

This patch is almost like the one from #14, but hopefully will be applied now, as the windows line endings have been removed from the code and the patch.

David Hernández’s picture

The testbot has marked the last patch as posponed because the current dev branch has the tests broken: https://qa.drupal.org/pifr/test/615393

Status: Needs review » Needs work

The last submitted patch, 32: entity_email-bcc-cc-2444887-32.patch, failed testing.

mkolar’s picture

Should we create an issue about failing tests?

mojzis’s picture

mkolar’s picture

Status: Needs work » Needs review
Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

Patch #14 cleans the CC and BCC messages, thanks

chris burge’s picture

Status: Reviewed & tested by the community » Fixed
chris burge’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.