<!-- $Id: mailbot.sgml,v 1.11 2010/09/22 00:53:17 mrsam Exp $ -->
<!-- Copyright 1998 - 2009 Double Precision, Inc. See COPYING for -->
<!-- distribution information. -->
Title: mailbot
Author: Sam Varshavchik
Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
Date: 02/10/2011
Manual: Double Precision, Inc.
Source: Courier Mail Server
Language: English
* set default formatting
-----------------------------------------------------------------
disable hyphenation
disable justification (adjust text to left margin only)
-----------------------------------------------------------------
* MAIN CONTENT STARTS HERE *
-----------------------------------------------------------------
\w'mailbot 'u mailbot [options] {program} [arg...]
In .mailfilter:
if (/^Subject: *info/) { cc "| mailbot -t /usr/share/autoresponse/info -d autoresponsedb \e -A \'From: info@domain.com\' /usr/bin/sendmail -f \'\'" }
mailbot reads an E-mail message on standard input and creates an E-mail message replying to the original message\'s sender. A program is specified as an argument to mailbot after all of mailbot options. program is expected to read the created autoreply on its standard input, and mail it. If program is not specified, mailbot runs \'sendmail -f ""\'.
mailbot has several options for suppressing duplicate autoresponse messages. If mailbot chooses not to send an autoresponse, it quietly terminates without running program. The autoresponse is optionally formatted as a MIME delivery status notification.
The text of the autoresponse is specified by the -t or the -m 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 -M option formats the the autoresponse itself as a MIME delivery status notification.
-A "header: value"
Add a header to the autoresponse. Multiple -A options are allowed. In most situations, the -A option must be used to set the "From:" header in the autogenerated response.
-faddress
Address the autoresponse to address, which must be an \m[blue]RFC 2822\m[]\s-2\u[1]\d\s+2 address. By default mailbot takes the autoresponse address from the From: (or the Reply-To:) header in the original message. -f, if present, overrides and explicitly sets the autoresponse address. "address" must immediately follow the -f option without an intervening space (it\'s a single command line argument). An -f option without an address takes the address from the SENDER environment variable.
-t filename
Read text autoresponse from filename, which should contain a plain text message.
-c charset
Set the autoresponse\'s MIME character set to charset. Run mailbot without any arguments to see the default character set.
-m filename
Read a MIME autoresponse from filename. This is similar to the -t option, except that filename contains MIME headers, followed by a blank line, and the corresponding MIME content. The contents of filename are inserted in the autoresponse without further processing. The specified file must contain the "Content-Type" header specifying the "text/plain" MIME type and the "charset" attributes, which overrides the -c parameter. If the specified file has a "Content-Transfer-Encoding" header it must be either "7bit" or "8bit", it may not be "quoted-printable". mailbot always drops any existing "Content-Transfer-Encoding" header and always adds the "Content-Transfer-Encoding: 8bit" header, even with the -m, since the salutation inserted into the message includes the sender\'s name, which may contain 8-bit characters.
-M address
Format the autoresponse as a delivery status notification (\m[blue]RFC 1894\m[]\s-2\u[2]\d\s+2). address is an \m[blue]RFC 2822\m[]\s-2\u[1]\d\s+2 E-mail address that generates the DSN. Note that the -A option should still be used in addition to -M in order to set the From: header on the autoresponse. -M sets the DSN address only. The -M option automatically sets -T replydsn
-T format
Set the reply format. format must be one of the following values:
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
-N
Do not quote the contents of the original message in the message create by "reply", "replyall", and "replydsn" options. .\}
.it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1
Note
The original message gets quoted, in the absence of this option, only if the original message was formatted as plain text. mailbot is unable to quote an original message which was formatted as HTML, or any other non-plaintext format.
-e
Generate a reply ("reply"-formats) to the address listed in any "Errors-To" or "Return-Path" header, if present, instead of the "From" header.
-S "salutation"
Use the given salutation in the "reply". The default value is "%F writes:". The following substitutions are recognized in the salutation string:
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
\h'-04'\(bu\h'+03'\c .\}
All other characters in the salutation string are left as is.
-F "marker"
When generating a forward, use the marker to separate the forwarded message from the autoreply text, instead of the default "--- Forwarded message ---"
-r addrlist
addrlist is a comma-separated list of \m[blue]RFC 2822\m[]\s-2\u[1]\d\s+2 E-mail addresses. mailbot sends an autoresponse only if the original message has at least one of the specified addresses in any To: or Cc: header.
-d filename
Create a small database, filename, 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 -d option is only available if maildrop has GDBM/DB extensions enabled.
-D x
Do not send duplicate autoresponses (see the -d option) for at least x days (default: 1 day). The -d 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 -D option has elapsed.
-s "subject"
Set the Subject: header on the autoresponse to subject.
-n
Show the resulting message, do not send it. Used for debugging purposes.
\m[blue]maildrop(1)\m[]\s-2\u[3]\d\s+2, \m[blue]reformail(1)\m[]\s-2\u[4]\d\s+2, \m[blue]reformime(1)\m[]\s-2\u[5]\d\s+2.
Sam Varshavchik
Author
\%http://www.rfc-editor.org/rfc/rfc2822.txt
\%http://www.rfc-editor.org/rfc/rfc1894.txt
\%[set $man.base.url.for.relative.links]/maildrop.html
\%[set $man.base.url.for.relative.links]/reformail.html
\%[set $man.base.url.for.relative.links]/reformime.html