I'm currently working on a small website and my customer is very concerned with privacy issues.
I'm implementing a user registration with common email verification, i.e. when a user wants to register he needs to provide an email address and an email containing a verification link is sent to this address.
In the registration form, I'm doing the usual form validation. If the username - which can be chosen freely - is already in use, a message is displayed saying so. My first thought was to do the same for the email address, because this one also should be unique across the system.
But under some circumstances, even the information if some person is registered at the site might be private. But now, if someone would like to know if some other person is registered and if he would know that other person's email, he could simply try to register a new user with this known address and the error message would tell him that this other person is already registered.
I have one idea how to solve this (I will post it as self-answer) but I would like to know, if 1) this solution has any other flaws and 2) if there are other possible solutions for this situation.
Thanks.