home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Extra 1997 #5
/
AmigaPlus_Extra-CD_5-97.iso
/
online-tools
/
mail
/
netmail
/
drivers
/
mmencode.encoder
< prev
next >
Wrap
Text File
|
1995-09-30
|
2KB
|
54 lines
/*
** $VER: MMencode.encoder 1.3 (30.9.95)
** Copyright (c) 1995 Riccardo Solmi
**
*/
OPTIONS RESULTS
OPTIONS FAILAT 21
IF UPPER(ARG(1)) = 'INFO' THEN RETURN 'Base64 Quoted-Printable'
cmd = 'AmiTCP:bin/MMencode'
IF ~EXISTS(cmd) THEN DO
cmd = GetVar('NetMail/MMencodeCmd')
IF cmd = 0 | ~EXISTS(cmd) THEN DO
ADDRESS COMMAND 'SetEnv NetMail/MMencodeCmd `Which "MMencode"`'
cmd = GetVar('NetMail/MMencodeCmd')
IF cmd = 0 THEN DO
ADDRESS COMMAND 'SetEnv NetMail/MMencodeCmd `RequestFile Title "Select MMencode command" Noicons`'
cmd = GetVar('NetMail/MMencodeCmd')
IF cmd = 0 | ~EXISTS(cmd) THEN DO
IF UPPER(ARG(1)) = 'ENCODE' THEN RETURN 2
ELSE RETURN ''
END
ADDRESS COMMAND 'Copy QUIET ENV:NetMail/MMencodeCmd ENVARC:NetMail/MMencodeCmd'
END
END
END
SELECT
WHEN UPPER(ARG(1)) = 'ENCODE' THEN DO
PARSE ARG , from, dest, format
IF UPPER(format) = 'BASE64' THEN
ADDRESS COMMAND '"'cmd'" >"'dest'" "'from'"'
ELSE IF UPPER(format) = 'QUOTED-PRINTABLE' THEN
ADDRESS COMMAND '"'cmd'" >"'dest'" -q "'from'"'
RETURN RC
END
WHEN UPPER(ARG(1)) = 'DECODE' THEN DO
PARSE ARG , from, dest, format
IF UPPER(format) = 'BASE64' THEN
ADDRESS COMMAND '"'cmd'" >"'dest'" -u "'from'"'
ELSE IF UPPER(format) = 'QUOTED-PRINTABLE' THEN
ADDRESS COMMAND '"'cmd'" >"'dest'" -u -q "'from'"'
RETURN RC
END
OTHERWISE
END
RETURN ''