Email "" does not comply with addr-spec of RFC 2822

Created on 25 May 2022, over 2 years ago
Updated 29 January 2024, 11 months ago

I'm getting this error in Log Messages when new user is registered via user_register form.
Symfony\Component\Mime\Exception\RfcComplianceException: Email "" does not comply with addr-spec of RFC 2822. in Symfony\Component\Mime\Address->__construct() (line 56 of /app/vendor/symfony/mime/Address.php).

New user is being created, with the filled mail. As admin I get " New user: email_registration_FxHuVyBcJD ." message and the user can log in with registered mail. But at the registration moment the user gets an error
"The website encountered an unexpected error. Please try again later."

In the vendor/symfony/mime/Address.php file I've printed the $address variable and it passes empty.

Could there be other module conflicting with User module, how can I fix this?

Huge thanks in advance

πŸ› Bug report
Status

Closed: duplicate

Version

9.5

Component
User moduleΒ  β†’

Last updated about 18 hours ago

Created by

πŸ‡¦πŸ‡²Armenia inna_

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium stefvanlooveren

    Also happens when the site name contains a comma. Quite a big bug this is. Emails not getting send this way, and causing troubles :-).

  • πŸ‡¬πŸ‡·Greece ioannis.cherouvim

    Also happens when the site name contains a comma

    100% confirming this finding by @stefvanlooveren.

    To reproduce with just 3 drush commands:

    $ drush config:set system.site name 'foobar, test' -y
    
     // Do you want to update name key in system.site config?: yes.                                                         
    
    $ drush user:block admin
     [success] Blocked user(s): admin
    
    $ drush user:unblock admin
     [error]  Symfony\Component\Mime\Exception\RfcComplianceException: Email ""foobar" does not comply with addr-spec of RFC 2822. in Symfony\Component\Mime\Address->__construct() (line 56 of /home/vagrant/clima-opof-reference/vendor/symfony/mime/Address.php). 
    
    In SqlContentEntityStorage.php line 815:
                                                                   
      Email ""foobar" does not comply with addr-spec of RFC 2822.  
                                                                   
    
    In Address.php line 56:
                                                                   
      Email ""foobar" does not comply with addr-spec of RFC 2822.  
  • Status changed to Closed: duplicate almost 2 years ago
  • πŸ› Uncaught RfcComplianceException when email From name contains a comma Fixed was backported to 9.5 three days ago so it is not yet released. I am 99% sure this is a duplicate of it.

  • FYI,

    this was weird, somehow when I went back to Configuration -> Basic Site Settings, System I did have simple site name "Drupal" but no FROM email address even though it had a red asterisk. I am also pretty sure I'd have changed site name from "Drupal"
    So my test install somehow installed w/o setting up the Basic Site Settings, not sure how I did that.

    After saving a required from email address my send mail issue went away it seems. So in my case I was missing basic site settings from email causing similar error.

    hmm.

  • πŸ‡ΊπŸ‡ΈUnited States hockey2112

    Thanks for the tip about a comma in the Site Name. Removing the comma fixed my issue.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    I found this issue while looking for a solution to πŸ› Add Drupal 10 support, fix fatal error when sending email Needs review , and it looks like adding Symfony Mailer fixes it, allowing mail to be sent.

  • πŸ‡³πŸ‡±Netherlands mariskath

    #20 works for me too. I have installed Symfony mailer and use that as formatter. Works perfectly.

    Thanks!

    Best,
    Mariska

Production build 0.71.5 2024