handle user@corp.net username correctly

(cherry picked from commit 248c9185084e99121ea5e99610384bb3a2c0f803)
Related to issue #2040