[net.sources.d] checkmail

tom@rsch.wisc.edu (Thomas Scott Christiansen) (08/04/86)

>           checkmail
>           if ($status != 0) then
>                mail &
>           endif

wouldn't you rather it exited 0 ( == success ) if it FINDS something,
not if it fails?  admittedly, unix programs seem to have opposite
return values ( 0 == ok, ~0 = ~ok ), but given this model, why not
stick to it?

the above code would have been more consisely written

		if ! { checkmail } mail &

or, given standard exit conventions, 

		if { checkmail } mail &

silvert@dalcs.UUCP (Bill Silvert) (08/19/86)

(1) so far as touching an empty file to keep track of when you last
checked your mail, why not just touch .mailrc, assuming you use it?

(2) the checking of dates is easily incorporated in the PD checkmail
that was recently posted to the net.  Use stat(mailbox, &buf) to get the
dates of the mailbox and the comparison file (I use .mailrc), and
depending on the order of buf.st_ctime notify the user of new or old
mail.  I touch $HOME/.mailrc in my .login and .logout files, so that when
I login I know whether mail has arrived since I last logged off.

guy@enmasse.UUCP (One Hip Dude) (08/24/86)

In article <1550@vax135.UUCP> cjp@vax135.UUCP (Charles Poirier) writes:

>If one isn't using that silly csh, one can simply do "> .m" to create .m.


I've had this alias since the first day I used csh:
	
	alias ">"	"cat /dev/null >"

Big deal, huh?
-- 
                                           -- guy k hillyer
{decvax!genrad,harvard!talcott}!panda!enmasse!guy
                                panda!enmasse!guy@talcott.arpa

taylor@hplabsc.UUCP (Dave Taylor) (08/28/86)

Bill Silvert suggests using the ".mailrc" file to keep track of the last
time you checked for mail programmatically.

Well...this is not a real good technique since evil things can happen when
the user decides to edit their `.mailrc' file.  Instead, I recommend
people using "newmail" or "wnewmail" from the Elm Mail System package,
available through your local mod.sources site :-)

Ah! You say, How often do people touch their .mailrc file?  You'd be
suprised...IF I were using a mailer that used a .mailrc file I'd be
changing it weekly - since I have a LOT of aliases and am constantly
changing them as people move, as new routes turn out to be better, and
as I find new people worth keeping track of...

					-- Dave Taylor

			unbiased author of the Elm Mail System