INN commit: branches/2.4 (7 files)
INN Commit
Russ_Allbery at isc.org
Thu Jun 5 18:51:20 UTC 2008
Date: Thursday, June 5, 2008 @ 11:51:20
Author: iulius
Revision: 7858
Add access to several new headers within Perl and Python hooks for innd.
Thanks to Matija Nalis for the patch.
Also update the POD documentation and the Python sample.
Modified:
branches/2.4/doc/hook-perl
branches/2.4/doc/hook-python
branches/2.4/doc/pod/hook-perl.pod
branches/2.4/doc/pod/hook-python.pod
branches/2.4/innd/innd.c
branches/2.4/innd/innd.h
branches/2.4/samples/filter_innd.py
-------------------------+
doc/hook-perl | 68 +++++++++++++++++------------
doc/hook-python | 49 +++++++++++++--------
doc/pod/hook-perl.pod | 64 ++++++++++++++++-----------
doc/pod/hook-python.pod | 44 ++++++++++++-------
innd/innd.c | 58 ++++++++++++++++++++++++-
innd/innd.h | 31 ++++++++++++-
samples/filter_innd.py | 106 +++++++++++++++++++++++++++++++++++-----------
7 files changed, 305 insertions(+), 115 deletions(-)
Modified: doc/hook-perl
===================================================================
--- doc/hook-perl 2008-06-05 18:35:54 UTC (rev 7857)
+++ doc/hook-perl 2008-06-05 18:51:20 UTC (rev 7858)
@@ -1,6 +1,7 @@
INN Perl Filtering and Authentication Support
- This is $Revision$ dated $Date$.
+ This is $Revision$ dated $Date: 2003-02-10 04:21:27 +0100 (lun,
+ 10 fév 2003) $.
This file documents INN's built-in support for Perl filtering and reader
authentication. The code is based very heavily on work by Christophe
@@ -83,34 +84,45 @@
of the standard headers present in the article and their values. The
standard headers are:
- Approved, Control, Date, Distribution, Expires, From, Lines,
- Message-ID, Newsgroups, Path, Reply-To, Sender, Subject,
- Supersedes, Bytes, Also-Control, References, Keywords, X-Trace,
- NNTP-Posting-Host, Followup-To, Organization, Content-Type,
- Content-Base, Content-Disposition, X-Newsreader, X-Mailer,
- X-Cancelled-By, X-Canceled-By, Cancel-Key
+ Also-Control, Approved, Bytes, Cancel-Key, Cancel-Lock,
+ Content-Base, Content-Disposition, Content-Transfer-Encoding,
+ Content-Type, Control, Date, Date-Received, Distribution, Expires,
+ Face, Followup-To, From, In-Reply-To, Injection-Date, Injection-Info,
+ Keywords, Lines, List-ID, Message-ID, MIME-Version, Newsgroups,
+ NNTP-Posting-Date, NNTP-Posting-Host, Organization, Originator,
+ Path, Posted, Posting-Version, Received, References, Relay-Version,
+ Reply-To, Sender, Subject, Supersedes, User-Agent,
+ X-Auth, X-Canceled-By, X-Cancelled-By, X-Complaints-To, X-Face,
+ X-HTTP-UserAgent, X-HTTP-Via, X-Mailer, X-Modbot, X-Modtrace,
+ X-Newsposter, X-Newsreader, X-No-Archive, X-Original-Message-ID,
+ X-Original-Trace, X-Originating-IP, X-PGP-Key, X-PGP-Sig,
+ X-Poster-Trace, X-Postfilter, X-Proxy-User, X-Submissions-To,
+ X-Trace, X-Usenet-Provider, Xref.
- (so, for example, the Newsgroups header of the article is accessible
- inside the Perl filter as $hdr{Newsgroups}). In addition,
- $hdr{__BODY__} will contain the full body of the article and
- $hdr{__LINES__} will contain the number of lines in the body of the
- article.
+ Note that all the above headers are as they arrived, not modified by
+ your INN (especially, the Xref: header, if present, is the one of the
+ remote site which sent you the article, and not yours).
+ For example, the Newsgroups: header of the article is accessible inside
+ the Perl filter as $hdr{'Newsgroups'}. In addition, $hdr{'__BODY__'}
+ will contain the full body of the article and $hdr{'__LINES__'} will
+ contain the number of lines in the body of the article.
+
The contents of the %hdr hash for a typical article may therefore look
something like this:
- %hdr = (Subject => 'MAKE MONEY FAST!!',
- From => 'Joe Spamer <him at example.com>',
- Date => '10 Sep 1996 15:32:28 UTC',
- Newsgroups => 'alt.test',
- Path => 'news.example.com!not-for-mail',
- Organization => 'Spammers Anonymous',
- Lines => '5',
- Distribution => 'usa',
- 'Message-ID' => '<6.20232.842369548 at example.com>',
- __BODY__ => 'Send five dollars to the ISC, c/o ...',
- __LINES__ => 5
- );
+ %hdr = (Subject => 'MAKE MONEY FAST!!',
+ From => 'Joe Spamer <him at example.com>',
+ Date => '10 Sep 1996 15:32:28 UTC',
+ Newsgroups => 'alt.test',
+ Path => 'news.example.com!not-for-mail',
+ Organization => 'Spammers Anonymous',
+ Lines => '5',
+ Distribution => 'usa',
+ 'Message-ID' => '<6.20232.842369548 at example.com>',
+ __BODY__ => 'Send five dollars to the ISC, c/o ...',
+ __LINES__ => 5
+ );
Note that the value of $hdr{Lines} is the contents of the Lines: header
of the article and may bear no resemblence to the actual length of the
@@ -164,9 +176,9 @@
arguments and returns no value, but it has access to a global hash %mode
that contains three values:
- Mode The current server mode (throttled, paused, or running)
- NewMode The new mode the server is going to
- reason The reason that was given to ctlinnd
+ Mode The current server mode (throttled, paused, or running)
+ NewMode The new mode the server is going to
+ reason The reason that was given to ctlinnd
One possible use for this function is to save filter state across a
restart of innd. There isn't any Perl function which is called when INN
@@ -346,7 +358,7 @@
Scripts (like those from the old mechanism) are listed in readers.conf
using perl_auth in the same manner other authenticators are using auth:
- perl_auth: "/path/to/script/auth1.pl"
+ perl_auth: "/path/to/script/auth1.pl"
The file given as argument to perl_auth should contain the same
procedures as before. The global hash %attributes remains the same,
Modified: doc/hook-python
===================================================================
--- doc/hook-python 2008-06-05 18:35:54 UTC (rev 7857)
+++ doc/hook-python 2008-06-05 18:51:20 UTC (rev 7858)
@@ -1,6 +1,7 @@
INN Python Filtering and Authentication Support
- This is $Revision$, dated $Date$.
+ This is $Revision$, dated $Date: 2005-03-05 22:19:44 +0100 (sam,
+ 05 mar 2005) $.
This file documents INN's built-in optional support for Python article
filtering. It is patterned after the TCL and Perl hooks previously
@@ -68,24 +69,38 @@
method is called every time innd receives an article. The following
can be defined:
- Approved, Control, Date, Distribution, Expires, From, Lines,
- Message-ID, Newsgroups, Path, Reply-To, Sender, Subject,
- Supersedes, Bytes, Also-Control, References, Xref, Keywords,
- X-Trace, NNTP-Posting-Host, Followup-To, Organization,
- Content-Type, Content-Base, Content-Disposition, X-Newsreader,
- X-Mailer, X-Newsposter, X-Cancelled-By, X-Canceled-By, Cancel-Key,
- __LINES__, __BODY__
+ Also-Control, Approved, Bytes, Cancel-Key, Cancel-Lock,
+ Content-Base, Content-Disposition, Content-Transfer-Encoding,
+ Content-Type, Control, Date, Date-Received, Distribution, Expires,
+ Face, Followup-To, From, In-Reply-To, Injection-Date, Injection-Info,
+ Keywords, Lines, List-ID, Message-ID, MIME-Version, Newsgroups,
+ NNTP-Posting-Date, NNTP-Posting-Host, Organization, Originator,
+ Path, Posted, Posting-Version, Received, References, Relay-Version,
+ Reply-To, Sender, Subject, Supersedes, User-Agent,
+ X-Auth, X-Canceled-By, X-Cancelled-By, X-Complaints-To, X-Face,
+ X-HTTP-UserAgent, X-HTTP-Via, X-Mailer, X-Modbot, X-Modtrace,
+ X-Newsposter, X-Newsreader, X-No-Archive, X-Original-Message-ID,
+ X-Original-Trace, X-Originating-IP, X-PGP-Key, X-PGP-Sig,
+ X-Poster-Trace, X-Postfilter, X-Proxy-User, X-Submissions-To,
+ X-Trace, X-Usenet-Provider, Xref, __BODY__, __LINES__.
- All the above values will be buffer objects holding the contents of
- the same named article headers, except for the special __BODY__ and
- __LINES__ items. Items not present in the article will contain
- None.
+ Note that all the above values are as they arrived, not modified by
+ your INN (especially, the Xref: header, if present, is the one of
+ the remote site which sent you the article, and not yours).
- __BODY__ is a buffer object containing the article's entire body,
- and __LINES__ is an int holding innd's reckoning of the number of
- lines in the article. All the other elements will be buffers with
- the contents of the same-named article headers.
+ These values will be buffer objects holding the contents of the same
+ named article headers, except for the special "__BODY__" and
+ "__LINES__" items. Items not present in the article will contain
+ "None".
+ "art('__BODY__')" is a buffer object containing the article's entire
+ body, and "art('__LINES__')" is an int holding innd's reckoning of
+ the number of lines in the article. All the other elements will be
+ buffers with the contents of the same-named article headers.
+
+ The Newsgroups: header of the article is accessible inside the
+ Python filter as "art['Newsgroups']".
+
If you want to accept an article, return None or an empty string.
To reject, return a non-empty string. The rejection strings will be
shown to local clients and your peers, so keep that in mind when
@@ -276,7 +291,7 @@
listed in readers.conf using python_auth in the same manner other
authenticators are using auth:
- python_auth: "auth1.py"
+ python_auth: "auth1.py"
Scripts should be placed as before in the filter directory (see the
*pathfilter* setting in inn.conf). The new hook method authen_init takes
Modified: doc/pod/hook-perl.pod
===================================================================
--- doc/pod/hook-perl.pod 2008-06-05 18:35:54 UTC (rev 7857)
+++ doc/pod/hook-perl.pod 2008-06-05 18:51:20 UTC (rev 7858)
@@ -83,34 +83,46 @@
the standard headers present in the article and their values. The
standard headers are:
- Approved, Control, Date, Distribution, Expires, From, Lines,
- Message-ID, Newsgroups, Path, Reply-To, Sender, Subject,
- Supersedes, Bytes, Also-Control, References, Keywords, X-Trace,
- NNTP-Posting-Host, Followup-To, Organization, Content-Type,
- Content-Base, Content-Disposition, X-Newsreader, X-Mailer,
- X-Cancelled-By, X-Canceled-By, Cancel-Key
+ Also-Control, Approved, Bytes, Cancel-Key, Cancel-Lock,
+ Content-Base, Content-Disposition, Content-Transfer-Encoding,
+ Content-Type, Control, Date, Date-Received, Distribution, Expires,
+ Face, Followup-To, From, In-Reply-To, Injection-Date, Injection-Info,
+ Keywords, Lines, List-ID, Message-ID, MIME-Version, Newsgroups,
+ NNTP-Posting-Date, NNTP-Posting-Host, Organization, Originator,
+ Path, Posted, Posting-Version, Received, References, Relay-Version,
+ Reply-To, Sender, Subject, Supersedes, User-Agent,
+ X-Auth, X-Canceled-By, X-Cancelled-By, X-Complaints-To, X-Face,
+ X-HTTP-UserAgent, X-HTTP-Via, X-Mailer, X-Modbot, X-Modtrace,
+ X-Newsposter, X-Newsreader, X-No-Archive, X-Original-Message-ID,
+ X-Original-Trace, X-Originating-IP, X-PGP-Key, X-PGP-Sig,
+ X-Poster-Trace, X-Postfilter, X-Proxy-User, X-Submissions-To,
+ X-Trace, X-Usenet-Provider, Xref.
-(so, for example, the Newsgroups header of the article is accessible
-inside the Perl filter as C<$hdr{Newsgroups}>). In addition,
-C<$hdr{__BODY__}> will contain the full body of the article and
-C<$hdr{__LINES__}> will contain the number of lines in the body of the
+Note that all the above headers are as they arrived, not modified by
+your INN (especially, the Xref: header, if present, is the one of
+the remote site which sent you the article, and not yours).
+
+For example, the Newsgroups: header of the article is accessible
+inside the Perl filter as C<$hdr{'Newsgroups'}>. In addition,
+C<$hdr{'__BODY__'}> will contain the full body of the article and
+C<$hdr{'__LINES__'}> will contain the number of lines in the body of the
article.
The contents of the %hdr hash for a typical article may therefore look
something like this:
- %hdr = (Subject => 'MAKE MONEY FAST!!',
- From => 'Joe Spamer <him at example.com>',
- Date => '10 Sep 1996 15:32:28 UTC',
- Newsgroups => 'alt.test',
- Path => 'news.example.com!not-for-mail',
- Organization => 'Spammers Anonymous',
- Lines => '5',
- Distribution => 'usa',
- 'Message-ID' => '<6.20232.842369548 at example.com>',
- __BODY__ => 'Send five dollars to the ISC, c/o ...',
- __LINES__ => 5
- );
+ %hdr = (Subject => 'MAKE MONEY FAST!!',
+ From => 'Joe Spamer <him at example.com>',
+ Date => '10 Sep 1996 15:32:28 UTC',
+ Newsgroups => 'alt.test',
+ Path => 'news.example.com!not-for-mail',
+ Organization => 'Spammers Anonymous',
+ Lines => '5',
+ Distribution => 'usa',
+ 'Message-ID' => '<6.20232.842369548 at example.com>',
+ __BODY__ => 'Send five dollars to the ISC, c/o ...',
+ __LINES__ => 5
+ );
Note that the value of C<$hdr{Lines}> is the contents of the Lines: header
of the article and may bear no resemblence to the actual length of the
@@ -163,9 +175,9 @@
arguments and returns no value, but it has access to a global hash %mode
that contains three values:
- Mode The current server mode (throttled, paused, or running)
- NewMode The new mode the server is going to
- reason The reason that was given to ctlinnd
+ Mode The current server mode (throttled, paused, or running)
+ NewMode The new mode the server is going to
+ reason The reason that was given to ctlinnd
One possible use for this function is to save filter state across a
restart of innd. There isn't any Perl function which is called when INN
@@ -358,7 +370,7 @@
Scripts (like those from the old mechanism) are listed in F<readers.conf>
using perl_auth in the same manner other authenticators are using auth:
- perl_auth: "/path/to/script/auth1.pl"
+ perl_auth: "/path/to/script/auth1.pl"
The file given as argument to perl_auth should contain the same
procedures as before. The global hash %attributes remains the same,
Modified: doc/pod/hook-python.pod
===================================================================
--- doc/pod/hook-python.pod 2008-06-05 18:35:54 UTC (rev 7857)
+++ doc/pod/hook-python.pod 2008-06-05 18:51:20 UTC (rev 7858)
@@ -72,23 +72,37 @@
is called every time innd receives an article. The following can be
defined:
- Approved, Control, Date, Distribution, Expires, From, Lines,
- Message-ID, Newsgroups, Path, Reply-To, Sender, Subject,
- Supersedes, Bytes, Also-Control, References, Xref, Keywords,
- X-Trace, NNTP-Posting-Host, Followup-To, Organization,
- Content-Type, Content-Base, Content-Disposition, X-Newsreader,
- X-Mailer, X-Newsposter, X-Cancelled-By, X-Canceled-By, Cancel-Key,
- __LINES__, __BODY__
+ Also-Control, Approved, Bytes, Cancel-Key, Cancel-Lock,
+ Content-Base, Content-Disposition, Content-Transfer-Encoding,
+ Content-Type, Control, Date, Date-Received, Distribution, Expires,
+ Face, Followup-To, From, In-Reply-To, Injection-Date, Injection-Info,
+ Keywords, Lines, List-ID, Message-ID, MIME-Version, Newsgroups,
+ NNTP-Posting-Date, NNTP-Posting-Host, Organization, Originator,
+ Path, Posted, Posting-Version, Received, References, Relay-Version,
+ Reply-To, Sender, Subject, Supersedes, User-Agent,
+ X-Auth, X-Canceled-By, X-Cancelled-By, X-Complaints-To, X-Face,
+ X-HTTP-UserAgent, X-HTTP-Via, X-Mailer, X-Modbot, X-Modtrace,
+ X-Newsposter, X-Newsreader, X-No-Archive, X-Original-Message-ID,
+ X-Original-Trace, X-Originating-IP, X-PGP-Key, X-PGP-Sig,
+ X-Poster-Trace, X-Postfilter, X-Proxy-User, X-Submissions-To,
+ X-Trace, X-Usenet-Provider, Xref, __BODY__, __LINES__.
-All the above values will be buffer objects holding the contents of the
-same named article headers, except for the special __BODY__ and __LINES__
-items. Items not present in the article will contain None.
+Note that all the above values are as they arrived, not modified
+by your INN (especially, the Xref: header, if present, is the one
+of the remote site which sent you the article, and not yours).
-__BODY__ is a buffer object containing the article's entire body, and
-__LINES__ is an int holding innd's reckoning of the number of lines in the
-article. All the other elements will be buffers with the contents of the
-same-named article headers.
+These values will be buffer objects holding the contents of the
+same named article headers, except for the special C<__BODY__> and C<__LINES__>
+items. Items not present in the article will contain C<None>.
+
+C<art('__BODY__')> is a buffer object containing the article's entire body, and
+C<art('__LINES__')> is an int holding B<innd>'s reckoning of the number of lines
+in the article. All the other elements will be buffers with the contents
+of the same-named article headers.
+The Newsgroups: header of the article is accessible inside the Python
+filter as C<art['Newsgroups']>.
+
If you want to accept an article, return None or an empty string. To
reject, return a non-empty string. The rejection strings will be shown to
local clients and your peers, so keep that in mind when phrasing your
@@ -281,7 +295,7 @@
listed in F<readers.conf> using python_auth in the same manner other
authenticators are using auth:
- python_auth: "auth1.py"
+ python_auth: "auth1.py"
Scripts should be placed as before in the filter directory (see the
I<pathfilter> setting in F<inn.conf>). The new hook method authen_init
Modified: innd/innd.c
===================================================================
--- innd/innd.c 2008-06-05 18:35:54 UTC (rev 7857)
+++ innd/innd.c 2008-06-05 18:51:20 UTC (rev 7858)
@@ -138,10 +138,64 @@
/* #define HDR__CANCELKEY 36 */
ARTHEADERINIT("User-Agent", HTstd),
/* #define HDR__USER_AGENT 37 */
- ARTHEADERINIT("X-Original-Message-ID", HTstd)
+ ARTHEADERINIT("X-Original-Message-ID", HTstd),
/* #define HDR__X_ORIGINAL_MESSAGE_ID 38 */
+ ARTHEADERINIT("Cancel-Lock", HTstd),
+/* #define HDR__CANCEL_LOCK 39 */
+ ARTHEADERINIT("Content-Transfer-Encoding", HTstd),
+/* #define HDR__CONTENT_TRANSFER_ENCODING 40 */
+ ARTHEADERINIT("Face", HTstd),
+/* #define HDR__FACE 41 */
+ ARTHEADERINIT("Injection-Info", HTstd),
+/* #define HDR__INJECTION_INFO 42 */
+ ARTHEADERINIT("List-ID", HTstd),
+/* #define HDR__LIST_ID 43 */
+ ARTHEADERINIT("MIME-Version", HTstd),
+/* #define HDR__MIME_VERSION 44 */
+ ARTHEADERINIT("Originator", HTstd),
+/* #define HDR__ORIGINATOR 45 */
+ ARTHEADERINIT("X-Auth", HTstd),
+/* #define HDR__X_AUTH 46 */
+ ARTHEADERINIT("X-Complaints-To", HTstd),
+/* #define HDR__X_COMPLAINTS_TO 47 */
+ ARTHEADERINIT("X-Face", HTstd),
+/* #define HDR__X_FACE 48 */
+ ARTHEADERINIT("X-HTTP-UserAgent", HTstd),
+/* #define HDR__X_HTTP_USERAGENT 49 */
+ ARTHEADERINIT("X-HTTP-Via", HTstd),
+/* #define HDR__X_HTTP_VIA 50 */
+ ARTHEADERINIT("X-Modbot", HTstd),
+/* #define HDR__X_MODBOT 51 */
+ ARTHEADERINIT("X-Modtrace", HTstd),
+/* #define HDR__X_MODTRACE 52 */
+ ARTHEADERINIT("X-No-Archive", HTstd),
+/* #define HDR__X_NO_ARCHIVE 53 */
+ ARTHEADERINIT("X-Original-Trace", HTstd),
+/* #define HDR__X_ORIGINAL_TRACE 54 */
+ ARTHEADERINIT("X-Originating-IP", HTstd),
+/* #define HDR__X_ORIGINATING_IP 55 */
+ ARTHEADERINIT("X-PGP-Key", HTstd),
+/* #define HDR__X_PGP_KEY 56 */
+ ARTHEADERINIT("X-PGP-Sig", HTstd),
+/* #define HDR__X_PGP_SIG 57 */
+ ARTHEADERINIT("X-Poster-Trace", HTstd),
+/* #define HDR__X_POSTER_TRACE 58 */
+ ARTHEADERINIT("X-Postfilter", HTstd),
+/* #define HDR__X_POSTFILTER 59 */
+ ARTHEADERINIT("X-Proxy-User", HTstd),
+/* #define HDR__X_PROXY_USER 60 */
+ ARTHEADERINIT("X-Submissions-To", HTstd),
+/* #define HDR__X_SUBMISSIONS_TO 61 */
+ ARTHEADERINIT("X-Usenet-Provider", HTstd),
+/* #define HDR__X_USENET_PROVIDER 62 */
+ ARTHEADERINIT("In-Reply-To", HTstd),
+/* #define HDR__IN_REPLY_TO 63 */
+ ARTHEADERINIT("Injection-Date", HTstd),
+/* #define HDR__INJECTION_DATE 64 */
+ ARTHEADERINIT("NNTP-Posting-Date", HTstd)
+/* #define HDR__NNTP_POSTING_DATE 65 */
};
-/* #define MAX_ARTHEADER 39 */
+/* #define MAX_ARTHEADER 66 */
/*
Modified: innd/innd.h
===================================================================
--- innd/innd.h 2008-06-05 18:35:54 UTC (rev 7857)
+++ innd/innd.h 2008-06-05 18:51:20 UTC (rev 7858)
@@ -177,9 +177,36 @@
#define HDR__XCANCELEDBY 35
#define HDR__CANCELKEY 36
#define HDR__USER_AGENT 37
-#define HDR__X_ORIGINAL_MESSAGE_ID 38
+#define HDR__X_ORIGINAL_MESSAGE_ID 38
+#define HDR__CANCEL_LOCK 39
+#define HDR__CONTENT_TRANSFER_ENCODING 40
+#define HDR__FACE 41
+#define HDR__INJECTION_INFO 42
+#define HDR__LIST_ID 43
+#define HDR__MIME_VERSION 44
+#define HDR__ORIGINATOR 45
+#define HDR__X_AUTH 46
+#define HDR__X_COMPLAINTS_TO 47
+#define HDR__X_FACE 48
+#define HDR__X_HTTP_USERAGENT 49
+#define HDR__X_HTTP_VIA 50
+#define HDR__X_MODBOT 51
+#define HDR__X_MODTRACE 52
+#define HDR__X_NO_ARCHIVE 53
+#define HDR__X_ORIGINAL_TRACE 54
+#define HDR__X_ORIGINATING_IP 55
+#define HDR__X_PGP_KEY 56
+#define HDR__X_PGP_SIG 57
+#define HDR__X_POSTER_TRACE 58
+#define HDR__X_POSTFILTER 59
+#define HDR__X_PROXY_USER 60
+#define HDR__X_SUBMISSIONS_TO 61
+#define HDR__X_USENET_PROVIDER 62
+#define HDR__IN_REPLY_TO 63
+#define HDR__INJECTION_DATE 64
+#define HDR__NNTP_POSTING_DATE 65
-#define MAX_ARTHEADER 39
+#define MAX_ARTHEADER 66
/*
** Miscellaneous data we want to keep on an article. All the fields
Modified: samples/filter_innd.py
===================================================================
--- samples/filter_innd.py 2008-06-05 18:35:54 UTC (rev 7857)
+++ samples/filter_innd.py 2008-06-05 18:51:20 UTC (rev 7858)
@@ -12,25 +12,74 @@
# This looks weird, but creating and interning these strings should
# let us get faster access to header keys (which innd also interns) by
# losing some strcmps under the covers.
-Approved = intern("Approved"); Control = intern("Control")
-Date = intern("Date"); Distribution = intern("Distribution")
-Expires = intern("Expires"); From = intern("From")
-Lines = intern("Lines"); Message_ID = intern("Message-ID")
-Newsgroups = intern("Newsgroups"); Path = intern("Path")
-Reply_To = intern("Reply-To"); Sender = intern("Sender")
-Subject = intern("Subject"); Supersedes = intern("Supersedes")
-Bytes = intern("Bytes"); Also_Control = intern("Also-Control")
-References = intern("References"); Xref = intern("Xref")
-Keywords = intern("Keywords"); X_Trace = intern("X-Trace")
+Also_Control = intern("Also-Control")
+Approved = intern("Approved")
+Bytes = intern("Bytes")
+Cancel_Key = intern("Cancel-Key")
+Cancel_Lock = intern("Cancel-Lock")
+Content_Base = intern("Content-Base")
+Content_Disposition = intern("Content-Disposition")
+Content_Transfer_Encoding = intern("Content-Transfer-Encoding")
+Content_Type = intern("Content-Type")
+Control = intern("Control")
+Date = intern("Date")
+Date_Received = intern("Date-Received")
+Distribution = intern("Distribution")
+Expires = intern("Expires")
+Face = intern("Face")
+Followup_To = intern("Followup-To")
+From = intern("From")
+In_Reply_To = intern("In-Reply-To")
+Injection_Date = intern("Injection-Date")
+Injection_Info = intern("Injection-Info";
+Keywords = intern("Keywords")
+Lines = intern("Lines")
+List_ID = intern("List-ID")
+Message_ID = intern("Message-ID")
+MIME_Version = intern("MIME-Version")
+Newsgroups = intern("Newsgroups")
+NNTP_Posting_Date = intern("NNTP-Posting-Date")
NNTP_Posting_Host = intern("NNTP-Posting-Host")
-Followup_To = intern("Followup-To"); Organization = intern("Organization")
-Content_Type = intern("Content-Type"); Content_Base = intern("Content-Base")
-Content_Disposition = intern("Content-Disposition")
-X_Newsreader = intern("X-Newsreader"); X_Mailer = intern("X-Mailer")
+Organization = intern("Organization")
+Originator = intern("Originator")
+Path = intern("Path")
+Posted = intern("Posted")
+Posting_Version = intern("Posting-Version")
+Received = intern("Received")
+References = intern("References")
+Relay_Version = intern("Relay-Version")
+Reply_To = intern("Reply-To")
+Sender = intern("Sender")
+Subject = intern("Subject")
+Supersedes = intern("Supersedes")
+User_Agent = intern("User-Agent")
+X_Auth = intern("X-Auth")
+X_Canceled_By = intern("X-Canceled-By")
+X_Cancelled_By = intern("X-Cancelled-By")
+X_Complaints_To = intern("X-Complaints-To")
+X_Face = intern("X-Face")
+X_HTTP_UserAgent = intern("X-HTTP-UserAgent")
+X_HTTP_Via = intern("X-HTTP-Via")
+X_Mailer = intern("X-Mailer")
+X_Modbot = intern("X-Modbot")
+X_Modtrace = intern("X-Modtrace")
X_Newsposter = intern("X-Newsposter")
-X_Cancelled_By = intern("X-Cancelled-By")
-X_Canceled_By = intern("X-Canceled-By"); Cancel_Key = intern("Cancel-Key")
-__BODY__ = intern("__BODY__"); __LINES__ = intern("__LINES__")
+X_Newsreader = intern("X-Newsreader")
+X_No_Archive = intern("X-No-Archive")
+X_Original_Message_ID = intern("X-Original-Message-ID")
+X_Original_Trace = intern("X-Original-Trace")
+X_Originating_IP = intern("X-Originating-IP")
+X_PGP_Key = intern("X-PGP-Key")
+X_PGP_Sig = intern("X-PGP-Sig")
+X_Poster_Trace = intern("X-Poster-Trace")
+X_Postfilter = intern("X-Postfilter")
+X_Proxy_User = intern("X-Proxy-User")
+X_Submissions_To = intern("X-Submissions-To")
+X_Trace = intern("X-Trace")
+X_Usenet_Provider = intern("X-Usenet-Provider")
+Xref = intern("Xref")
+__BODY__ = intern("__BODY__")
+_LINES__ = intern("__LINES__")
class InndFilter:
@@ -89,19 +138,26 @@
"""Decide whether to keep offered articles.
art is a dictionary with a bunch of headers, the article's
- body, and innd's reckoning of the line count. Itens not
+ body, and innd's reckoning of the line count. Items not
in the article will have a value of None.
The available headers are the ones listed near the top of
innd/art.c. At this writing, they are:
- Approved, Control, Date, Distribution, Expires, From,
- Lines, Message-ID, Newsgroups, Path, Reply-To, Sender,
- Subject, Supersedes, Bytes, Also-Control, References,
- Xref, Keywords, X-Trace, NNTP-Posting-Host, Folowup-To,
- Organization, Content-Type, Content-Base,
- Content-Disposition, X-Newsreader, X-Mailer, X-Newsposter,
- X-Cancelled-By, X-Canceled-By and Cancel-Key.
+ Also-Control, Approved, Bytes, Cancel-Key, Cancel-Lock,
+ Content-Base, Content-Disposition, Content-Transfer-Encoding,
+ Content-Type, Control, Date, Date-Received, Distribution, Expires,
+ Face, Followup-To, From, In-Reply-To, Injection-Date, Injection-Info,
+ Keywords, Lines, List-ID, Message-ID, MIME-Version, Newsgroups,
+ NNTP-Posting-Date, NNTP-Posting-Host, Organization, Originator,
+ Path, Posted, Posting-Version, Received, References, Relay-Version,
+ Reply-To, Sender, Subject, Supersedes, User-Agent,
+ X-Auth, X-Canceled-By, X-Cancelled-By, X-Complaints-To, X-Face,
+ X-HTTP-UserAgent, X-HTTP-Via, X-Mailer, X-Modbot, X-Modtrace,
+ X-Newsposter, X-Newsreader, X-No-Archive, X-Original-Message-ID,
+ X-Original-Trace, X-Originating-IP, X-PGP-Key, X-PGP-Sig,
+ X-Poster-Trace, X-Postfilter, X-Proxy-User, X-Submissions-To,
+ X-Trace, X-Usenet-Provider, Xref.
The body is the buffer in art['__BODY__'] and the INN-reckoned
line count is held as an integer in art['__LINES__']. (The
More information about the inn-committers
mailing list