[GRASSLIST:2043] mail and i.rectify

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.

-i

PS I love GRASS, thanks to all who make it work.

There is an invisible startup file in your home folder called .grassrc5. You can disable the mail thing by adding a line to it:

GRASS_STDERR: 1

BBEdit can open invisible files, otherwise use something like TinkerTool to temporarily make it visible and use another text editor (you may need to remove the leading dot to edit it, and make sure you use Plain Text, UNIX line endings). Argh, this is getting messy for trying to do this with non-command-line stuff. If you know how to use one of the CLI editors (I don't), that would be another method. Maybe someone else knows a simple CLI command to add a line to a file.

I think you also need to have a log file present, so in the Terminal type:

touch ~/GIS_ERROR_LOG

Now, errors and status will not be mailed - status should go to the terminal, while errors go to GIS_ERROR_LOG.

On Dec 12, 2003, at 1:29 PM, 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.

-i

PS I love GRASS, thanks to all who make it work.

-----
William Kyngesburye <kyngchaos@charter.net>
http://webpages.charter.net/kyngchaos/

First Pogril: Why is life like sticking your head in a bucket filled with hyena offal?
Second Pogril: I don't know. Why IS life like sticking your head in a bucket filled with hyena offal?
First Pogril: I don't know either. Wretched, isn't it?

-HitchHiker's Guide to the Galaxy

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@virgin.net>

Mac OS X has mail and sendmail BUT if I recall correctly, by default sendmail is not configured to be able to do anything.

Actually, OS 10.2 and lower have sendmail. There are sites out there on how to configure, e.g. http://www.bombich.com/mactips/sendmail.html

OS 10.3 came with Postfix instead, but it emulates sendmail. It also does not seem to be set up right to send mail "out of the box". I see there are instructions to fix it at http://www.macosxhints.com/article.php?story=20031025022626398 - I have not tried this myself.

Scott Mitchell

On Dec 12, 2003, at 16:17, Glynn Clements wrote:

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

...

It just invokes the "mail" command with the name of the current user:

...

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@virgin.net>

----
Scott Mitchell, Assistant Professor, Carleton University
Department of Geography & Environmental Studies, Loeb A209
Mailing: Loeb B349, 1125 Colonel By Dr., Ottawa, ON K1S 5B6 Canada
1-613-520-2600 x2695 Fax: 613-520-4301 Scott_Mitchell@carleton.ca

There is an invisible startup file in your home folder called
.grassrc5. You can disable the mail thing by adding a line to it:

GRASS_STDERR: 1

BBEdit can open invisible files, otherwise use something like
TinkerTool to temporarily make it visible and use another text editor
(you may need to remove the leading dot to edit it, and make sure you
use Plain Text, UNIX line endings). Argh, this is getting messy for
trying to do this with non-command-line stuff. If you know how to use
one of the CLI editors (I don't), that would be another method. Maybe
someone else knows a simple CLI command to add a line to a file.

May I recommend the nedit package from Fink. (I imagine vi would only
upset someone who purchased a Mac.)

H