[comp.mail.mush] dead.letter twist

davison@drivax.UUCP (Wayne Davison) (09/02/89)

Here's a twist on the handling of "dead.letter" that I just noticed NN
using:  when a dead letter is produced, the previous contents of dead.letter
are first appended to the file "dead.letters", leaving only the most recent
failure in dead.letter.  This is kinda nice, if only to save you a little
editing when processing the last dead message.  If you don't get around to
it quick enough, you'll find it concatenated, as usual, but in dead.letters.
It's even easy to just remove the dead.letter file, without affecting any
previous dead.letters that you wanted to keep around a bit.

Anybody else like this idea?  Anyone want to see it supported in mush?
Or is there some way to do it already?
-- 
Wayne Davison          \  /| / /| \/ /| /(_)         davison@drivax.UUCP
                      (_)/ |/ /\| / / |/  \          ...!amdahl!drivax!davison

schaefer@ogccse.ogc.edu (Barton E. Schaefer) (09/04/89)

In article <24FF7EB4.54ED@drivax.UUCP> davison@drivax.UUCP (Wayne Davison) writes:
} Here's a twist on the handling of "dead.letter" that I just noticed NN
} using:  when a dead letter is produced, the previous contents of dead.letter
} are first appended to the file "dead.letters", leaving only the most recent
} failure in dead.letter.  This is kinda nice, if only to save you a little
} editing when processing the last dead message.
} 
} Anybody else like this idea?  Anyone want to see it supported in mush?
} Or is there some way to do it already?

You can always

	set dead = '|dead.script'

where dead.script is something similar to

	#! /bin/sh
	dead=$HOME/dead.letter
	if [ -f $dead ]
	then
	    touch ${dead}s	# create it if it isn't there
	    cat $dead >> ${dead}s
	fi
	cat > $dead

Of course you probably want to make it a little more careful than that.
-- 
Bart Schaefer           "And if you believe that, you'll believe anything."
                                                            -- DangerMouse
CSNET / Internet                schaefer@cse.ogc.edu
UUCP                            ...{sequent,tektronix,verdix}!ogccse!schaefer

davison@drivax.UUCP (Wayne Davison) (09/06/89)

schaefer@ogccse.ogc.edu (Barton E. Schaefer) writes:
>You can always
>	set dead = '|dead.script'

Nice idea, if it worked.  Apparently, the pipe character is not implemented
in the dead.letter handling, so I threw in a quick fix:

*** mail.c.orig	Sat Jul  1 12:25:10 1989
--- mail.c	Tue Sep  5 22:13:46 1989
***************
*** 1836,1842 ****
  	return;
      if (!(p = do_set(set_options, "dead")))
  	p = "~/dead.letter";
!     if (!(dead = open_file(p, FALSE)))
  	return;
      (void) time (&t);
      fflush(ed_fp);
--- 1836,1842 ----
  	return;
      if (!(p = do_set(set_options, "dead")))
  	p = "~/dead.letter";
!     if (!(dead = open_file(p+(*p=='|'), (*p=='|'))))
  	return;
      (void) time (&t);
      fflush(ed_fp);

Then it works great.  Thanx.
-- 
Wayne Davison          \  /| / /| \/ /| /(_)         davison@drivax.UUCP
                      (_)/ |/ /\| / / |/  \          ...!amdahl!drivax!davison