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

PHP Fatal error: Call to undefined function formatAddress() in <civi_root>/sites/all/modules/civicrm/CRM/Utils/Mail/Incoming.php on line 40

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.2.6
    • Component/s: CiviMail
    • Labels:
      None

      Description

      While running bin/EmailProcessor.php (http://host/civi_root/bin/EmailProcessor.php?name=name&pass=pass&key=key&emailtoactivity=1) on an email with an attachment of content-type message/rfc822, you get the above error (in the web server log). It's not clear why since the function formatAddress() exists in that file.

      Possibly related is this warning which you get first:
      PHP Notice: Undefined variable: key in <civi_root>/sites/all/modules/civicrm/CRM/Utils/Mail/Incoming.php on line 132
      This is straightforward though - it's obviously copied-and-pasted code and the reference to $key was left in there.

      To reproduce, run the EmailProcessor on the attached file (can use a LocalDir setup for CiviMail). A real email would have more headers but for clarity I trimmed it down, and according to both Lotus Notes and Hotmail is valid (or at least correctly parseable) as is.

      Changing the line Content-type: message/rfc822 to something else allows the processor to complete successfully, although it doesn't process the full contents.

      Note also it prevents the entire queue from being processed, i.e. it doesn't just skip this email and go on to the next, so you get a backlog.

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              demeritcowboy Dave D
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: