Article View: news.software.nntp
Article #83462Re: Please consider this INN patch for mailpost
From: D. Stussy
Date: Thu, 30 Sep 2010 20:41
Date: Thu, 30 Sep 2010 20:41
158 lines
6638 bytes
6638 bytes
"Julien ΓLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message news:i82hhu$74b$1@news.trigofacile.com... > > 1) Adds a "-z" parameter to remove any undesired headers from the gated > > message. It also forces removal of the "Bcc:" header. Under SMTP, Bcc is > > permitted to exist with a blank RHS, but NNTP forbids a blank RHS for any > > header. (Without this patch for "Bcc:", the script was promoting it to > > "X-Bcc:" and leaving it in the article; a violation of the article format.) > > That's a nice idea, thanks! > > Also OK for the second one about Received: and *-To: headers. > > > > > @@ -80,7 +82,8 @@ > > } > > > > chop ($Mailname = `/bin/hostname`) if ! $Mailname ; > > - > > +$Gateway .= '|' . $INN::Config::pathhost if $INN::Config::pathhost; > > +$Gateway .= '|(.+\.)?' . $INN::Config::domain if $INN::Config::domain; > > > > # > > # Our command-line argument(s) are the list of newsgroups to post to. > > I would have added: > > chop ($Gateway = `/bin/hostname`) if ! $Gateway ; > > the same way it is done for $Mailname. I specifically left that out for one reason: Virtual hosting. The /bin/hostname name may not be the same name as the news server, nor even under the same domain name. We could add another command line parameter to exclude additional hostnames if necessary. On my system, my news server is "news.snarked.org", but /bin/hostname returns only "snarked.org" which has no DNS address-type records. However, while the script is running, the name from the TCP socket might be "localhost" if it's using the loopback interface to connect between mail and news. The only certain exclusions were those names from the "etc/inn.conf" file declarations. > I would also have changed: > > -my $exclude = 'Organization|Distribution'; > +my $exclude = > 'Archive|Archived-At|Comments|Distribution|Keywords|Organization|Summary'; I didn't do that because if the message was first gated from news to mail and is being gated back (why, I don't know) for some reason, the message may already have these headers present, and I saw no reason not to preserve them. > and update the documentation as follows: > -- note that there was a mistake about the Approved: header. It was not a known > header because it was renamed by default to "X-Approved". I might have missed that too, or intentionally ignored that. It's been 5 weeks since I posted the suggestion, so it's no longer fresh on my mind. > @@ -629,7 +643,8 @@ > B<mailpost> [B<-hn>] [B<-a> I<addr>] [B<-b> I<database>] [B<-c> I<wait-time>] > [B<-d> I<distribution>] [B<-f> I<addr>] [B<-m> I<mailing-list>] > [B<-o> I<output-command>] [B<-p> I<port>] [B<-r> I<addr>] > -[B<-x> I<header>[B<:>I<header>...]] I<newsgroups> > +[B<-x> I<header>[B<:>I<header>...]] [B<-z> I<header>[B<:>I<header>...]] > +I<newsgroups> > > =head1 DESCRIPTION > > @@ -638,12 +653,14 @@ > whitespace-separated list of group names to which to post the article > (at least one newsgroup must be specified). > > -Before feeding the article to B<inews>, it checks that the article has not > -been seen before, and it changes some headers (cleans up some address > -headers, removes X-Trace: and X-Complaints-To:, and puts C<X-> in front > -of unknown headers). > +Before feeding the article to B<inews>, it checks that the article has > +not been seen before, and it changes some headers (cleans up some address > +headers, removes a few ones, and puts C<X-> in front of unknown headers). > +The Received: and *-To: headers are also stripped out to prevent spamming Actually, the "Received" header is not stripped out, but it is altered to delete the "FOR _mailbox_" clause (capitals=literal, underscore=variable, which may or may not have surrounding "<>"). Only those "for" clauses which contain a mailbox of a domain in "$Gateway" are altered. Similarly with those "*-To:" headers - only those containing a substring (domain) in "$Gateway" are stripped. This is meant to target the deprecated DSN-type headers like "Errors-To:", specific routing via "%" (also deprecated but still supported by some MTAs), or SRS, where the sending/rewritten/routing mailbox has the recipient domain as a substring of the user component of the mailbox. > +the gateway (the name of the news server or the domain name from F<inn.conf> > +are removed). > > If the article has been seen before (B<mailpost> records the Message-ID of > each article it handles), then the article will be dropped with a non-zero > @@ -730,19 +745,34 @@ > > Known headers are: > > - Approved > + Archive > + Archived-At > + Comments > Content-* > Date > Distribution > From > + Keywords > Mailing-List > Message-ID > MIME-* > + Organization > References > Return-Path > Sender > Subject > + Summary > > +=item B<-z> I<header>[B<:>I<header>...] > + > +A colon-separated list of additional headers which should be removed. > + > +By default, removed headers are: > + > + Bcc > + X-Trace > + X-Complaints-To > + > =back > > =head1 FILES Same comment as above regarding news->mail->news gating. > Do these changes look good to you? See above.
Technical Details
Message-ID:
<i82sm5$9g3$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.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.glorb.com!news.snarked.org!pool-71-106-210-230.lsanca.dsl-w.verizon.net!not-for-mailReferences:
<i4s5et$6km$1@snarked.org> <i82hhu$74b$1@news.trigofacile.com>Show Full Headers
Complete Article Headers
Message-ID: <i82sm5$9g3$1@snarked.org> Subject: Re: Please consider this INN patch for mailpost Date: Thu, 30 Sep 2010 13:41:30 -0700 From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> References: <i4s5et$6km$1@snarked.org> <i82hhu$74b$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.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.glorb.com!news.snarked.org!pool-71-106-210-230.lsanca.dsl-w.verizon.net!not-for-mail Newsgroups: news.software.nntp Lines: 158 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> Injection-Date: Thu, 30 Sep 2010 20:41:42 +0000 (UTC) Injection-Info: snarked.org; posting-host="pool-71-106-210-230.lsanca.dsl-w.verizon.net:71.106.210.230"; logging-data="9731"; mail-complaints-to="newsmaster+complaints@snarked.org" X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 X-Original-Bytes: 6469