home / snews / mail2snz
ftpmir     auctions     slug     snews     websyn       contact us
snews     mail2snz     prune      

Mail2Snz version 0.5: a program for handling mail within Snews.

Introduction
------------

Mail2Snz is a program intended for Snews users, allowing
them to handle mail as fake newsgroups.  It is intended for anyone who
receives more than occasional email, and part of the motivation for
writing it was to make it easier to use mail lists.

It should be run immediately after each online session with KA9Q.

Normally one doesn't wish to expire mail, but delete specific
items by choice.  The recommended method is to use a version
of Snews that supports the 'D' command (1.30 or later), and run the
Prune utility (also available from me).

These files, available by FTP, are terribly out of date:
 ftp://ftp.demon.co.uk/pub/ibmpc/dos/apps/news/ml2snz02.zip
 ftp://ftp.demon.co.uk/pub/ibmpc/dos/apps/news/snzpru02.zip

Later versions are available on http://www.johnwash.co.uk/

Try mail2snz.zip 30K.


Installation
------------

Installation is extremely simple.  Put the file mail2snz.exe where you
wish.  When it runs, it doesn't matter what your current directory is,
or where mail2snz.exe is located.  The program finds the files it needs
by looking for an environment variable 'snews', and if you've already
run DIS or Snews since you last booted, this environment variable will
be present.

The most convenient way to use this program is to have it run
automatically after each online session.  I do this by adding commands
to my demon.bat file.  Edit the demon.bat file by using a simple ASCII
editor, such as the one that is invoked by Snews when you send replies.

The commands in demon.bat will vary for each user, depending on where
your mail file is located.  Look for 'batch.txt' in your demon.bat file.

You will find a line something like:

        if exist C:\DEMON\SPOOL\ARTICLES\BATCH.TXT goto unbatch

Immediately before this line add:

        if exist C:\demon\spool\mail\*.txt goto unmail
        goto maildone
        :unmail
        dir c:\demon\spool\mail\*.tx?
        \snews130\mail2snz
        del c:\demon\spool\mail\*.tx$
        ren c:\demon\spool\mail\*.txt *.tx$
        dir c:\demon\spool\mail\*.tx*
        pause
        :maildone

Of course you may have to alter 'demon\spool\mail' if your mail is held
elsewhere.  And there is no need for the 'dir' command or the 'pause',
unless, like me, you're curious to see what's going on.

Renaming the .txt files to .tx$ files is just a precaution in case
something goes wrong, instead of deleting the .txt files immediately.

No doubt your copy of mail2snz.exe will be in a different directory from
mine, so you'll want to amend the \snews130\ bit.

I hate writing .bat files.  I suppose someone will come along and tell
me I could have inverted the logic, and written 'if not exist', or
something.  OK, tell me about it -- I'm happy to amend it, I
know the above looks untidy.  [Added for version 0.2] The usual flood
of mail has come in... NOT!  Indeed, nobody at all has mentioned a
better way.  I wonder if anyone actually reads the .doc file?  :-)


Use
---

If you adopt the modifications to demon.bat described above, you will
probably never wish to run mail2snz by hand.  However, it can be run at
any time.

When it executes, it looks for any .txt files in the mail directory, and
for each such file it attempts to create a newsgroup called
&mail.filename (where 'filename' is taken from the name of the .txt
file, e.g. filename.txt).

These fake newsgroups are noted in the Snews 'active' file, but not in
the 'nntp.dat' file used by ka9q.  However, if you use DIS to maintain
your newsgroups, the fake newsgroups will also appear in nntp.dat, but
it seems that they do no harm (at present!).  Of course, changes in
Demon's news server or the ka9q software may cause future problems, but
I think this is unlikely.

Two .txt files are ignored by this mail2snz.  These are outmail.txt and
postlog.txt, which are created by other programs usually run by Demon
customers, and are usually not incoming mail files.  If you really
want to apply mail2snz to either of these files, you'll need to
temporarily rename them.

A new feature in 0.2 is the possibility of specifying one or more
filenames on the command line (no need to include the .txt part).
At the time of writing this is little tested, but believed to be
working.

0.4: Wildcards in the command line filespec(s) are now supported.


Source availability and use
---------------------------

Source is available and is compiled using the command line version of
Borland's C++ compiler, version 3.1.  I'm not aware of exploiting
non-standard features; any comments on the code gladly received.

The program uses some of the modules in Snews.  Therefore to compile it,
first take the source of Snews (version 1.30) and then add the source of
Mail2Snz to the same directory.  Then give the command 'make
mail2snz.exe'. There should be no warnings (please contact me if you see
any).

It's likely that the above method will not produce an identical .exe
file to the one you've received in this .zip file.  This is because I've
made a number of changes to the Snews source for my own purposes.  If
you intend making changes to mail2snz, I recommend you contact me to
discuss whether there are relevant changes in the other modules.

Mail2snz is mostly written in C, but there may be a few bits of C++.
In particular, I do like '//' comments!


WARNINGS
--------

DON'T USE the 'f' command in Snews (or 'w') when reading these fake
newsgroups.  I'll warn you, it's very tempting sometimes, especially
when you're browsing a mailing list -- it just seems like the natural
thing to do.  Snews will quietly go ahead and generate a useless header
(no fault of Snews, after all Mail2Snz is a 'hack' if ever there was
one).

If you use DIS to manipulate your list of newsgroups, and add some new
ones, your fake '&mail' ones will also trickle into your nntp.dat file.
This doesn't seem to do serious harm (as far as I can tell).  I don't
know if there's any performance penalty, with Demon's newsserver going
off to look for non-existant newsgroups, but if there is I'd guess it
would be small.  But if you like tidying things up by hand, you might
want to remove those '&mail' lines from nntp.dat if you happen to be
browsing with an editor.

VERY IMPORTANT IF YOU USE MS WINDOWS: I don't run any Snews utilities
from within Windows.  Although I believe it's perfectly ok to use a DOS
box to do this (I know some people do).  However, you may experience
trouble if you start using more than one DOS box and running Snews
related things in one, and mail2snz in another.  I also wouldn't try
running mail2snz alongside programs such as ka9q (or the Windows
equivalent) -- wait until they have finished running.


Future enhancements
-------------------

I want more support for mailing lists.  For example, I envisage some
kind of configuration file, with various commands (regular expressions
in them, probably) to look for certain subject lines, senders, whatever,
and filter out that mail into different fake newsgroups.

And I'd like to be able to hit the 'f' or 'w' keys in Snews and have
mail go to the mail list reflector, or 'r' and have my reply go just to
the sender.  Reflectors are configured in various different ways, so
this may not be at all easy.  However, if you have some ideas on this,
please discuss them (either by email or in demon.ip.developers).

If you think this documentation could be improved, I'm not at all
surprised.  Implementors seem to have great difficulty writing
documentation for real human beings.  So please tell me of any problems
or puzzles, so that I can improve this for those that try this package
later.  And tell me if you use this program and find it useful -- I'm
only likely to release a new version if I hear that people want it.

Any other ideas?  Let me know.


If you have problems
--------------------

In the event of problems, please contact the author,
John Washington, by sending mail to (mail address removed
because of problems with unsolicited bulk mail).
Send to 'mail2snz' 'at' 'wash.demon.co.uk'.  If that doesn't
work, try the same at 'johnwash.com'.


Version 0.5   January 2000