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
Sending an Attachment
First, consider whether you really want/need to send the
information as an attachment.
- maybe not! If this is simply a letter you have written
in your word processor, it might be easier for your correspondent
if you convert your letter to text file and simply include the
text in your message.
- likely yes! If formatting of your file is important, or
you want your correspondent to be able to work with the actual
document, then sending the attachment makes very good sense.
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
- for Word Perfect, .wpd
- for MS Word, .doc
- for Excel, .xls
- for ascii text files, .txt
- Stata system file, .dta
- other typical extensions -- .pdf, .gif, .jpg, .htm
Using Pine on Unix for sending
Sending attachments using Pine is quite straightforward. Within
pine, while in the headers section of your note, simply
- press the ctl-j command,
- supply the file name
- or use ctl-t to browse your directory to find the
- You will be given the opportunity to comment on the
attachment, e.g. "Word Perfect 8.0 file"
- You can use ctl-j multiple times and attach multiple files to
a single message.
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
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
- Mime -- the usual standard, select unless you have a reason
- BinHex -- thecommon standard on MacIntosh systems, a courtesy
if you know your recipient uses a Mac
- uuencoded -- a system used on Unix systems, also available on
PC but often more hassle for the recipient.
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.
Using Pine for receiving attachments
Extracting your attachment from Pine
- First, use the View command to enter your attachment list
- At each attachment, use the Save command and adjust the
filename if need be
- eliminate spaces from the filename, and, for ease in
downloading, shorten the name to eight characters, e.g. "Income
Paper" becomes "income" or "incpap".
- give an appropriate filetype (the three-letter extension
following the period at the end of the name) -- e.g. you are
told this is a MSword file, but its name has no file type, save
a file called "Income Paper" as "income.doc" to make life
easier as you download it and try to use it in Windows.
- You'll be warned if you already have a file of that name in
your directory and given the option to "overwrite" or "append" --
generally "o" would be appropriate. If you are worried about the
other file of that name, ctl-c to cancel the operation and then
repeat the Save command, this time renaming your output file so
there will be no need to "overwrite" or "append".
- When you have saved all attachments in this message, use the
Exit command to return to your regular screen.
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:
- rename -- you can adjust the Unix name here to download more
easily -- generally give the files Windows standard extensions,
like .txt, .doc and keep the filenames at eight characters or
under (a problem with WS-FTP, not Windows at this point)
- delete -- once you have downloaded the file you may want to
clear it from your Unix directory
- view -- for text files only
- refresh -- to show a new copy of the directory listing after
you have made changes
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.
- data in text form, such that you see the numbers if you use
"more" to examine the file,
- a log file or other statistical output;
- a program, such as an SPSS control file, a Stata do-file,
- an html file from a website,
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
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.
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
- If it's easy, contact your correspondent for help -- what did
- If not, use WS-FTP as described above to move your file to
Unix -- binary mode -- and try the techniques described below for
figuring out what you have.
Unix Aids to Exploring a Mystery
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
- 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"
- 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
- 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
For your own sanity, it will be wise to follow a few
- 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
- 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
- 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.
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:
- Pine keeps the entire message together and simply allows you
to save the attachments to separate files. When you do this, Pine
"decodes" the attachment for you into its original format, often a
PC type document you can't do much with on Unix, such as a Word or
Excel file. However when you save the message containing the
attachment, the entire stream, including attachments, is saved --
you cannot avoid this. It does, however, make forwarding a
message, with its attachments, very easy. Just "forward" and off
goes the entire packet.
- Eudora separates message and attachments immediately upon
receipt, storing the attached files in usable format in a
directory you have chosen for attachments and a link to that file
in the message text itself. Easy to deal with, but when you
forward the message, all that is forwarded is the actual text of
the message, not the attachments. To forward the attachments, you
must "reattach" them to the message you are forwarding.
Comments or questions? Write
or phone 5-4751 or drop by 544/548.