From: utzoo!decvax!ittvax!swatt
Newsgroups: net.news.b
Title: sendnewsmail problem
Article-I.D.: ittvax.385
Posted: Fri Jul 16 10:54:00 1982
Received: Sat Jul 17 01:52:50 1982

	From decvax!harpo!floyd!trb Thu Jul 15 23:36:51 1982
	Date: Thu Jul 15 21:35:56 1982
	To: harpo!decvax!ittvax!swatt
	Subject: sendnewsmail problem
	
	It seems that the sendnewsmail checks for problems by fiddling thusly:
	
		: 'Submit the article to news'
		if sed "1,/^$/d" $tempf | inews -t "$title" \
			-n $newsgroup >$errorf 2>&1
		...
	
	inews, however, seems to be doing its nasties in the background
	and the error path of the if is NEVER taken.  I can't think of
	an easy solution, am I missing something?

		Andy Tannenbaum   Bell Labs  Whippany, NJ   (201)
		386-6491


Hmm..  I wasn't aware of this.  The script dates from the days of 
"A" news, in which the analogous command would  return  an  error
status  and  the  submitter  would get the errors plus the entire
article mailed back.  Since inews forks a child to do the  grunge
work  of  inserting  a  new  article,  this strategy is no longer
sound.  Inews is supposed to save articles  in  the  user's  base
directory  on  error,  but it would still be nice if the user got
mail notification of that fact.  Inews probably needs to have  an
option  to NOT do things in the background for just such cases of
interface with other programs.  

There is another problem that just surfaced with 2.8 releases  of
news.   You  can't  use  "sendnewsmail"  if  you have a recording
file.   There  is  an  undocumented  "-D"  flag  to  inews  which
unconditionally  ignores  recording  files.   Inews  should  also
ignore recording files if input is not a tty.  There are probably 
other places where inews makes the assumption of being run from a 
terminal.  

How about the following strategy:

  If input is NOT a terminal, then:

     DON'T ask about recording files.
     DON'T do insertion in the background; return final status
     DO accept an option to mail errors + article back to the
	user on failure to insert.

Or maybe these could all  be  separately  triggered  options.   I
don't  really  care,  just  so I can set up the alias command for
delivermail to do the right thing.  

This is a general problem with interactive  programs:  you  can't
possibly  supply  all the features people want.  I have found the
program alias feature of delivermail so powerful I use it all the 
time.   This  gives  me  ONE  user  interface   to   just   about
everything.   Naturally,  I  sympathize with all those people who
don't have delivermail, but I don't see any reason why  I  should
have  to  suffer  along with them.  The design of inews, and just
about every other interactive program (I make  an  exception  for
say,  "vi")  should  be  able  to  work  harmoniously when run by
another program instead of a user.  

	- Alan S. Watt