0

I imported 500+ users into Drupal 7 by Feeds module. However, 1 of the user has 2 accounts. I got a error message "This name has already been taken by another user." when chaning their roles. Their username is different, but account A user name is same as account B email address. I think they have user name and user email conflict. Is it possible to fix this without changing username and user email?

User account A:
Username - usernameX
user email - usernameX@gmail.com

User account B:
username - usernameX@gmail.com
user email - usernameB@gmail.com

3

I am puzzled by your description of the problem. Drupal 7 should not complain if A user name is the same as account B email address.

However, without making a too big deal of that, there is a way you can change an email address to avoid any conflict within Drupal, and still get mail delivered to that user without interruption.

Simply insert the character + and some string after the name part of the address, like this:

User account A:
Username   - usernameX
user email - usernameX+a@gmail.com

User account B:
username   - usernameX@gmail.com
user email - usernameB@gmail.com

Drupal allows email-adresses with a + in them.

And for string comparison purposes:

usernameX+a@gmail.com ≠ usernameX@gmail.com

While for mail delivery purposes:

usernameX+a@gmail.com = usernameX@gmail.com

This technique, known “plus-addressing” allows users to sign up for different services with different aliases and then easily filter all e-mails from those services (provided their mail server doesn't strip it). Mail servers deals differently with “plus-addresses”. MS Exchange strips it, while Cyrus and GMail retains it - but AFAIK all mail servers deliver mail with “plus-addresses” to the intended recipient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.