in reply to Help with getpwnam - and what it returns..

To me, this looks a lot as if getpwnam() is failing. You need to be in a system with /etc/passwd or a similar user database (read, a *nix system). Also, you must have a user mail.

Insure that the following shell command:

$ id mail
does return some sensible answer.

Good luck.