Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11989

Error in CiviMail when bounce_reason longer then 255 characters

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.8
    • Fix Version/s: 4.3.0
    • Component/s: CiviMail
    • Labels:
      None

      Description

      When a bounce message is generated for a bad email in the civiEmail component the bounce message may be longer than the 255 characters defined in the MySQL field. If this occurs then you get a generic "DB Error: unknown error". The backtrace leads to the problem which lies in the file CRM\Mailing\Event\BAO\Bounce.php around line 77. It can be resolved by adding a substr line around this part of the code so that the string is not larger than the 255 character max

      if (empty($params['bounce_type_id'])) {
      $params['bounce_type_id'] = 11;
      if (empty($params['bounce_reason']))

      { $params['bounce_reason'] = ts('Unknown bounce type: Could not parse bounce email'); }

      }
      +++ $params['bounce_reason'] = substr($params['bounce_reason'], 0, 254);
      $bounce->copyValues($params);
      $bounce->save();
      $success = TRUE;

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              civi5 Roy Collins
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 10 minutes
                10m
                Remaining:
                Remaining Estimate - 10 minutes
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified