Hello,
Do you know how to extract attachments from a raw mail message on Unix? I want to do it from shell script (ksh). The mail file is the raw e-mail with headers and encoded attachments..
PS: I can't use perl!
Thx.
Hello,
Do you know how to extract attachments from a raw mail message on Unix? I want to do it from shell script (ksh). The mail file is the raw e-mail with headers and encoded attachments..
PS: I can't use perl!
Thx.
A very long time ago, I used metamail for exactly this sort of thing.
see http://kb.iu.edu/data/aibt.html
M.
I would take a look at MH and its successor, NMH. From the FAQ:
The MH message handling system is a set of electronic mail programs in the public domain. If your computer runs Unix, it can probably run MH.
The big difference between MH and most other "mail user agents" is
that you can use MH from a Unix shell prompt. In MH, each command is a separate program, and the shell is used as an interpreter. So, all the power of Unix shells (pipes, redirection, history, aliases, and
so on) works with MH--you don't have to learn a new interface. Other mail agents have their own command interpreter for their individual
mail commands (although the mush mail agent simulates a Unix shell).
mpack did it for me! (actually the munpack part) Exactly what I needed: tiny standalone executable with no extra.
Another solution is to use uudeview
. Works similar to munpack
. Just type
$ uudeview file.eml