This also duplicates logic found in pick_email.

These should be collapsed.