[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hopmail.bat for MSDOS




Cypherpunks & cypherpunkettes :-)

At long last I beleive a working version of hopmail written in the
MSDOS scripting is finished.  I've tested it and it seems to work (and
I even sent messages with DOS CRLF's instead of unix NL and had no
problems), but if you find problems let me know.  I'm assuming you are
like me in that my pc doesn't have a dedicated net connection, so the
scripts just prepare file, but don't mail them.  You would upload the
file to your network account and go from there.

Warning: the code is ugly, but I plead innocence, citing the
constraints of the language!  I've never used so many goto's since my
last BASIC program ~11 years ago.

I think in the future I'll just write DOS stuff in C/C++, with system
calls, and offer source with executables, so you can recompile if
you've think I've added secret password catching commands :-)  I'd use
4DOS and other enhancements like some people have suggested (thanks!)
but I want to be sure as many people as possible can use the script,
so using just plain old DOS seems the best way to go.  Well, the best
way to go in DOS.

I'll write a help file and offer it, the script, and anonmail.bat up
for ftp.  Quickly, because getting input from the user in DOS is a
real pain/impossible without resorting to extra programs/assembly
hacks , all parameters are just entered on the command line.  Type
hopmail and a short help screen will appear.

Now I'll clean up the digital bank and circulate the source to those
interested. 

---------8< -- cut here -- >8----------
@echo off
rem hopmail.bat - allows routing a message through various remailers
rem extropia not supported just yet
rem Karl Barrus - [email protected]

rem if no parameters, print help file
if '%1'=='' goto help

rem get file name
shift
set filename=%0
if not exist %filename% goto errnofile

rem check mode
shift
set mode=0
if '%0'=='1' set mode=1
if '%0'=='2' set mode=2
if '%mode%'=='0' goto errmode

rem set up encrypted pgp header
echo :: > zzztemp1.txt
echo Encrypted: PGP >> zzztemp1.txt
echo. >> zzztemp1.txt

rem create null message
echo. > zzztemp3.txt

rem get email address
shift
set to=%0
if '%to%'=='' goto errmail

:repeat
shift
if '%0'=='' goto finish

if '%0'=='1' set [email protected]
if '%0'=='2' set [email protected]
if '%0'=='3' set [email protected]
if '%0'=='4' set [email protected]
if '%0'=='5' set [email protected]
if '%0'=='6' set [email protected]
if '%0'=='7' set [email protected]
if '%0'=='8' set [email protected]

rem set up remailing request header
echo :: > zzztemp2.txt
echo Request-Remailing-To: %to% >> zzztemp2.txt
echo. >> zzztemp2.txt

rem append previous message
copy zzztemp2.txt + zzztemp3.txt zzztemp4.txt > nul
del zzztemp2.txt
rename zzztemp4.txt zzztemp2.txt

if '%0'=='1' goto none
if '%0'=='2' goto none
if '%0'=='3' goto none

pgp -ea zzztemp2.txt %rto% > nul
copy zzztemp1.txt + zzztemp2.asc zzztemp3.txt > nul
goto next

:none
copy zzztemp2.txt zzztemp3.txt > nul

:next
set to=%rto%

goto repeat

:finish
if '%mode%'=='1' goto incmessage

rem append, user chose create to receive
echo -----cut here---- >> %filename%
copy %filename% + zzztemp3.txt  zzztemp4.txt > nul
echo. >> zzztemp4.txt
echo To reply, save everything below the cut here marks >> zzztemp4.txt
echo Type your reply below the blank line two lines above >> zzztemp4.txt
echo Mail resultant file to %to% >> zzztemp4.txt
del %filename%
rename zzztemp4.txt %filename%
goto done

:incmessage
rem user chose create header to send
copy zzztemp3.txt + %filename% zzztemp4.txt > nul
del %filename%
rename zzztemp4.txt %filename%
echo Remember to mail %filename% to %to% 

goto done

:help
echo Usage: hopmail filename mode address remailer# [remailer#]...
echo Mode:
echo 1: Mail a file via anonymous remailers
echo 2: Create a remailing header and append to a file
echo.
echo Address:
echo for mode 1, destination address
echo for mode 2, your address
echo.
echo Remailers:
echo 1: [email protected]
echo 2: [email protected]
echo 3: [email protected]
echo 4: [email protected]
echo 5: [email protected]
echo 6: [email protected]
echo 7: [email protected]
echo 8: [email protected]
rem echo 9: [email protected]
goto end

:errmode
echo Error: mode must be 1 or 2
goto end

:errmail
echo Error: no destination specified
goto done

:errnofile
echo Error: file %filename% does not exist
goto end

:done
del zzz*.*

:end