def shortuser(user):
    """Return a short representation of a user name or email address."""
    f = user.find(b'@')
    if f >= 0:
        user = user[:f]
    f = user.find(b'<')
    if f >= 0:
        user = user[f + 1:]
    f = user.find(b' ')
    if f >= 0:
        user = user[:f]
    f = user.find(b'.')
    if f >= 0:
        user = user[:f]
    return user
