Before sendmail looks at the password file to find out the full name of a user, it'll first check the environment variable NAME and uses that if set. This doesn't fix the problem, but it does work around it.