| Current File : //usr/local/share/man/man1/reformail.1 |
.\" <!-- $Id: reformail.sgml,v 1.6 2009/11/22 17:33:03 mrsam Exp $ -->
.\" <!-- Copyright 1998 - 2007 Double Precision, Inc. See COPYING for -->
.\" <!-- distribution information. -->
'\" t
.\" Title: reformail
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 02/19/2010
.\" Manual: Double Precision, Inc.
.\" Source: Double Precision, Inc.
.\" Language: English
.\"
.TH "REFORMAIL" "1" "02/19/2010" "Double Precision, Inc." "Double Precision, Inc."
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
reformail \- E\-mail reformatting tool
.SH "SYNOPSIS"
.HP \w'\fBreformail\fR\ 'u
\fBreformail\fR \-s command [option...]
.HP \w'\fBreformail\fR\ 'u
\fBreformail\fR \-D len \fIfilename\fR
.HP \w'\fBreformail\fR\ 'u
\fBreformail\fR \-x\ \fIheader:\fR...
.HP \w'\fBreformail\fR\ 'u
\fBreformail\fR \-X\ \fIheader:\fR...
.HP \w'\fBreformail\fR\ 'u
\fBreformail\fR [\fIoptions\fR...]
.sp
See below for additional options
.SH "DESCRIPTION"
.PP
The
\fBreformail\fR
program reads a message on standard input, reformats it in some way, and writes the message to standard output:
.SS "Splitting mailboxes into individual messages"
.PP
The
\fB\-s\fR
option splits the mbox\-formatted mailbox file on standard input into individual messages\&. An external program is executed for each message\&. The contents of each individual message will be provided to the external program on standard input\&.
.PP
If the
\fBFILENO\fR
environment variable is set to a number,
\fBreformail\fR
will consecutively increment
\fBFILENO\fR
each time the program is executed for each individual message\&.
.PP
If
\fBFILENO\fR
is not set, it\'s initial value will be "000"\&. If
\fBFILENO\fR
is set to a non\-numeric value,
\fBFILENO\fR
will remain unchanged\&.
.SS "Detecting duplicate messages"
.PP
The
\fB\-D\fR
option implements a simple way to delete duplicate messages in incoming mail\&.
\fIfilename\fR
is a file that will be approximately \'\fIlen\fR\' bytes long\&. This file will be used by
\fBreformail\fR
to save message IDs seen in recent mail\&.
\fBreformail\fR
reads the message on standard input\&. If the message has a
Message\-ID:
header that\'s already in the cache file,
\fBreformail\fR
terminates with the exit code set to 0\&. Otherwise,
\fBreformail\fR
terminates with the exit code set to 1\&.
.SS "Extracting headers"
.PP
The
\fB\-x\fR
and
\fB\-X\fR
options extract the indicated headers from the message, and print them to standard output\&. Multiple
\fB\-x\fR
and
\fB\-X\fR
options can be specified at the same time, and may be intermixed\&.
.PP
The
\fB\-x\fR
option extracts and prints the contents of the header\&. The
\fB\-X\fR
option prints the name of the header as well\&.
.PP
In all other situations,
\fBreformail\fR
copies the message on its standard input to its standard output, reformatting the message as follows:
.SH "OPTIONS"
.PP
\-a\'header: value\'
.RS 4
Append a custom header to the message if this header does not already exist\&. If the header is either
Message\-ID:
or
Resent\-Message\-ID:
and the value is empty,
\fBreformail\fR
generates a (hopefully) unique message ID for you\&.
.RE
.PP
\-A\'header: value\'
.RS 4
Append a custom header to the message even if this header already exists\&. If the header is either
Message\-ID:
or
Resent\-Message\-ID:
and the value is empty,
\fBreformail\fR
generates a (hopefully) unique message ID for you\&.
.RE
.PP
\-c
.RS 4
Concatenate multi\-line headers\&. Headers split on multiple lines are combined into a single line\&.
.RE
.PP
\-d\fIn\fR
.RS 4
If n is
1, each line will be terminated with CRLF\&. If n is
0
(default), each line will be terminated with LF\&.
\fBreformail\fR
reads a message with either line terminator, and will force the message to have the specified line termination\&.
.RE
.PP
\-f0
.RS 4
Remove the "From_" line from the message, if it\'s there\&.
.RE
.PP
\-f1
.RS 4
Add the "From_" line to the message, if it\'s not there\&.
\fBreformail\fR
will attempt to generate the "From_" line from any
Errors\-To:,
Return\-Path:, or
From:
headers in the message\&. "root" will be used if
\fBreformail\fR
is unable to determine the return address\&.
.RE
.PP
\-i\'\fIheader: value\fR\'
.RS 4
Appends a custom header to the message\&. If this header already exists it is renamed by prepending "Old\-" to the name of the header\&.
.RE
.PP
\-I\'\fIheader: value\fR\'
.RS 4
Append a custom header to the message\&. If this header already exists in the message, the old header is completely removed\&. If the value is empty, any existing header is completely removed, and nothing gets appended\&.
.RE
.PP
\-R oldheader: newheader:
.RS 4
Rename the indicated header\&.
.RE
.PP
\-u\'header:\'
.RS 4
If this header occurs multiple times in the message, remove all occurrences except the first one\&.
.RE
.PP
\-U\'header:\'
.RS 4
If this header occurs multiple times in the message, remove all occurrences except the last one\&.
.RE
.SH "AUTOREPLIES"
.PP
The autoreply options from earlier versions of
\fBmailbot\fR
have been moved into
\m[blue]\fB\fBmailbot\fR(1)\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "BUGS"
.PP
For the
\fB\-a\fR,
\fB\-A\fR, and
\fB\-I\fR
options, a space after the header name and the colon is considered to be a non\-empty field\&.
.PP
Do not provide the same header to more than one family of header\-modifying options, such as
\fB\-u\fR/\fB\-U\fR
and
\fB\-a\fR/\fB\-A\fR\&. Doing so yields unpredictable results\&. It\'s better to run
\fBreformail\fR
several times (use a pipe, perhaps)\&.
.SH "SEE ALSO"
.PP
\m[blue]\fB\fBcourier\fR(8)\fR\m[]\&\s-2\u[2]\d\s+2,
\fBsendmail\fR(8),
\m[blue]\fB\fBmailbot\fR(1)\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fB\fBmaildrop\fR(1)\fR\m[]\&\s-2\u[3]\d\s+2\&.
.SH "NOTES"
.IP " 1." 4
\fBmailbot\fR(1)
.RS 4
\%[set $man.base.url.for.relative.links]/mailbot.html
.RE
.IP " 2." 4
\fBcourier\fR(8)
.RS 4
\%[set $man.base.url.for.relative.links]/courier.html
.RE
.IP " 3." 4
\fBmaildrop\fR(1)
.RS 4
\%[set $man.base.url.for.relative.links]/maildrop.html
.RE