Article View: news.software.nntp
Article #79753Re: news2mail script.
From: D. Stussy
Date: Sun, 23 Nov 2008 21:17
Date: Sun, 23 Nov 2008 21:17
153 lines
7952 bytes
7952 bytes
"Julien ΓLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:ggbb82$umo$1@news.trigofacile.com...
> > I use a modified version of the script which has a configuration file
that
> > has a THIRD parameter - SMTP envelope from address. Would this be
useful
> > to everyone/anyone?
> [...]
> > Why do that? Because some mailing lists (perhaps many, maybe
eventually
> > all) will only allow messages to the list that come from list members.
> > Therefore, the sending address needs to be a list member. Therefore,
what
> > I have is for "~news/etc/news2mail.conf" (not ".cf" - for consistency)
is:
> >
> > Newsfeeds-name List-to-address [List-sender-address]
> >
> > Newsfeeds-name: Name used in the newsfeeds file for the gateway feed
> > (required).
> > List-to-address: List address to send to (required).
> > List-sender-address: Envelope-From address to use (a list member's
> > address; optional, NEW).
>
> In fact, you want to change the meaning of the first parameter.
> Currently in newsfeeds:
>
> n2m!:!*:Acp,Tc,Wn*:<pathbin>/news2mail
> news-software-nntp@sender.org:news.software.nntp:Tm:n2m!
>
> And in news2mail.cf:
>
> news-software-nntp@sender.org address@list.org
>
> where the first parameter is the sender's address and the second one
> the address of the mailing-list.
When I looked at the script, it wasn't evident that such was being used
that way. It's ONLY use was that of a feed name from newsfeeds that must
match the first column entry from the news2mail configuration file. The
comments and examples suggested that it be used as the sending mailbox, but
such seems not to actually be used as such - and definently not as the
envelope sender. Its only use is that it was copied into the "To:" header!
The "To:" header should have the list's mailbox name, not the sender's
mailbox.
The original script passes three things to its mailto() function:
1) The article storage token.
2) An array of newsfeed feednames. (from)
3) An array of matching list names. (to)
The array of feednames isn't pruned to exclude entries that were absent
from the configuration file. The original script will pass the bad
(missing from configuration) feednames to the mailto() function. This
means that the two arrays will not be of equal number of elements.
Shouldn't they match? Regardless, one can really have only one sender per
message. To set this value to be the sending mailbox would also preclude
sending certain gated messages that CAN be sent as one message to multiple
lists from happening.
The original mailto() function forces "-fnews" to sendmail - thus forcing
the news user to be the envelope-from mailbox. That can be problematic for
sendmail - as it cannot look at the sending mailbox to determine delivery
(for messages from the list). What sendmail needs is either a separate
mailbox for every list or a fixed mailbox with a "plus" field to determine
its list->newsgroup mapping. Since the newsgroup->list mapping must set
the sender to the same address and not merely the "news" user (for lists
that require senders to be subscribers), the original script doesn't work.
My version passes the $sa variable instead to use as the sendmail "-f"
parameter instead of the hardcoded value. $sa defaults to the "news" user,
but picks up the third parameter from the configuration file for lists
where it is set.
One advantage here is that a message crossposted to multiple groups that
map to multiple lists CAN be sent as ONE e-mail message (with multiple
lists as recipients) as long as the destination lists do not require, or at
most only one of them does, the envelope-from to be set. As noted, the
case where two or more lists require that the envelope-from be set (even if
to the same value) is beyond my perl programming skills. Two or more lists
that require different sender values will need multiple messages,
presumedly with those that don't need such (3rd parameter from
configuration missing) combined into the first message/loop iteration. The
original script implies a 1-to-1 mapping: One SMTP message for every gated
article, even if crossposted and even if they could be combined. However,
the news2mail program is set up as a funneled channel in newsfeeds,
implying multiple matches should be handled as one - and multiple matching
funneled feeds will result in a single call to the script.
> Then you want to use the third (optional) parameter as the first one
> and allow to put the name you want in newsfeeds, which enables you to
have
> the same sender's address for several mailing-lists.
> And use it in the "-f" flag passed to sendmail.
>
> It is a useful improvement.
Setting the feed name for a list to be the sender's address is not
intuitive as to the identification of the mailing list. Setting the
feedname to a logically connected name is better. Example (new script):
newsfeeds:
list-bind-users/lists.isc.org:!*,comp.protocols.dns.bind:Ap,Tm:n2m!
n2m!:!*:Ac,Tc,Wn*:...news/bin/news2mail
news2mail.conf:
list-bind-users bind-users@lists.isc.org
news+bind-users@local_news_server
sendmail's virtusers:
news+bind-users@local_news_server comp.protocols.dns.bind.USENET
is much more intuitive than (original script usage):
newsfeeds:
bind-list@local_news_server/lists.isc.org:!*,comp.protocols.dns.bind:Ap,Tm:
n2m!
n2m!:!*:Ac,Tc,Wn*:...news/bin/news2mail
news2mail.conf:
bind-list@local_news_server bind-users@lists.isc.org
sendmail's virtusers:
news@local_news_server comp.protocols.dns.bind.USENET
(works if it's the ONLY group so gated. Otherwise, procmail must be used.)
(I do not actually gate the bind-users list, but isc.org does. Note the
use of "Ap" to protect the list from feeding back new arrivals from the
list; a suggestion that is missing from the original.)
> > 2) Hiding "Newsgroups:" header from mailing list, et. al.
>
> It is changed to X-Newsgroups:.
In my version, I prefer to hide that from the list completely. I see no
reason why this mapping should be revealed to the list, especialy when some
lists sem to be mapped to different groups by separate name servers (where
some are local groups only while others are propagated).
> > -#
> > -# the syslog calls are here but don't work on my system
> > -#
> > openlog('news2mail', 'pid', 'mail');
>
> It is true that it does not work on some systems. The patch is here:
>
http://inn.eyrie.org/viewcvs/trunk/backends/news2mail.in?r1=7687&r2=8183&view=patch
That one wasn't my comment but is present in the original script (INN
2.4.5).
Technical Details
Message-ID:
<ggch90$ad3$1@snarked.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder3.cambrium.nl!feed.tweaknews.nl!postnews.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!news.snarked.org!not-for-mailReferences:
<ggagf0$2ga$1@snarked.org> <ggbb82$umo$1@news.trigofacile.com>Show Full Headers
Complete Article Headers
Message-ID: <ggch90$ad3$1@snarked.org> Subject: Re: news2mail script. Date: Sun, 23 Nov 2008 13:17:07 -0800 From: "D. Stussy" <spam@bde-arc.ampr.org> References: <ggagf0$2ga$1@snarked.org> <ggbb82$umo$1@news.trigofacile.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder3.cambrium.nl!feed.tweaknews.nl!postnews.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!news.snarked.org!not-for-mail Newsgroups: news.software.nntp Lines: 153 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> NNTP-Posting-Host: pool-71-116-244-151.lsanca.dsl-w.verizon.net X-Trace: snarked.org 1227475041 10659 71.116.244.151 (23 Nov 2008 21:17:21 GMT) X-Complaints-To: newsmaster@snarked.org NNTP-Posting-Date: Sun, 23 Nov 2008 21:17:21 +0000 (UTC) X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478