[Sunhelp] binary mail attachments through commandline

Jarrett Carver AFcarjm at dia.osis.gov
Fri Nov 12 21:59:25 CST 1999


You can with mail and mailx, however, you first need to mime encode.

You can use uuencode or base64 or any number of other mime encoders. Then
pipe the output to the mailx command. This
will give the recipient an email that they would then need to excerpt the
encryption and  decode. To them it would appear
to be a gibberish email if opened with a mail tool such as Netscape
Messenger.

To get around this I have used base64 to encode the message and elm to send
it. With elm you can configure custome
headers where you can add a line indicating an attachment. This would make
it appear as a normal attachment on the
other end and Mail tools such as Netscape Messenger, or outlook can be used
to automatically decode and save off
the file as most people are accustomed to.  You basically need to add a
header line that indicates a base64 attachment
then in the message itself you need to add delimiter lines around the mime
code. Look at the source of any message
with an attachment to find the lines.

I had a perl script that I used to do this, but that was long ago and far
away and I can't seem to track it down. Hope the
info helps.



Sampath K Kari wrote:

> Hi,
>
> As part of a script, I want to mail a binary file as attachment. I have
> solaris 2.6
>
> I understand that I can't do this with mail, mailx. Pls suggest a
> solution.
>
> Thanks in advance.
>
> -Sampath
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp

--
******************************************************
                              Jarrett Carver
Unix/NT Systems Administrator, Webmaster, Perl Hacker
*******************************************************








More information about the SunHELP mailing list