← 返回命令列表

Linux command

mpack 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Encode file as a MIME message

mpack -o [output.mime] [file]

Encode and mail

mpack -s "[Subject]" [file] [user@example.com]

Encode to stdout

mpack -o - [file]

Fragment a large file

mpack -s "[Subject]" -m [100000] [large_file] [user@example.com]

Force a specific MIME content type

mpack -c application/pdf [report.pdf] [user@example.com]

Post the file to a Usenet newsgroup

mpack -n [comp.misc] [file]

说明

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.

参数

-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.

FAQ

What is the mpack command used for?

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.

How do I run a basic mpack example?

Run `mpack -o [output.mime] [file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -s _subject_ do in mpack?

Email subject line.