Normally, MH stores one message per file. The packf and packmbox commands "pack" messages into a single file. packf uses MMDF style; packmbox uses UUCP style.
These formats are a good way to package messages for transport to another computer. They also take less filesystem space than standard MH folders do: see the Section Saving Filesystem Space.
Example: packf file format
% cat -v packedfile ^A^A^A^A Header: xxx Header: xxx ... Body... ^A^A^A^A ^A^A^A^A Header: xxx Header: xxx ... Body... ^A^A^A^AUnless you give the -file switch, packf uses a file named msgbox in the current directory. If the file exists, the messages are appended. packf copies all messages in the current folder unless you give a folder and message numbers. So, for example, to copy the first ten messages in your current folder and message 23 from data to the file /tmp/messages:
% packf -file /tmp/messages first:10 % packf -file /tmp/messages 23 +data
As the next Example shows, messages packed with packmbox are separated by lines starting with From, an address and a date. packmbox gets the address from the Return-Path: header field, if there is one; otherwise it creates an address from the From: field. If any line in the message starts with the string "From " ("From" and a space), packmbox changes the string to >From . There's an empty line added after each message.
Example: packmbox file format
% cat packedfile From firstname.lastname@example.org Mon Jan 09 10:55:02 1995 Header: xxx Header: xxx ... Body... From ehuser Mon Jan 09 14:17:28 1995 Header: xxx Header: xxx ... Body...packmbox is in your system's MH library directory, so you'll probably have to use its absolute pathname. It writes to the standard output, so you'll want to redirect its output to a file. Use the shell's > (right angle bracket) operator to create or overwrite the packed file; the >> operator will append. packmbox copies all messages in the current folder unless you give a folder and message numbers. So, for example, to copy the first ten messages in your current folder and message 23 from data to the file /tmp/messages:
% /path/to/library/packmbox first:10 > /tmp/messages % /path/to/library/packmbox 23 +data >> /tmp/messages
[Table of Contents] [Index] [Previous: Bursting Messages] [Next: MH Shell on a Mailbox File: msh]
This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.
Suggestions are welcome: Jerry Peek <email@example.com>