Re: Script sending ascii attachment

From: Alan Connor (zzzzzz_at_xxx.invalid)
Date: 07/29/05


Date: Fri, 29 Jul 2005 09:57:15 GMT

On comp.unix.shell, in <dcbejo$rfd$1@malgudi.oar.net>, "Dale
DeRemer" wrote:

> I need to send an ascii file as an email attachement to
> someone we work with. I need to be able to script this email
> for sending at off hours. The recipient has stringent
> requirements, (lack of ability?). Anyway, I found on Heiner's
> page how to send a uuencoded file as an attachement. uuencode
> file file | mailx -s "Subject" recipient@xyz.com
>
> But, uuencoded files seem to take out the <cr>. Anyone know
> a command line way to send an ascii file, unaltered, as an
> attachment?
>
>

You are kind of vague above. If the file is ascii to begin
with, you don't need to uuencode it. But if it isn't:

I'd suggest using the mimencode utility rather than uuencode.

mimencode inputfile -o outputfile_name

Note that the above script of yours does _not_ result in an
"attached" file. For an attachment you need specific headers and
a boundary designator in the body.

I'd suggest using a modern mail client like mutt:

mutt -s "Subject" recipient@xyz.com -a file

It automatically mimencodes the file (if it isn't just plain text
to begin with) and creates the proper headers and such.

AC



Relevant Pages

  • Solaris shell archives - summary
    ... file from line 1088 onwards ... Code in script reads: ... Experimentation reveals that it is simply a call to uuencode outside the ... The Royal Bank of Scotland plc. ...
    (SunManagers)
  • RE: Sending an email as an attachment from the command line
    ... What I want if for them to recive an email, whith an email in it. ... i have done this before - alas i have lost the script but i remember i ... used uuencode - i will try and find the script but until then look ... No virus found in this incoming message. ...
    (Fedora)
  • Re: logs
    ... but I think you meant 'strings' intead of uuencode. ... >> Anyone know how to script a cron job that will email logs on a weekly ...
    (comp.os.linux.networking)
  • OT: date command for pflogsumm.pl Script - undefined variable
    ... gzip -c /var/log/MX1-PostfixDailyReport.$| uuencode ... and I know very little about programming, ... I just want this script to run and email me the ...
    (freebsd-questions)