Current File : //usr/local/share/man/man1/mailbot.1
.\"  <!-- $Id: mailbot.sgml,v 1.8 2009/11/22 17:33:03 mrsam Exp $ -->
.\"  <!-- Copyright 1998 - 2009 Double Precision, Inc.  See COPYING for -->
.\"  <!-- distribution information. -->
'\" t
.\"     Title: mailbot
.\"    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 "MAILBOT" "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"
mailbot \- A MIME\-aware autoresponder utility
.SH "SYNOPSIS"
.HP \w'\fBmailbot\fR\ 'u
\fBmailbot\fR [options] {\fIprogram\fR} [arg...]
.PP
In
\&.mailfilter:
.sp
.nf
if (/^Subject: *info/)
{
     cc "| mailbot \-t /usr/share/autoresponse/info \-d autoresponsedb \e
            \-A \'From: info@domain\&.com\' /usr/bin/sendmail \-f \'\'"
}
.fi
.SH "DESCRIPTION"
.PP
\fBmailbot\fR
reads an E\-mail message on standard input and creates an E\-mail message replying to the original message\'s sender\&. A
\fBprogram\fR
is specified as an argument to
\fBmailbot\fR
after all of
\fBmailbot\fR
options\&.
\fBprogram\fR
is expected to read the created autoreply on its standard input, and mail it\&. If
\fBprogram\fR
is not specified,
\fBmailbot\fR
runs \'sendmail \-f ""\'\&.
.PP

\fBmailbot\fR
has several options for suppressing duplicate autoresponse messages\&. If
\fBmailbot\fR
chooses not to send an autoresponse, it quietly terminates without running
\fBprogram\fR\&. The autoresponse is optionally formatted as a MIME delivery status notification\&.
.PP
The text of the autoresponse is specified by the
\fB\-t\fR
or the
\fB\-m\fR
argument\&. Either one is required\&. Everything else is optional\&. The default behavior is to send an autoresponse unless the original message has the "Precedence: junk" or the "Precedence: bulk" header, or the "Precedence: list" header, or the "List\-ID:" header, or if its MIME content type is "multipart/report" (this is the MIME content type for delivery status notifications)\&. The
\fB\-M\fR
option formats the the autoresponse itself as a MIME delivery status notification\&.
.SH "OPTIONS"
.PP
\-A "\fIheader: value\fR"
.RS 4
Add a header to the autoresponse\&. Multiple
\fB\-A\fR
options are allowed\&. In most situations, the
\fB\-A\fR
option must be used to set the
\(lqFrom:\(rq
header in the autogenerated response\&.
.RE
.PP
\-f\fIaddress\fR
.RS 4
Address the autoresponse to
\fIaddress\fR, which must be an
\m[blue]\fBRFC 2822\fR\m[]\&\s-2\u[1]\d\s+2
address\&. By default
\fBmailbot\fR
takes the autoresponse address from the
From:
(or the
Reply\-To:) header in the original message\&.
\fB\-f\fR, if present, overrides and explicitly sets the autoresponse address\&. "\fIaddress\fR" must immediately follow the
\fB\-f\fR
option without an intervening space (it\'s a single command line argument)\&. An
\fB\-f\fR
option without an
\fIaddress\fR
takes the address from the
\fBSENDER\fR
environment variable\&.
.RE
.PP
\-t \fIfilename\fR
.RS 4
Read text autoresponse from
\fIfilename\fR, which should contain a plain text message\&.
.RE
.PP
\-c \fIcharset\fR
.RS 4
Set the autoresponse\'s MIME character set to
\fIcharset\fR\&. Run
\fBmailbot\fR
without any arguments to see the default character set\&.
.RE
.PP
\-m \fIfilename\fR
.RS 4
Read a MIME autoresponse from
filename\&. This is similar to the
\fB\-t\fR
option, except that
\fIfilename\fR
contains MIME headers, followed by a blank line, and the corresponding MIME content\&. The contents of
\fIfilename\fR
are inserted in the autoresponse without further processing\&.
.sp
The specified file must contain the
\(lqContent\-Type\(rq
header\&.
\fBmailbot\fR
always adds the
\(lqContent\-Transfer\-Encoding: 8bit\(rq
headers even with the
\fB\-m\fR, since the salutation inserted into the message includes the sender\'s name, which may contain 8\-bit characters\&.
.RE
.PP
\-M \fIaddress\fR
.RS 4
Format the autoresponse as a delivery status notification (\m[blue]\fBRFC 1894\fR\m[]\&\s-2\u[2]\d\s+2)\&.
\fIaddress\fR
is an
\m[blue]\fBRFC 2822\fR\m[]\&\s-2\u[1]\d\s+2
E\-mail address that generates the DSN\&. Note that the
\fB\-A\fR
option should still be used in addition to
\fB\-M\fR
in order to set the
From:
header on the autoresponse\&.
\fB\-M\fR
sets the DSN address only\&. The
\fB\-M\fR
option automatically sets
\fB\-T \fR\fBreplydsn\fR
.RE
.PP
\-T \fIformat\fR
.RS 4
Set the reply format\&.
\fIformat\fR
must be one of the following values:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\(lqreply\(rq
\- the default reply format\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\(lqreplyall\(rq
\- like
\(lqreply\(rq, except also puts the recipients in the original message\'s
\(lqTo:\(rq
and
\(lqCc:\(rq
headers into the
\(lqCc:\(rq
header of the generated reply\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\(lqreplydsn\(rq
\- like
\(lqreply\(rq, except the message is formatted as a delivery status notification\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\(lqforward\(rq
\- attach the original message as forwarded text\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\(lqforwardatt\(rq
\- attach the original message as a forwarded message attachment\&.
.RE
.RE
.PP
\-e
.RS 4
Generate a reply (\(lqreply\(rq\-formats) to the address listed in any
\(lqErrors\-To\(rq
or
\(lqReturn\-Path\(rq
header, if present, instead of the
\(lqFrom\(rq
header\&.
.RE
.PP
\-S \(lqsalutation\(rq
.RS 4
Use the given
\fIsalutation\fR
in the
\(lqreply\(rq\&. The default value is
\(lq%F writes:\(rq\&. The following substitutions are recognized in the salutation string:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%%
\- an explicit
%
character\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%n
\- a newline character\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%C
\- the
\(lqX\-Newsgroup:\(rq
header from the original message\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%N
\- the
\(lqNewsgroups:\(rq
header from the original message\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%i
\- the
\(lqMessage\-ID:\(rq
header from the original message\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%f
\- the original message\'s sender\'s address\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%F
\- the original message\'s sender\'s name\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%S
\- the
\(lqSubject:\(rq
header from the original message
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%d
\- the original message\'s date, in the local timezone\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

%{\fI\&.\&.\&.\fR}d
\- use
\fBstrftime\fR() to format the original message\'s date\&. A plain
%d
is equivalent to
%{%a, %d %b %Y %H:%M:%S %z}d\&.
.RE
.RS 4
All other characters in the salutation string are left as is\&.
.RE
.PP
\-F \(lqmarker\(rq
.RS 4
When generating a
forward, use the
\fImarker\fR
to separate the forwarded message from the autoreply text, instead of the default
\(lq\-\-\- Forwarded message \-\-\-\(rq
.RE
.PP
\-r \fIaddrlist\fR
.RS 4

\fIaddrlist\fR
is a comma\-separated list of
\m[blue]\fBRFC 2822\fR\m[]\&\s-2\u[1]\d\s+2
E\-mail addresses\&.
\fBmailbot\fR
sends an autoresponse only if the original message has at least one of the specified addresses in any
To:
or
Cc:
header\&.
.RE
.PP
\-d \fIfilename\fR
.RS 4
Create a small database,
\fIfilename\fR, that keeps track of sender\'s E\-mail addresses, and prevent duplicate autoresponses going to the same address (suppress autoresponses going back to the same senders, for subsequent received messages)\&. The
\fB\-d\fR
option is only available if
\fBmaildrop\fR
has GDBM/DB extensions enabled\&.
.RE
.PP
\-D \fIx\fR
.RS 4
Do not send duplicate autoresponses (see the
\fB\-d\fR
option) for at least
\fIx\fR
days (default: 1 day)\&. The
\fB\-d\fR
option creates a database of E\-mail addresses and the times an autoresponse was last mailed to them\&. Another autoresponse to the same address will not be mailed until at least the amount of time specified by the
\fB\-D\fR
option has elapsed\&.
.RE
.PP
\-s "\fIsubject\fR"
.RS 4
Set the
Subject:
header on the autoresponse to
\fIsubject\fR\&.
.RE
.PP
\-n
.RS 4
Show the resulting message, do not send it\&. Used for debugging purposes\&.
.RE
.SH "SEE ALSO"
.PP

\m[blue]\fB\fBmaildrop\fR(1)\fR\m[]\&\s-2\u[3]\d\s+2,
\m[blue]\fB\fBreformail\fR(1)\fR\m[]\&\s-2\u[4]\d\s+2,
\m[blue]\fB\fBreformime\fR(1)\fR\m[]\&\s-2\u[5]\d\s+2\&.
.SH "NOTES"
.IP " 1." 4
RFC 2822
.RS 4
\%http://www.rfc-editor.org/rfc/rfc2822.txt
.RE
.IP " 2." 4
RFC 1894
.RS 4
\%http://www.rfc-editor.org/rfc/rfc1894.txt
.RE
.IP " 3." 4
\fBmaildrop\fR(1)
.RS 4
\%[set $man.base.url.for.relative.links]/maildrop.html
.RE
.IP " 4." 4
\fBreformail\fR(1)
.RS 4
\%[set $man.base.url.for.relative.links]/reformail.html
.RE
.IP " 5." 4
\fBreformime\fR(1)
.RS 4
\%[set $man.base.url.for.relative.links]/reformime.html
.RE