Name
metamail — stdin stdout - file -- opt --help --version
Synopsis
metamail [options]mail_file
Modern email programs can send and receive attachments so
easily we rarely think about it, but this was not always the case.
Programs like metamail were
created to work with attachments directly on the command line,
appending or extracting them to and from mail messages. For example,
if you have an email message in a file, mymessage, and it contains a
JPEG image as an attachment, metamail can extract the image:
$ metamail -w mymessage
Content-Description: coolcat.jpg
This message contains 'image/jpeg`-format data.
Please enter the name of a file to which the data should
be written (Default: coolcat.jpg) > hotdog.jpg
Wrote file hotdog.jpgHere we extracted the attached JPEG file, coolcat.jpg, renaming it as hotdog.jpg. The -w option tells metamail to write the data to a file;
otherwise, metamail would attempt
to display the attachment with an appropriate program, such as an
image viewer:
$ metamail mymessage
This message contains 'image/jpeg'-format data.
Do you want to view it using the 'xv' command (y/n) [y] y
---Executing: gthumbBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access