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

When contact's display_name is an email address, RFC822::_validateAtom() fails

    Details

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

      Description

      This one was hard to track down. One of our larger clients has imported thousands of email addresses from their previous system and these were getting an error and RSET by CiviCRM before ever reaching SMTP. It turns out that CiviMail sets the recipient's display_name for a bare email contact as 'name@domain.com <name@domain.com>' (without the quotes). But this is not RFC-822 compliant - if you want 'name@domain.com as the "display name" it needs to be in double quotes.

      Initially I hacked RFC822.php but then stepped back and found that in v3.0.0, CRM/Mailing/BAO/Mailing.php has the recipient display_name double quoted, but this was removed, perhaps as part of the CRM-5640 fix?

      I applied the attached patch to only double-quote the display_name if it has special characters (a subset of those defined by _validateAtom()) and this appears to work. A better solution IMO would be to double quote non-RFC-compliant display_names upon contact entry/import (perhaps this has been done?) but I didn't want to mess with the tens-of-thousands of records already in the DB.

        Attachments

          Activity

            People

            • Assignee:
              shot Piotr Szotkowski
              Reporter:
              fen Fen Labalme
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: