File transfer via email
Last revision July 22, 2004
On pangea, the use of email to send or receive attached files is limited to files of less than 50 megabytes in size. This is because the disk "staging" areas for both incoming and outgoing email are limited in size and heavily used. Attempts to transfer multi-megabyte files via email have on occasion completely filled those disk areas, resulting in the loss of other email As a result, the email system on pangea is configured to reject any attempt to send or receive an email message that is larger than 50 megabytes. If you do receive large files via email, you must also act promptly to move them out of your email "inbox" and to another disk area. See the page on the pangea file system for more information on disk areas on pangea and their uses and policies.
Email systems are designed to handle only text files. If you want to transfer a binary data file, you should first run it through a program that uses an encoding scheme to represent binary data bytes with text characters. The standard one for Unix systems is called uuencode. Before appending a binary data file to an email message sent from pangea or another Unix system, you would run the uuencode command to make an encoded version.
For example, you can use uuencode to encode the binary file mydata into a new coded version mydata.out, and then append that to your email message. The uuencode command wants two arguments: the name of the file to be encoded, and the name that should be given to the file when it is recreated at the remote site (this second name is stored as part of the encoded file). Normally, the second name to be used at the remote site would be the same as the local file name, unless the remote site has more restrictive file naming rules. The encoded version of the file goes to standard output, which must be redirected to a file. A sample command for the imaginary file mydata:
uuencode mydata mydata > mydata.out
When received by a colleague, he would save the email message to disk and then run it through the uudecode command to recreate the original file. Normally, uudecode can recognize and discard any email headers or message text that precedes the actual encoded file. If not, you can edit the saved email message to remove all lines before the one that begins with the word "begin" and contains the encoded file name.
For example, consider the fate of the imaginary binary file mydata that was encoded above into the file mydata.out. If you received such a file as part of an email message on pangea, you would first use the appropriate command in you mail reader program to save it to a local disk file. In the pine email program, this would be called a "folder" and you would need to specify a new folder name (to avoid mingling this file with other saved email), for example, mydata.save. Pine puts saved email message files into the subdirectory mail in your home directory. Now, run the uudecode command, specifying that saved file as the input:
uudecode mail/mydata.save
This recreates the original binary data file mydata in your current (home) directory.
Some email programs support the Multipurpose Internet Mail Extensions, or MIME standards for attaching files of all type to email. If you know that your email program and the one used by your colleague both support this standard, you can let the email program do the work for you of encoding and decoding files. Check the documentation for your program and find out what your colleague has available. The pine program on pangea supports most MIME extensions. See the pages on using pine.