LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mpack

encodes files into MIME format for email transmission

TLDR

Encode file as a MIME message to a file
$ mpack -o [output.mime] [file]
copy
Encode and mail the file to one or more recipients
$ mpack -s "[Subject]" [file] [user@example.com]
copy
Encode to stdout for piping into another mailer
$ mpack -o - [file]
copy
Fragment a large file into multiple messages of at most 100 000 chars each
$ mpack -s "[Subject]" -m [100000] [large_file] [user@example.com]
copy
Force a specific MIME content type
$ mpack -c application/pdf [report.pdf] [user@example.com]
copy
Post the file to a Usenet newsgroup instead of e-mail
$ mpack -n [comp.misc] [file]
copy

SYNOPSIS

mpack [-a] [-s subject] [-d descriptionfile] [-m maxsize] [-c content-type] file address...mpack [-a] [-s subject] [-d descriptionfile] [-m maxsize] [-c content-type] -o outputfile filempack [-a] [-s subject] [-d descriptionfile] [-m maxsize] [-c content-type] -n newsgroups file

DESCRIPTION

mpack encodes a binary or text file into one or more MIME-formatted messages, optionally mailing them to a list of addresses or posting them to a newsgroup. It generates the necessary headers (MIME-Version, Content-Type, Content-Transfer-Encoding, Content-Disposition) and base64-encodes binary content. With -m, the message is split into independently mailable fragments that munpack can reassemble at the other end.

PARAMETERS

-s subject

Email subject line.
-d descriptionfile
Include the contents of descriptionfile as an introductory text part before the attachment.
-m maxsize
Fragment the message into chunks no larger than maxsize characters (0 = no limit).
-c content-type
Override the MIME Content-Type of the attachment (e.g. application/pdf, image/png).
-a
Mark the encoded file as an attachment (Content-Disposition: attachment) rather than inline.
-o outputfile
Write the encoded message to outputfile (use - for stdout). When fragmenting, numbered suffixes are appended.
-n newsgroups
Post to the named Usenet newsgroup(s) instead of mailing.

INSTALL

sudo apt install mpack
copy
brew install mpack
copy
nix profile install nixpkgs#mpack
copy

CAVEATS

Companion to munpack. Sending mail or posting requires a configured local MTA (sendmail-compatible) or news transport. Fragmented messages must all reach the recipient and be reassembled with munpack before decoding.

HISTORY

mpack was written by John G. Myers at Carnegie Mellon as part of the MIME tools for handling binary email attachments.

SEE ALSO

munpack(1), uuencode(1), base64(1), sendmail(1)

Copied to clipboard
Kai