The boundary generation system relies on a random generated boundary. E-mail boundaries can be nested in the same e-mail when e-mail contain subparts, and need to be strictliy different when inside the same message.

Although probablity of collision is low, we still rely on a non deterministic approach when it is realitively easy to make sure that boundaries are strictly different when generated inside the same message.

I am proposing this patch because I was indeed getting collisions every once in a while.

The proposed solution is to track a manually generated string that is to be appended to boundaries used during the generation of a single message + using SHA1 instead of MD5 to even further prevent collision of randomly generated boundaries.

Patch attached.

CommentFileSizeAuthor
#1 mimemail-2119613-1.patch721 bytessgabe
mimemail.inc_.patch3.17 KBdavid_garcia
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sgabe’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
721 bytes

I would rather use just a static counter inside mimemail_multipart_body, see the attached patch.

sgabe’s picture

Status: Needs review » Fixed

Committed to both branches, thanks!

sgabe’s picture

Title: Boundary collision » Further improve boundary collision avoidance

Changing title to a more descriptive one.

Status: Fixed » Closed (fixed)

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