Article View: news.software.nntp
Article #83460Re: Please consider this INN patch for mailpost
From: Julien ÉLIE
Date: Thu, 30 Sep 2010 17:31
Date: Thu, 30 Sep 2010 17:31
121 lines
4822 bytes
4822 bytes
Hi Dieter,
> 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 would also have changed:
-my $exclude = 'Organization|Distribution';
+my $exclude =
'Archive|Archived-At|Comments|Distribution|Keywords|Organization|Summary';
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".
@@ -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
+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
Do these changes look good to you?
--
Julien ÉLIE
« Nos modernes Josué littéraires crient vainement à la langue de s'arrêter ;
les langues ni le Soleil ne s'arrêtent plus. Le jour où elles se fixent,
c'est qu'elles meurent. » (Victor Hugo, Préface de _Cromwell_)
Technical Details
Message-ID:
<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.ams.giganews.com!nntp.giganews.com!weretis.net!feeder4.news.weretis.net!news.trigofacile.com!.POSTED.aaubervilliers-151-1-48-199.w83-114.abo.wanadoo.fr!not-for-mailReferences:
<i4s5et$6km$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <i82hhu$74b$1@news.trigofacile.com> Subject: Re: Please consider this INN patch for mailpost Date: Thu, 30 Sep 2010 19:31:40 +0200 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <i4s5et$6km$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!weretis.net!feeder4.news.weretis.net!news.trigofacile.com!.POSTED.aaubervilliers-151-1-48-199.w83-114.abo.wanadoo.fr!not-for-mail Newsgroups: news.software.nntp Organization: TrigoFACILE -- http://www.trigofacile.com/ Lines: 121 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 8bit Injection-Date: Thu, 30 Sep 2010 17:31:42 +0000 (UTC) Injection-Info: news.trigofacile.com; posting-host="aaubervilliers-151-1-48-199.w83-114.abo.wanadoo.fr:83.114.132.199"; logging-data="7307"; mail-complaints-to="abuse@trigofacile.com" In-Reply-To: <i4s5et$6km$1@snarked.org> X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18263