ot: mail flag for attachment in unix

Bill Campbell bill at celestial.com
Thu Oct 1 09:11:23 PDT 2009


On Thu, Oct 01, 2009, Kenneth Brody wrote:
>Dennis Malen wrote:
>> Ken,
>> 
>> I missed trying Bill's suggestion and the following did work:
>> 
>> (uuencode emccx.xls emccx.xls ; cat tryftp) | mail -s "test4" 
>> dmalen at malen.com
>> 
>> It attached emccx.xls and placed the contents of tryftp in the body.
>
>Actually, it "attached" nothing.  Rather, it made a simple plain-text e-mail 
>whose body consisted of a uuencoded file plus some text.
>
>It may be that the e-mail client used to read this recognized the in-line 
>uuencoded file and pretended it was an attachment, but that's just the 
>behavior of the particular client that was being used.  Other clients may 
>show "garbage" as the body of the message, and others may recognize the 
>uuencoded in-line content, and ignore everything else.

Proper MIME attachments are easily handled by all (for some
definiation of all) e-mail clients these days, making it easy to
save one or more parts of the message.  Furthermore, using proper
attachments makes it pretty easy to automatically process e-mail
messages with standard tools in python, perl, or other scripting
languages.

A plain-text message with uuencoded data only allows a single
``attachment'' if it's going to be handled by clients that still
understand uuencode.  Scripted processing would be much more
difficult to handle multiple attachments as the script would have
to parse the message identifying the uuencoded attachments, and
processing them separately.

There's never time to do it right, but always time to do it over.

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186  Skype: jwccsllc (206) 855-5792

UNIX was not designed to stop you from doing stupid things, because that
would also stop you from doing clever things. -- Doug Gwyn


More information about the Filepro-list mailing list