Devise generation loads of `confirmation_instructions` mails on capitalized accounts
Recently our app started sending loads of confirmation_instructions mails to some users, in some cases 6-10, in one case 100.
After some digging, I found out it's users with unconfirmed_email present, in all cases where they used capitalized email originally (in app not using Devise), and unconfirmed_email was the normalized version.
I'm not sure what was the trigger inside the app (and why some users got 1 and some 100 mails)
It started happening some time after upgrade 5.0.2 -> 5.0.4, I suspect this might be what made this happen, but I don't understand the logic good enough for that.
I'm not even sure what's correct solution on devise side (when I did find out, I just confirmed these mails in console, and I do believe that will solve the issue), so I'm mostly reporting so people are aware this might happen if you have some non-normalize user emails in your database.
Source: heartcombo/devise