recomposemail(1)recomposemail(1)NAMErecomposemail - recompose email message files into mailboxes
SYNOPSISrecomposemail [ -ahkv ] [ -m|M ] [ -y|Y ] [ base_name... ]
DESCRIPTIONrecomposemail takes a group of individual email message files as cre‐
ated by decomposemail(1), reassembles them into new mailboxes sorted by
date/time, and groups them according to selected options.
OPTIONS
The following options are supported:
-a Append messages to any existing file named the base name,
ignored with -m, -M, -y, or -Y.
-h Help, just print an informational message, and exit.
-k Keep the individual message files. Normally they would be
removed as they are copied.
-m Combine message files to monthly mailboxes of type mbox.YYMM,
sorted by date/time.
-M Combine message files to monthly mailboxes of type YYMM/mbox,
sorted by date/time.
-y Combine message files to yearly mailboxes of type mbox.YYYY,
sorted by date/time.
-Y Combine message files to yearly mailboxes of type YYYY/mbox,
sorted by date/time. With -m, combine to monthly mailboxes
of type YYYY/mbox.MM. With -M, combine to monthly mailboxes
of type YYYY/MM/mbox.
-v Verbose, provide more feedback.
OPERANDS
The following operands are supported:
base_name The base name (minus the “.YYYYMMDD.hhmmss.nnnnn” suffix) of
the individual message files to reassemble into standard
Internet style mailbox files. If no such arguments are
given, recomposemail searches the current directory for any
file names matching the message file name pattern, and acts
on these files.
USAGErecomposemail is used with decomposemail(1) - or by sortmail(1) - to
sort standard Internet style mailbox files into new mailbox files such
that the messages are sorted by date/time. recomposemail takes the
individual email message files produced by decomposemail(1), and
reassembles them into the new mailboxes.
In the absense of any of the -a, -m, -M, -y, or -Y options, if a file
by the name of the base name already exists, a new file with a unique
name will be created by appending a dot followed by a number, e.g.,
“mbox.1”.
With -m, -M, -y, or -Y, message files are appended to files with names
such as “mbox.9801”, “9801/mbox”, “mbox.1998”, or “1998/mbox”, respec‐
tively, where “9801” is the year and the month, and “1998” is the year.
The files and/or directories are created as needed.
If -Y is combined with -m or -M, message files are appended to files
with names such as “1998/mbox.01” or “1998/01/mbox”, respectively,
where “1998” is the year, and “01” is the month.
In all cases, the individual message files are removed as they are
copied, except when -k is specified.
EXAMPLES
Combine the email messages in the files with base name “tcl-list” in
the current directory into a mailbox file with that name. If a file by
that name already exists, a new file with a unique name such as “tcl-
list.1” will be created:
recomposemail tcl-list
Combine the email messages in the current directory that match the mail
file suffix pattern into mailbox files per each unique base name. The
messages will be appended to any such pre-existing files. The individ‐
ual message files will not be deleted. Progress will be verbosely
reported:
recomposemail-akv
Combine the email messages in the files with base names “bart” and
“sally” into monthly mailbox files per base name, such as “bart.9801”
and “sally.9801”. If any such files already exist, they will be
appended:
recomposemail-m bart sally
Combine the email messages in the files with base name “ALERT” into
monthly mailbox files in subdirectories, such as “9801/ALERT”,
“9802/ALERT”, etc. If any such files already exist, they will be
appended:
recomposemail-M ALERT
Combine the email messages in the files with base name “yomama” into
monthly mailbox files in yearly subdirectories, such as
“1998/yomama.01”, “1998/yomama.02”, etc. If any such files already
exist, they will be appended:
recomposemail-Ym yomama
FILES
mbox.YYYYMMDD.hhmmss.nnnnn
Serialized individual email message files, where “mbox”
is the name of the mailbox, “YYYYMMDD” is the year,
month, and day, “hhmmss” is the hour, minute, and second,
and “nnnnn” is a serial number.
DIAGNOSTICS
Returns 0 if no problems encountered.
Returns non-zero for any errors encountered.
BUGSrecomposemail is slow.
Due to command line length and argument limitations (implementation
dependent), some of the system commands used in the script might fail
when used with extremely large numbers of message files.
Mailbox date divisions other than monthly and yearly, such as daily,
etc., are currently not supported.
SEE ALSOdecomposemail(1), sh(1), sortmail(1),
“Toolman: Sorting and Archiving Email”, ;login: magazine (USENIX Asso‐
ciation), August 1998.
AUTHOR
sortmail was written by Daniel E. Singer (a.k.a. Toolman) at the
Department of Computer Science, Duke University.
Toolman 12 September 1998 recomposemail(1)