![]() |
|
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
MIVA® RESOURCES: MimeConv 2.0Free for personal non-commercial use
You can also read the older article and use the original version of MimeConv. MimeConv 2.0 and file attachments in MivaVersion 2.0 of MimeConv was developed to enahnced functionality of applications written in Miva Script (http://miva.com), but may be use standalone or in connection with other script languages or CGI programs. Features of MimeConv 2.0
Changes made in the version 2.0
Known bugs, limitations and to-do's
please report bugs to mime@truxoft.com Calling Syntax
Replace the '?' and '+' signes with blanks when calling from a shell (e.g. Telnet or DOS Window) Call Examplesencoding a binary file to the stdout (browser): http://foobar.com/cgi-bin/mimeconv?subdir/order.dbf
http://foobar.com/cgi-bin/mimeconv?e+order.dbf
encoding to a file: http://foobar.com/cgi-bin/mimeconv?e+order.dbf+mime.tmp
decoding a source file: http://foobar.com/cgi-bin/mimeconv?d+subdir/mail/MIVA_POP0000000A
In Telnet: Use in Miva ScriptsExample of sending attachments with MvSMP
<MvSMTP FROM="{from}" TO="{to}" SUBJECT="test" MAILHOST="localhost">
<MvCALL ACTION="http://foo.bar/cgi-bin/mimeconv?E+user.dbf" METHOD="GET">
<MvEVAL EXPR="{s.callvalue}">
</MvCALL>
</MvSMTP>
Example of extracting attachments with MvPOP
<MvPOP MAILHOST="localhost" LOGIN="{log}" PASSWORD="{pswd}" DIRECTORY="{dir}">
<MvASSIGN NAME="file" VALUE="{glosub(messagebody,dir $ '/','')}">
<MvCALL ACTION="http://foo.bar/cgi-bin/mimeconv?d+&[file];" METHOD="GET">
</MvCALL>
</MvPOP>
Note: {dir} must point to the mimeconv directory, but in contrary to the mimeconv.ini it has to be relative to the Miva data directory! You can find details of an implementation of both simple samples and a more advanced sending of multi-part e-mail messages with multiple file attachments in the mimeconv.mv sample file (also attached to the installation package). Security Notesmimeconv.ini file must be present in the same directory as mimeconv and must contain temporary working directory path where you want to store files to encode/decode. These files should be removed after encoding/decoding, because with help of this program they could be read from outside. There should be only a single line containing the working directory path with no leading nor traling whitespace. Please keep a trailing slah in the directory. Never set the working directory to root, to cgi-bin or to some directory that has subdirectories with sensitive data or containing scripts or programs! Also be aware, that if you keep the mimeconv.ini file empty, mimeconv will read and store fiels in the current directory - it means in the directory where it is installed. While it would be mostly your cgi-bin directory, it would mean a serious security hole in your configuration! File permissions of mimeconv.ini should be set to be readable by the owner only - chmod 0400 Security of MimeConv was increased in version 2.0, but no exhaustive tests were made. Please be aware of potential security risks. Use the program only at own risk after carefully testing your configuration. InstallationThere are precompiled versions for PC Unix (compiled on Linux) and for Windows in the enclosed zip file. The program does not use any external libraries and therefore the binaries could work on most common systems. Recompiling for other then Intel processors should be possible. To recompile the program follow instructions in the Readme.txt file. To install follow these steps:
NOTE: You can install multiple instances of the program. If you want to keep them in the same directory just rename both the binary and the configuration ini file respectively - in this way you can keep several configurations with different working directory settings. Packing List
Legal Note
Download
MimeConv 2.0 - binaries, C source and Miva examples - 48.2 kB |
||||||||||
|
Miva and some other terms used on this page are registerd trademarks of the Miva Corporation |