MAILSPLIT

Section: User Commands (1)
Updated: 88/08/20
Index Return to Main Contents
 

NAME

mailsplit - package, split, transmit file directories by electronic mail  

SYNOPSIS

mailsplit [ options ] mail-path files

  really:
mailsplit [ -ANVntv ] [ -C compress program ] [ -D temporary directory ] [ -M Mailer options ] [ -T archive program ] [ -b compress-bits ] [ -d delay time ] [ -l split lines ] [ -m mail agent ] [ -r parts ] [ -s subject ] [ -xn set debug-level n ] [ -u ascii encode program ] mail-path[,mailpath] files [files] ...  

DESCRIPTION

Mailsplit is a program to package, compress, document, transmit, and re-assemble multiple files and directories to other users via electronic mail. Mailsplit uses tar(1), compress(1), split(1) and mail(1) to send the files, and awk(1) to re-assemble them at the receiving side. Mailsplit attempts to preserve the integrity, structure, mode, protection, and ownership of the transmitted directories.  

OPTIONS

Command line options can be used to override the default options in the source code of mailsplit. Options and flags can be specified in any order on the command line. The first non-option or flag token on the command line is interpretted to be the mail path whither the data should be sent. All other non-option or flag tokens are considered files or directories to be sent. Since the program is a shell-script, users might want to tune the defaults for their sites. All suggestions, improvements, bug-reports, etc. would be greatly appreciated. Send them to wyle@ethz.uucp.
-N
tells mailsplit Not to send the joinr script prepended to the first message. The default is to prepend your version of the joinr script with each mailsplit batch sent. Use this option to suppress sending the joinr script. This option is useful if one is sending directories to a recipient who already has the mailsplit package installed on her system.
-V
sets the verbose option, and is equivilant to -x9 (maximum debugging). When this option is set, mailsplit will echo everything he does while he's doing it. This option will generate an awful lot of useless debugging information and is not recommended unless you are debugging.
-n
puts mailsplit into "test" mode. This mode is analogous to make(1) -n where mailsplit tells you which commands he would have issued without actually doing anything. This mode is also good for debugging, or when you're curious what mailsplit might do with a complicated path or directory.
-t
same as -n
-v
displays version number and exits. This option is useful only for finding out which version / patch level your mailsplit is.
-A
will use the generic name "archive" for the subject instead of a long pathname.
-C
tells mailsplit to use the next argument as the program to use instead of compress(1) for compressing the archive stream. In some circumstances, using compress(1) may expand the size of a stream, in which case one would might want to use cat(1) to send the archive through unchanged. The author is dubious of this option.
-D
instructs mailsplit to use directory instead of /tmp for temporary files created during the archival, compression, and encoding process. This option is necessary if there is very little space in /tmp, one is sending very large directories, or the file tree on this system is bizare.
-M
When this option is used, mailsplit passes the mailer options argument(s) to the mail program. Some mailers need options to get the job done (we won't mention an infamous X.400 mailer). Other times, one would prefer to set options for efficiency, tell the mailer not to run interactively, etc. To set more than one option, enclose mailer options in quotes. Be careful about the shell's eating quotes. One might have to experiment a bit to set all the options needed or desired.
-T
If this option is set, mailsplit uses archive program instead of tar(1) to archive all the files and directories. If the system does not have tar(1), it is unlikely that mailsplit will work. On the other hand, tar(1) expands binary files enormously, so one might substitute cat(1) instead of tar(1) to reduce the size of the archive.
-b
uses b bits for compression. Some e-mail reachable users have bizare Lempel-Ziv implementations or flakey hardware which requires fewer than the BSD default 16 bits for the common compression string code. The default value of this parameter is set to 12 when mailsplit is distributed, which seems to be pretty universal. If one knows that the data are being sent to a BSD site or a site with 16-bit compression, one should change the default in the code to 16.
-d
tells mailsplit to wait seconds seconds after each time he invokes the mailer. Some mailers (a certain X.400 system with "MTA congestion problems" will remain nameless) have problems dealing with sudden, large bursts of messages. One might want to set the default in the code to some non-zero value if the mailer on his system has such problems. If mailsplit is usually used for small directories, and the default delay is small, one should use this flag to set the delay higher if a large number of files or large directory is sent.
-l
This option sets the maximum number of lines for a single mail message. The default as distributed is set to keep a message smaller than 60 Kilobytes. See the discussion below. One might want to set the default higher, and use this option to set a smaller number when sending mail through mailers which don't like large messages. (A certain X.400 mailer...) Remember that if the archive pieces have to pass through a mailer which wants small messages, the lines size must be set smaller.
-m
If the system on which mailsplit is running has more than one mailer (user agent) one can use this flag to choose a mailer other than the default (/usr/ucb/Mail as distributed).
-r
The -r(esend) option is used to re-send pieces which became lost in the wide-area mail networks. parts is a list of pieces to be re-sent to the recipient. Parts can be a comma-separated list, or numbers between dashes, or just one number and a dash, or any combination. The formal BNF of parts is:

parts :== <number> | number,parts | number-number | number- number:== <digit> | <digit><number> digit :== 0|1|2|3|4|5|6|7|8|9
Only those pieces in parts will be sent. This option is useful for re-transmitting part 3 of 27 instead of having to re-transmit all 27 pieces. One must be sure that the other options are set exactly the same as the first transmission, including line-length, etc.
-s
sets the subject to subject instead of using the first file argument for the subject of each mail message generated.
-xn
sets the debugging level to n, where n is a number from 0 to 9. The higher the number, the more debug output. Setting n to 0 causes mailsplit to work silently. No output will be sent to standard out, and only failure messages will be sent to standard error. Setting n to 9 is equivilant to -V (verbose), and gives maximum debug output.
u
This option sets the encoding program to something other than uuencode(1c). The encoding program must be able to take 8-bit binary and produce 7-bit ASCII data.
 

DISCUSSION

A few de facto standards have evolved on wide-area (e-mail) networks to guarantee the safe transmission of information:

-
The information must be text-only, i.e. 7-bit ASCII
-
Lines of text may not exceed 80 characters. A message must therefore contain an end-of-line character at least after every 80 characters.
-
A single message may not exceed 64 Kilobytes.
-
Lines of text starting with the word "From" will be translated to ">From."
-
Blank lines at the end of a mail message are deleted.
-
A message containing a period "." on a line by itself will be terminated abnormally.

Upon invocation, the program parses all flags and options, then looks for at least two parameters on the command line: The e-mail path(s) of the receiver(s), and the file or directory name(s) to send. If one or both of these parameters is missing, a help message is displayed with a short "usage" description and an example.

The directories or files are recursively archived and compressed into a temporary binary file. The binary file is then sent through uuencode so that it is encoded into 7-bit ASCII with end-of-lines every 79 characters. The resulting ASCII file is then split into several different files, each of which is smaller than 64 Kilobytes.

The first file is prepended with instructions as well as the program needed to unpackage the transmitted message or messages. All messages are pre- and post-pended with special start and end text, to assist both the person receiving the message and the unpackaging program. Finally, each message is sent via electronic mail to the recipient, and all temporary files are deleted.

During these operations, status information is displayed after each successful step. If there are no files to send, an error message is displayed.

At the receiving end, a first-time user must extract the unpackaging program from the first e-mail message, and make the program available for his use. A user must perform this step only once, as the packaging format should not change. Depending on the size of the transmitted files or directories, the receiver may get one or several mail messages. The messages contain subject headers of the form:

"--- start of <package> part <n> of <m>"


where <package> is the first file or directory name, <m> is the total number of messages into which the package was split, and <n> is in the range 1 to m.

The receiver must then send all of the parts through the unpackaging program in their proper order. This is accomplished either from within the mail reading program, or by saving the messages into a file and invoking the unpackaging program on the saved file. Because e-mail systems will often deliver messages out of order, the re-assembler program detects and corrects when pieces are sent through it repeatedly or out of order. Only the first part number <n> is used; all others are ignored.

The re-assembler program first filters out repeated pieces and sorts them into their correct order before it joins them together to decode, uncompress, and extract the individual files or directories.  

EXAMPLES

% mailsplit wyle@ethz.uucp /etc/hosts

% mailsplit wyle@ethz.uucp sources -r 5,7,17-21

% mailsplit -l 700 -x9 wyle@ethz.uucp goodies -s "examples"

% mailsplit -l 700 -x9 -r 19- wyle@ethz.uucp goodies

 

AUTHOR

Mitchell F. Wyle (wyle@ethz.uucp)  

BUGS

BSD specific?

Re-assembler should accept pieces out of order

Should be packaged with a configurer, makefile, install script  

SEE ALSO

split(1), tar(1), mail(1), uuencode(1), uudecode(1), compress(1), awk(1), sh(1)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
DISCUSSION
EXAMPLES
AUTHOR
BUGS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:54:48 GMT, February 02, 2023