[GRASSLIST:2045] Re: mail and i.rectify
Glynn Clements
glynn.clements at virgin.net
Fri Dec 12 16:17:02 EST 2003
Ian Macmillan wrote:
> Hi all, this is only sort of a grass question, but I am hoping that someone will
> know the answer. I am using i.rectify a lot lately, and when it is running, it
> says that it will notify me by mail when it is finished. I am using mac os x
> and am not a UNIX whiz. I was wondering how to actually find out where that
> mail message goes, and how to go about checking it. The only way I know now if
> i.rectify finishes is to use my process viewer, and see when the process
> i.rectify is no longer running. Anybody out there know how this works? Thanks
> a lot.
It just invokes the "mail" command with the name of the current user:
sprintf (buf, "mail '%s'", G_whoami());
mail = popen (buf,"w");
G_whoami() gets the username with:
struct passwd *p;
if((p = getpwuid (getuid())))
name = G_store (p->pw_name);
getuid() returns the UID of the current process; historically,
getpwuid() obtained the entry for the specified UID from /etc/passwd,
although most modern Unices allow such requests to be handled by NIS
or similar.
In order for this to work on MacOSX, there are two requirements:
1. You need a working "mail" program. In turn, this will have
requirements of its own, i.e. a working local mail system. E.g. the
mailx package which is normally used on Linux runs "sendmail" to send
mail, so you need either sendmail or some other MTA which provides a
"sendmail" program (or script) which is at least minimally compatible
with sendmail.
2. getpwuid(getuid()) has to return a username which is acceptable to
the local mail system.
On a typical Unix system, both of the above can be safely taken for
granted. I wouldn't know about MacOSX, though.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-user
mailing list