Announcement

Collapse
No announcement yet.

Email empty body bug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Email empty body bug

    In some cases emails are coming into CRM with empty body, and the real email is not empty. I have found that in ContentTransferEncoding class there is a method setTransferEncoding wich check if the transferEncoding valid. Validation is no case insensitive, so the "Quoted-printable" string does not match "quoted-printable" pattern. So I have fixed this by such patch:

    diff --git vendor/zendframework/zend-mail/Zend/Mail/Header/ContentTransferEncoding.php vendor/zendframework/zend-mail/Zend/Mail/Header/ContentTransferEncoding.php
    index 0d20f01..a6fc379 100644
    --- vendor/zendframework/zend-mail/Zend/Mail/Header/ContentTransferEncoding.php
    +++ vendor/zendframework/zend-mail/Zend/Mail/Header/ContentTransferEncoding.php
    @@ -92,14 +92,14 @@ class ContentTransferEncoding implements HeaderInterface
    */
    public function setTransferEncoding($transferEncoding)
    {
    - if (!in_array($transferEncoding, self::$allowedTransferEncodings)) {
    + if (!in_array(strtolower($transferEncoding), self::$allowedTransferEncodings)) {
    throw new Exception\InvalidArgumentException(sprintf(
    '%s expects one of "'. implode(', ', self::$allowedTransferEncodings) . '"; received "%s"',
    __METHOD__,
    (string) $transferEncoding
    ));
    }
    - $this->transferEncoding = $transferEncoding;
    + $this->transferEncoding = strtolower($transferEncoding);
    return $this;
    }

  • #2
    Hi

    I found 4 critical bugs in Zend/Mail. This could be the 5th. You may pull request them.

    Thanks.

    Comment

    Working...
    X