How to use emailid ans openfire username with custom db integration

I am integrating openfire with an existing system that has email id implimented as usernames. It is hard for users to use two diffent usernames for our site and chat or to addopt to the changing to user name from email. How to implement username to be an emailID in openfire. It is turning user@example.com to user\40example.com which I am not able to use to login into Pidgin client. What is the best way to get it worked.

Any help is really appariciated. – Srujan.