                                 mime2uu.EXE
                                    v1.00
           The MIME to UU attachment converter for UUCP accounts.
                               by Steven Libis


WHAT IS IT/WHAT DOES IT DO?:
----------------------------
MIME2UU reads the incoming UUCP message files.  If it finds a MIME encoded
file attachment or a plain text attachment, it removes them.  It then
decodes the MIME attachment.  It then UU encodes the binary attachment.
It then attaches the UU encoded file and the plain text file attachment.
If there is only one file attachment, it gets attached to the original
message.  If there are multiple file attachments, the original message
is duplicated, and one file is attached to each message until all the
file attachments have been reattached.

If MIME2UU can't find a file to attach, after it has detached one, MIME2UU
will send a copy of the message that had the problem to the original
recipient (and to the sysop/sys admin if you choose to fill out the e-mail
address in the configuration file).

This was written because my Wildcat! BBS v4.20 can only handle UU encoded
files, and only handle one attachment per message.


SYSTEM REQUIREMENTS/WHERE HAVE I TESTED IT?:
--------------------------------------------
I have tested/used this with Wildcat v4.20 and wcGate v4.20 running
on a NetWare v3.20 file server, with DOS workstations running on
Novell DOS v7.0, and MS-DOS v6.22.  I have tested it on a 486-66
and Pentium 75 machine.

MIME2UU was tested with a group of 225 messages that had 63 attachments
(I had been saving a few days worth of messages).
Some messages had multiple attachments-binary and text intermixed.


SETUP/INSTALL:
--------------
The configuration file, MIME2UU.CFG, must be in whatever directory the
program file, MIME2UU.EXE, is in.  The program file, must be on whatever
drive the processing directory is on (Line 2: of the configuration file).

The program will not run unless all three directories in the
configuration file are valid.


MIME2UU.CFG:
------------
Line 1: The directory where the incoming UUCP messages are stored.
Line 2: A directory where you can safely process the messages.
Line 3: Backup directory where you can review/save the messages this
        program has processed.  (Only the original unprocessed files 
        are stored here.  The processed files are put back into the
        directory listed on Line 1, for the system to do it's normal
        processing.  Since the processed files reuse the same file 
        names on each run, I don't save them here.)
Line 4: sysop/system admin who will get messages with file attachment problems.

This file must be at least 4 lines long.

The rest of the lines in the configuration file are ignored, so you can
put whatever comments you want there.

This program won't function unless the three directories are filled
out, and they exist.

This program will function if there is no e-mail address for notification
of errors (after all, you can always check the log file).


LOG FILES:
----------
MIME2UU creates a new log file with a unique name (based on the current
date and time) every time it is run.  The word ERROR should print in the
log next to any event that MIME2UU thinks is a problem.  There is also
a summary at the end of the log file of how many messages there were with
attachments and how many messages there were with errors.


THIRD PARTY PROGRAMS:
---------------------
These third party programs are required to make this program functional:
UUENVIEW and UUDEVIEW, UNIX2DOS and DOS2UNIX.
(they are included with this program)

They must be accessable to MIME2UU.EXE, either by being in the same
directory as the program (or better yet, somewhere in the path).


ASSUMPTIONS/LIMITATIONS:
------------------------
If a plain text attachment follows a binary attachment, and the plain
text attachment doesn't have a file name, it won't be reattached to
the message.  That is the only error I have found so far, and I have
had a couple of friends stress testing the software by sending a
random assortment of file attachments and forwarded messages with
file attachments.

And while MIME2UU will send an error message to the regular recipient
and the sysop/system admin if it thinks it detects a problem, it may
not always be able to recognize a problem.

So you probably want to review the backup directory when you first
start using this program.  

Limitations built into the software by me:
MIME2UU can only handle 100 attachments in one session.
        (RAM allocated for file name attachments.)
        (Routine for temporary file name generation)
        (can handle 676 files at a time).
MIME2UU can only handle 300 lines of text per message.
MIME2UU only stores the first 50 characters on the original
        file name attachment.

All these limits are arbitrary, and can be increased.  But they seemed
more than adequate when processing the messages I had been saving over
the past few days, and then processing them all in one run.
(If you need any of these limits increased, please let me know.)

Currently, MIME2UU reads the first 300 lines of each message while looking
for a file attachment.  If the message with the file attachment is longer
than 300 lines, the extra lines will be lost.  If there is no attachment,
MIME2UU ignores the message entirely, and can be as long as you want it to
be.  (If you find that you are receiving text messages with more than 300
lines and with file attachments, please let me know.)


UUCP CONFIGURATION:
-------------------
This program has only been tested with UUCP accounts where the message file
and the control file are both 6 character file names starting with 0 and the
file extension is 1 character (the message file is .D and the control file
is .X).  (Newsgroups on my system start with G, but still have the .X or .D
extension). The contents of the control file (.x) is five lines long, and
follow this specific format: (this is true for my ISP and a friend's ISP).
note: the file name leading 0 is dropped on the inside of this .x file.
(If you prefer a different starting file name, please let me know.)

      U daemon ispname       - line 1 - ISP name
      F D.ispnameC01AA       - line 2 - ISP name and message name
      I D.ispnameC01AA       - line 3 - ISP name and message name
      Z                      - line 4 - I am not sure what this is for
      C rmail me@ipsname.com - line 5 - who message addressed to

If this is NOT the case in your situation, please let me know so I can
update this program (please send a message file and control file so I can
see how your ISP is doing this).

This program currently ONLY looks for 4 kinds of attachments:
        content-type: application/
        content-type: video/
        content-type: image/
        content-type: audio/
as these are the only ones I am aware of or have seen since I started
writing and testing this program.

If you know of other file attachment types, please send me a copy of the
message (or the exact information) so I can update this program.


ANYTHING ELSE?:
---------------
Nothing that I can think of for the moment.


REGISTRATION?:
--------------
Send $5.00 to:

Steven Libis
P.O.Box 8106
Mission Hills, CA 91346-8106


THE END?:
---------
Questions, comments, complaints and suggestions are appreciated.

Steven Libis
Sysop, Earthquake City BBS
sysop@eqcity.ktb.net
http://eqcitybbs.tripod.com/
