news2mail.pl - Transfer news (NNTP) to email (SMTP)
perl news2mail.pl comp.os.os2.announce
This script implements the 'glue' required to convert NNTP articles into
SMTP emails.
news2mail.pl uses two config files - one intended to be read-only by
news2mail (news2mail.ini), and one intended to be ``internal use only''
(.newsrc). Both of these are in the same directory as news2mail.pl itself.
This file is read by news2mail.pl, and describes all the parameters it
uses.
- newsserver
-
NNTP host to read mail from. Note that authentication isn't currently
supported.
- smtpserver
-
SMTP server to send the email to. Note that authentication shouldn't be
needed.
- recipient
-
The ``To'' address. This can be the person for whom the news is being gated
or, more likely, the mailing list address for the gate.
- whoami
-
The ``From'' address. Who the mail looks like it's coming from. This would
be what the mailing list may authenticate for posting.
- popserver
-
Not used yet.
- popuser
-
Not used yet.
- poppasswd
-
Not used yet.
- digest
-
Digest mode (not tested). The idea here is that everyone gets one email per run, rather than one email per article. Set to non-zero to get
digest mode.
- debug
-
Leave this as 0.
Don't modify this. If you don't have one, you must create it first. Create
it as a zero-byte (empty) file.
This module depends on netnews::netnews (netnews/netnews.pm), and thus on
it being in the right path. Easiest is to execute from the news2mail.pl
directory, with netnews.pm in the subdirectory. Otherwise, the netnews
directory must be in your perl5lib path.
netnews::netnews relies on other netnews packages. They really need to be
all in the same path.
This script was developed under OS/2 with the default set of Perl modules
that come with the OS/2 Perl distribution. You may need to visit CPAN to
get some modules to get this to work on other platforms.
Probably one of the premier features of this script is the ability to
``skip'' on articles based on anything from their headers. See the
skip.list file for more information on how this filtering works. There are
two major points here: the match criteria, if it's not numerical (i.e.,
starts with '=', '<', or '>'), uses Perl's regular expressions. And
it's extremely fast. I've put this functionality through a large number of
iterations, and this comes to be an extremely fast version, taking as much
advantage of Perl's strengths as I can.