[news.software.nn] INEWS: adding a blank line before headers on moderated mail

bill@twg.bc.ca (Bill Irwin) (05/21/91)

I have recently configured two local newsgroups which are fed
from mail lists, as moderated newsgroups.  I did this to allow
the post/followup function to mail postings to the list
distribution address, rather than requiring users to remember a
mail address.  The only glitch I seem to have is with inews
mailing the posting.

When inews processes the posted article it: checks the active
file and notices that the newsgroup is moderated; determines that
there is no "Approved:" header in the article;  reads the
mailpaths file looking for an entry for the newsgroup or
"backbone", whichever comes first;  determines from the mailpaths
entry the address of the "moderator" (in this case the mail list
distribution address);  mails the article to the moderator.  It
is this last step that is causing the problem.

Whatever method inews is using to mail the article is causing the
entire article (headers and all) to be treated as mail body,
rather than the header lines being used as header lines.  The
result is a few header lines produced by Smail2.5, a BLANK LINE,
then the article headers and text.  Since the article Subject:
header comes after the blank line, the mail appears to have no
Subject:  line.  An example of a posting to a moderated group
that has my mail address as the moderator, produces the following
into my mailbox:

: From bill Mon May 20 16:02:50 1991      --------+
: Received: by twg.bc.ca (smail2.5)               |
:         id AA08221; 20 May 91 16:02:49 PDT (Mon)|
: To: bill                                        | Smail headers
: Date: Mon May 20 16:02:49 1991                  |
: Message-Id: <9105201602.AA08221@twg.bc.ca>      |
: From: bill@twg.bc.ca (Bill Irwin)       --------+
:                                            <-- Mystery blank line
: To: bill                                --------+
: Path: twg!bill                                  |
: From: bill@twg.bc.ca (Bill Irwin)               |
: Newsgroups: twg.uug-list                        |
: Subject: test recmail mailer                    | Article
: Message-ID: <2117@twg.bc.ca>                    | headers
: Date: 20 May 91 23:02:45 GMT                    |
: Reply-To: bill@twg.bc.ca (Bill Irwin)           |
: Distribution: local                             |
: Organization: The Westrheim Group, Vancouver, B.C., Canada
: Lines: 7                                --------+
:
:
: Article text
: text

I have tested piping an article to Bnews recmail, Smail2.5's
replacement for /usr/lib/mail/execmail, and directly to smail.  None
of these three methods treats the article headers as mail text.  In
the Bnews defs.h file, I have sendmail undefined because I don't use
sendmail, but I do not see where/how Bnews is being instructed on what
mailer to use.  I don't know C well enough to determine the answer to
this from looking at inews.c.

What I need are suggestions on how to get inews to send its mail a
little differently, so that the headers which are part of the article
are seen and interpreted as headers by execmail/smail.
-- 
Bill Irwin    -       The Westrheim Group     -    Vancouver, BC, Canada
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uunet!van-bc!twg!bill     (604) 431-9600 (voice) |     Your Computer  
bill@twg.bc.ca            (604) 430-4329 (fax)   |    Systems Partner

bill@twg.bc.ca (Bill Irwin) (05/21/91)

Well, I've done some more hacking and found that inews is
definately using the "mail" program, which in my case is
"/usr/bin/mail".  When I renamed it and posted to a local
moderated group, inews choked.

I found some code in the Bnews program "control.c" that seems to
be testing for sendmail or mmdf.  If these aren't defined it
resorts to various flavours of "mail".  I replaced the definition
for "mail" with a definition for "smail", recompiled and posted
to the newsgroup again.  This time, the article headers were
interpretted by smail as being part of the mail and the mailed
article had no corrupting blank line in the middle of the
headers.

It would appear as though the problem is resolved, but I have a
little voice that keeps asking me what else I just broke by
actually hacking the C source for Bnews.  It does seem like a
rather drastic measure.  I included the piece of code I changed
and ask that if anyone sees any potential problem with it, that
they speak up.

----- portion of code from control.c -------------------

#ifdef SENDMAIL
                execl(SENDMAIL, "sendmail", "-oi", "-oeq", sendto, (char *)NULL);
#endif /* SENDMAIL */
#ifdef MMDF
                execl(MMDF, "inews-mail", "-smuxto,cc*", (char *)NULL);
#endif /* MMDF */

was this -->    /*execl("/usr/bin/mail", "mail", sendto, (char *)NULL);*/
now this -->    execl("/usr/bin/smail", "smail", sendto, (char *)NULL);
                execl("/usr/ucb/mail", "mail", sendto, (char *)NULL);
                execl("/bin/mail", "mail", sendto, (char *)NULL);
                execl("/usr/bin/mailx", "mail", sendto, (char *)NULL);
                _exit(1);
-- 
Bill Irwin    -       The Westrheim Group     -    Vancouver, BC, Canada
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uunet!van-bc!twg!bill     (604) 431-9600 (voice) |     Your Computer  
bill@twg.bc.ca            (604) 430-4329 (fax)   |    Systems Partner