swatt (07/16/82)
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
mark (07/17/82)
inews is supposed to not fork if the input is not coming from a tty, so sendnewsmail shouldn't be forking inews. This does not, of course, mean that some bug isn't causing inews to get forked. The recording problem is more serious. It applies to delivermail+recnews as well as sendnewsmail. recnews could use the -D flag, but this would defeat the purpose of recording - if someone routinely uses mail (or emacs or his favorite user interface) to post articles, he will never be warned about what he isn't supposed to post. The same problem happened when inews wouldn't create a new newsgroup without asking permission unless it was in the background, and the problem was solved by just making it bomb out. I don't have a good solution here - if someone does, please speak out. Mark