Hi all!
On Sat, 04 Nov 2000, Eric Smith wrote:
> This "works"
> zip - *txt|mutt -s'send a zip file of all txt docs' eric -a -
>
> on 'V' in mutt received mail gives:
> -> I 1 <no description> [text/plain, quoted,
> iso-8859-1, 96K]
> A 2 - [text/plain, 7bit,
> us-ascii, 0K]
>
> With the top one being a legal zip file - only problem is that you
> have to name the file when saving it, cause it is nameless. Also the
> encoding says test/plain but when you save the attachemnt, you get a
> legal zip file.
>
> Is there a way to force a file name? this will also help mutt to state
> the encoding correctly.
On bash and ksh (maybe also other shells) you could use process
substitution <(cmd)
# mutt -s'send a zip file of all txt docs' eric -a <( zip - *txt) /dev/null
^^^^^^^^^^^^^^
cmd-subst ^^^^^^^^^
mailbody
The result is:
1 <no description> [text/plain, 7bit, 0K]
2 63 [applica/octet-stre, base64, 0.1K]
But it has some limitations:
- mutt doesn't care about the stream's file type, it's
application/oct-stream
- the filename is not defined (63 on my box, but maybe it varies
depending on OS)
You should create an temp file (e.g. /tmp/archive.zip) and append it.
Ciao for now, Dirk
--
Dirk Ruediger, Rostock, Germany
Always borrow money from a pessimist; he doesn't expect to be paid back.