Dealing with E-mail Attachments

Dealing with e-mail attachments is likely our number one "frequently asked question". Issues will be tackled in small chunks here:

Sending an Attachment

General etiquette

First, consider whether you really want/need to send the information as an attachment.

When you send an attachment, your recipient will appreciate your clear indication of the form of your attachment -- is it an Excel spreadsheet, a Word document, a Word Perfect file, a STATA dataset? Version number can be important, so include that information -- e.g. WP8 vs WP6.1.

If your attached files are named with these standard Windows/DOS type file types, they will be much easier for the recipient to deal with.

Using Pine on Unix for sending attachments

Sending attachments using Pine is quite straightforward. Within pine, while in the headers section of your note, simply

The above is your basic method -- however there is often a preliminary step required. Pine expects to find your file within a Unix directory, not on your PC's hard drive or even on a PC network drive. If the file you want to attach is one you have created on PC or Mac, then use FTP or Fetch first to send the file to your Unix account. It will be easiest to let the file sit in your top level directory, where Pine will expect to find it. Remember to clean these files out of your Unix directory occasionally. If you're not used to using the "rm" command in Unix, you can use the file management features of FTP to do the deletions.

Using Eudora to send attachments

Sending PC-based files is simpler in Eudora, since these files are already accessible to the program -- no FTP or Fetch required. While you are composing your message, simply right-click and select the context menu item "attach file". Eudora will present you a file browser so that you can select the file you want to attach.

You should check "tools-->options-->attachments" before sending attachments the first time in Eudora -- you have three encoding possibilities:

You can also check a box which tells the system to put regular text attachments within the body of your message, thus saving your recipient the bother of dealing with an attachment when all you are sending is plain text.

Receiving attachments

Using Pine for receiving attachments

Extracting your attachment from Pine

Downloading your file for use on PC

Chances are your attachment is a PC or Mac based file which you will want to bring into a program -- spreadsheet, word processor, stat pack -- for further work. If the nature of the file is clear to you, e.g. it is a Word document or an Excel spreadsheet, you are ready to proceed with the instructions here. If you cannot tell what you have, then detour to the next section to deal with your mystery file before you download it.

You will download your file using WS-FTP on Windows systems or Fetch on your Mac. Both programs provide parallel windows so that, once connected, you can browse for the file[s] you want to download and also browse to find an appropriate place to store them on you desktop machine.

You can use standard Windows methods for selecting a group of files to download at once -- shift-click for a range of files and ctl-click to select a scattering of files. Once selected, click the arrow key in the appropriate direction. For a single file, you can also just double click the filename. Note that WS-ftp has some handy file management built in:

The ascii / binary distinction is a frequent source of confusion. Almost all of the time transferring files in "binary" mode is appropriate, and this mode is the default for WS-FTP. However, if the file you are transferring is a straight text file, e.g.

then you will be best off transferring that file in ascii format. Unix and Windows/Dos/Mac use different conventions for the ends of lines and the "ascii" transfer takes that into account and sets the line endings appropriately for the destination system

Using Eudora to receive attachments

Attachments are so often PC-based files that they are usually easier to deal with from a PC-based mail client. This is major reason people who work consistently at the same machine are switching to use of Eudora, one of many PC-based mail clients and one which is site-licensed by FAS and available through "get_connected".

When you receive a piece of mail including an attachment, the attachment shows up as an icon at the bottom of the mail message. Just click on this icon to open the attached file. However, be wary if the file is not one you expect to have received -- see security issues below.

The attached file itself is stored for you in a special directory on your PC.-- this directory can be customized through the tools-->options-->attachments menu. You may open attachment files as you would any regular files in Windows. You might want to move them to a directory where you are keeping related files. (Also be aware that you can set Eudora to erase attachments when it erases the message with which it was sent -- think carefully in setting this option! -- there are pro's and con's both ways.

Common Complications

All is well and quite straight forward when the file you have received has a file extension which clues Windows in as to its nature, e.g. .doc, .wpd, .xls, .dta.

If the file extension is no help, or not present, you may have information from your correspondent as to the type file sent. If so, either rename your file with an appropriate extension, or open the program you will use first, and then use "open" in the "file" menu to open your file. When you save the file, you may want to save it with an appropriate file extension so it can be opened more easily in future. Also, be alert to the possibility that Eudora has truncated the filename -- if the name ends abruptly, your file extension and the full name may have been truncated.

When Windows cannot figure how to open the file (i.e. it does not recognize the file extension ), you will be asked to designate a program for opening the file and if you tell it to use one of the listed programs, it may ask you whether you want this type of file always opened by that program -- be careful here unless you are very certain a permanent linkage is appropriate.

No information and no success in opening the attachment?

Unix Aids to Exploring a Mystery File

Whether your file is one you have saved from "pine" or received in Eudora and uploaded to Unix, you can use several Unix commands to help in handling it.

file filename
the file command will show you what Unix believes your file to contain -- if you see "ascii text" or some other indication of text, you will be able to use "more " to examine the file. If you see "data", the file contains special characters and won't work well in "more"; instead use "strings" to explore further.
  1. If you see "text" as a file description, use these tools to work with your file:
    more filename
    more simply displays a text file on your screen, pausing at the end of each screenful. If this is a straight text file which you will be processing on PC, you might rename it with a filetype of .txt so that windows will know how to deal with it. If you see information like "begin 660 cdbk.txt" as the first line of the text file, you have a "uuencoded" file.
    uudecode filename
    Files beginning with the phrase "begin 660" followed by a filename have been sent via an older, Unix-based, encoding method. While there are PC products which will decode these files, you can also easily do this on your Unix machine and then download the resulting file for further work. The "begin" command will give you the name of the file to expect -- type "uudecode filename" where "filename" is the name of the file you have now -- i.e. the uuencoded one. If successful, uudecode will place the decoded file in your directory with the name listed on the "begin" line. Uudecode can be finicky, so cross your fingers that this will work and be prepared to get back in contact with your correspondent if it does not.
  2. If you see "data" as the file description, try the following:
    strings filename
    strings processes a file and spits out all groups of recognizable characters to the standard output (usually your monitor screen) -- so if you have a word processing document, you'll see the actual content, but not the special, formatting characters. Among the strings in the file you may get a hint as to the document type -- MS Word, Word Perfect, Xcel and then be able to set a file extension and go from there. Even if you can't tell what the original file type was, you may see the contents in roughly readable form. If all you need is to read the message, you can capture the output of strings: 
    strings filename > filename.txt
    Here you are simply capturing the plain text content from the file and redirecting it into a text file. You could then use WS-FTP to download the text file to your PC and continue work with it there or send it to one of the Unix printers with the command "lpr -Plw553 filename.txt".
    strings filename | more
    Here you are slowing down the output of strings so that you can examine it more easily on your screen
    strings filename | lpr -P lw553
    Here you are sending the output of strings directly to public printer on the 5th floor -- don't do this until you have looked at the screen version and determined that it is something you want printed!
     

E-mail and Viruses

As you can see from the procedures described here, attachments are often much more conveniently sent and received using a PC mail client, such as Eudora. However this very convenience leaves us much more open to the spread of computer viruses through e-mail. Generally viruses are being spread through executable programs, files typically ending in ".exe" and through certain application files, particularly MS-Word (.doc) and MS-Xcel (.xls) files. The viruses typically do not infect your machine until you open an affected file, but once you have done so, your system and other files may be damaged before you realize you have an infected file and move to disinfect your machine.

For your own sanity, it will be wise to follow a few guidelines: 

  1. Have an up-to-date virus checker on your machine and set to check files as they are opened. FAS has site-licensed Dr Solomon's Anti-virus Kit and keeps it updated monthly on the Get_Connected Netware Server. There is nothing automatic about the updating of this software! You simply go to Get_connected and reinstall Dr. Solomon -- ask for help with this the first time.
  2. Do not accept attachments from senders you do not know -- simply discard the message, i.e. put it in the trash and make sure your mail program is set to empty the trash when you exit the program. Treat unsolicited e-mail as you would any junk mail -- these days an unsolicited message can be the equivalent of a "letter bomb".
  3. Don't open unexpected attachments from correspondents you do know. Instead write them first and ask if they meant to send you the attachment, "filename" and ask them to tell you briefly what they have sent. There are viruses which infect PC's and send out further infection in the form of "friendly notes" under the user name connected with the machine they have infected, e.g. the Melissa virus.

Forwarding Attachments, Pine vs Eudora

In most cases, Eudora wins hands down over Pine on dealing with attachments, but forwarding mail with an attachment may be an exception and if you do a lot of this, it may be reason enough to keep your pine skills going.

The issue has to do with the way attachments are stored by the two programs. When mail containing attachments is sent the actual attachment[s] are sent as part of the message body, but encoded so they won't be damaged. If you were to use "more" on a message with an attachment (on Unix) you'd see the gibberish that was the attachment in among the chatter of the message.

Pine and Eudora take different tacks in dealing with this:

Soc_help
Sociology
WJHCS

Comments or questions? Write soc-help! or phone 5-4751 or drop by 544/548.