1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
|
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>mailbot</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"/><link rel="home" href="#mailbot" title="mailbot"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--
Copyright 1998 - 2009 Double Precision, Inc. See COPYING for distribution
information.
--></head><body><div class="refentry"><a id="mailbot" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>mailbot — A MIME-aware autoresponder utility</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">mailbot</code> [options] {<em class="replaceable"><code>program</code></em>} [arg...]</p></div><div class="informalexample"><p>In <code class="filename">.mailfilter:</code></p><pre class="programlisting" xml:space="preserve">
if (/^Subject: *info/)
{
cc "| mailbot -t /usr/share/autoresponse/info -d autoresponsedb \
-A 'From: info@domain.com' /usr/bin/sendmail -f ''"
}
</pre></div></div><div class="refsect1"><a id="mailbot_description" shape="rect"> </a><h2>DESCRIPTION</h2><p><span class="command"><strong>mailbot</strong></span> reads an E-mail message on standard input
and creates an E-mail message replying to the original message's sender.
A
<span class="command"><strong>program</strong></span> is specified as an argument to
<span class="command"><strong>mailbot</strong></span> after all of <span class="command"><strong>mailbot</strong></span> options.
<span class="command"><strong>program</strong></span> is expected to read the
created autoreply on its standard input, and mail it.
If <span class="command"><strong>program</strong></span> is not specified,
<span class="command"><strong>mailbot</strong></span> runs '<code class="literal">sendmail -f ""</code>'.</p><p>
<span class="command"><strong>mailbot</strong></span> has several options for suppressing duplicate
autoresponse messages.
If <span class="command"><strong>mailbot</strong></span> chooses not to send an autoresponse, it quietly
terminates without running <span class="command"><strong>program</strong></span>.
The autoresponse is optionally
formatted as a MIME delivery status notification.</p><p>
The text of the autoresponse is specified by the <code class="option">-t</code> or
the <code class="option">-m</code> argument. Either one is required.
Everything else is optional.
The only exception is the <code class="option">-T replydraft</code> option, which requires
the <code class="option">-l</code> option instead of either <code class="option">-t</code> or
<code class="option">-m</code>.
The default behavior is to send an autoresponse unless the original message
has the "<code class="literal">Precedence: junk</code>" or the
"<code class="literal">Precedence: bulk</code>" header, or the
"<code class="literal">Precedence: list</code>" header, or the
"<code class="literal">List-ID:</code>" header,
or if
its MIME content type is "<code class="literal">multipart/report</code>"
(this is the MIME content type for delivery status notifications).
The <code class="option">-M</code> option formats the
the autoresponse itself as a MIME delivery status notification.</p></div><div class="refsect1"><a id="mailbot_options" shape="rect"> </a><h2>OPTIONS</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-A "<em class="replaceable"><code>header: value</code></em>"</span></dt><dd><p>
Add a header to the autoresponse. Multiple <code class="option">-A</code>
options are allowed.
In most situations, the <code class="option">-A</code> option must be
used to set the <span class="quote">“<span class="quote">From:</span>”</span> header in the autogenerated
response.
</p></dd><dt><span class="term">-f<em class="replaceable"><code>address</code></em></span></dt><dd><p>
Address the autoresponse to <em class="replaceable"><code>address</code></em>, which must
be an
<a class="ulink" href="http://tools.ietf.org/html/rfc2822" target="_top" shape="rect">RFC 2822</a>
address.
By default <span class="command"><strong>mailbot</strong></span> takes the autoresponse
address from the
<code class="literal">From:</code> (or the <code class="literal">Reply-To:</code>) header
in the original message.
<code class="option">-f</code>, if present, overrides and explicitly sets the
autoresponse address.
"<em class="replaceable"><code>address</code></em>" must immediately follow the
<code class="option">-f</code> option without an intervening space
(it's a single command line argument).
An <code class="option">-f</code> option without an <em class="replaceable"><code>address</code></em>
takes the address from the <code class="envar">SENDER</code> environment variable.</p></dd><dt><span class="term">-t <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
Read text autoresponse from <em class="replaceable"><code>filename</code></em>,
which must contain a plain text message in <span class="quote">“<span class="quote">flowed-text</span>”</span> format.
In a <span class="quote">“<span class="quote">flowed-text</span>”</span>-formatted message, each line that ends with
a space character indicates that the line logically flows into the next line.
This allows the message to be reformatted for any shown display width.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Messages in languages (see the <code class="option">-c</code>
option) which use spaces as word delimiters must have <span class="emphasis"><em>two</em></span>
spaces at the end of a flowed line. The last space on a flowed line is logically
removed, and the first space separates the
last word on the previous line from the first word on the next line. Otherwise,
the two words will not have a logical space between them if they get
repositioned as part of adjusting the message's width for display.
</p><p>
Messages in ideographic languages that do not use spaces as word delimiters
need only one space trailing a flowed line.</p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
The trailing whitespace has no visual impact when shown by software
that does not implemented flowed text format, and always displays messages
using their original width.</p></div></dd><dt><span class="term">-c <em class="replaceable"><code>charset</code></em></span></dt><dd><p>
Set the autoresponse's MIME character set to
<em class="replaceable"><code>charset</code></em>.
Run <span class="command"><strong>mailbot</strong></span> without any arguments to see the
default character set.</p></dd><dt><span class="term">-m <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
Read a MIME autoresponse from <code class="filename">filename</code>.
This is similar to the <code class="option">-t</code> option,
except that <em class="replaceable"><code>filename</code></em> contains MIME headers,
followed by a blank line, and the corresponding
MIME content. The contents of <em class="replaceable"><code>filename</code></em> are
inserted in the autoresponse without further processing.</p><p>
The specified file must contain the
<span class="quote">“<span class="quote">Content-Type</span>”</span> header specifying the
<span class="quote">“<span class="quote">text/plain</span>”</span> MIME type, with the
<span class="quote">“<span class="quote">format=flowed</span>”</span>,
<span class="quote">“<span class="quote">delsp=yes</span>”</span>, and the
<span class="quote">“<span class="quote">charset</span>”</span> attributes, which override the
<code class="option">-c</code> parameter.
If the specified file has a <span class="quote">“<span class="quote">Content-Transfer-Encoding</span>”</span>
header it must be either <span class="quote">“<span class="quote">7bit</span>”</span> or <span class="quote">“<span class="quote">8bit</span>”</span>,
it may not be <span class="quote">“<span class="quote">quoted-printable</span>”</span>.
<span class="command"><strong>mailbot</strong></span> always drops any
existing <span class="quote">“<span class="quote">Content-Transfer-Encoding</span>”</span> header and
always adds the
<span class="quote">“<span class="quote">Content-Transfer-Encoding: 8bit</span>”</span> header, even with
the <code class="option">-m</code>, since the salutation inserted into the
message includes the sender's name, which may contain 8-bit
characters. Example:
</p><div class="blockquote"><blockquote class="blockquote"><div class="informalexample"><pre class="programlisting" xml:space="preserve">
Content-Type: text/plain; format=flowed; delsp=yes;
charset="iso-8859-1"
Mary had a little lamb,
Its fleece was white as snow.
And everywhere Mary went,
The lamb was sure to go.</pre></div></blockquote></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
When the <code class="option">-m</code> option is specified
<span class="command"><strong>mailbot</strong></span> ignores the locale's character
set and formats the autoreply according to the character set read from the
<span class="quote">“<span class="quote">Content-Type</span>”</span> header.</p></div></dd><dt><span class="term">-M <em class="replaceable"><code>address</code></em></span></dt><dd><p>
Format the autoresponse as a delivery status notification
(<a class="ulink" href="http://tools.ietf.org/html/rfc1894" target="_top" shape="rect">RFC 1894</a>).
<em class="replaceable"><code>address</code></em> is an
<a class="ulink" href="http://tools.ietf.org/html/rfc2822" target="_top" shape="rect">RFC 2822</a>
E-mail address that generates the DSN.
Note that the <code class="option">-A</code> option should still be used in
addition to <code class="option">-M</code> in order to set the
<code class="literal">From:</code> header on the autoresponse.
<code class="option">-M</code> sets the DSN address only.
The <code class="option">-M</code> option automatically sets
<code class="option">-T <code class="literal">replydsn</code></code>
</p></dd><dt><span class="term">-R <em class="replaceable"><code>type</code></em></span></dt><dd><p>
Specify the feedback report type, with
<em class="replaceable"><code>type</code></em> set to
<code class="literal">abuse</code>,
<code class="literal">fraud</code>,
<code class="literal">other</code>, or
<code class="literal">virus</code>.
Must be used together with <span class="quote">“<span class="quote">-T feedback</span>”</span> or
<span class="quote">“<span class="quote">-T replyfeedback</span>”</span>.
</p></dd><dt><span class="term">-T <em class="replaceable"><code>format</code></em></span></dt><dd><p>
Set the reply format. <em class="replaceable"><code>format</code></em>
must be one of the following values:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
<span class="quote">“<span class="quote">reply</span>”</span> - the default reply format.
</p></li><li class="listitem"><p>
<span class="quote">“<span class="quote">replyall</span>”</span> - like <span class="quote">“<span class="quote">reply</span>”</span>, except
also puts the recipients in the original message's
<span class="quote">“<span class="quote">To:</span>”</span> and <span class="quote">“<span class="quote">Cc:</span>”</span> headers into the
<span class="quote">“<span class="quote">Cc:</span>”</span> header of the generated reply.
</p></li><li class="listitem"><p>
<span class="quote">“<span class="quote">replydsn</span>”</span> - like <span class="quote">“<span class="quote">reply</span>”</span>, except
the message is formatted as a delivery status notification.
</p></li><li class="listitem"><p>
<span class="quote">“<span class="quote">replydraft</span>”</span> - like <span class="quote">“<span class="quote">reply</span>”</span>, with
the text of the autoresponse coming from a maildir specified
by the <code class="option">-l</code> option. See <span class="quote">“<span class="quote">Autoreplies
from a maildir folder</span>”</span>, below.
</p></li><li class="listitem"><p>
<span class="quote">“<span class="quote">forward</span>”</span> - attach the original message as
forwarded text.
</p></li><li class="listitem"><p>
<span class="quote">“<span class="quote">forwardatt</span>”</span> - attach the original message as
a forwarded message attachment.
</p></li><li class="listitem"><p>
<span class="quote">“<span class="quote">feedback</span>”</span> - generate an Email Feedback Report
message (see <a class="ulink" href="http://tools.ietf.org/html/rfc5965" target="_top" shape="rect">RFC
5965</a>). The <span class="quote">“<span class="quote">-R</span>”</span> option is required when
this is specified.
</p></li><li class="listitem"><p>
<span class="quote">“<span class="quote">replyfeedback</span>”</span> - like <span class="quote">“<span class="quote">feedback</span>”</span>, but
also adds a <span class="quote">“<span class="quote">To:</span>”</span> header, addressed to the original
message's sender.
</p></li></ul></div></dd><dt><span class="term">-N</span></dt><dd><p>
Do not quote the contents of the original message in the message
created by
<span class="quote">“<span class="quote"><code class="literal">reply</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">replyall</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">replydsn</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">feedback</code></span>”</span>, and
<span class="quote">“<span class="quote"><code class="literal">replyfeedback</code></span>”</span> options.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
The original message gets quoted, in the absence of this option,
only if the original message was formatted as plain text.
<span class="command"><strong>mailbot</strong></span> is unable to quote an original
message which was formatted as <acronym class="acronym">HTML</acronym>, or any
other non-plaintext format.
</p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
For <span class="quote">“<span class="quote"><code class="literal">replydsn</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">feedback</code></span>”</span>, and
<span class="quote">“<span class="quote"><code class="literal">replyfeedback</code></span>”</span> options,
the convention is to attach the original message, or only its
headers, separately; so this option should always be specified
for these three reply formats.
</p></div></dd><dt><span class="term">-a</span></dt><dd><p>
Attach the entire message, for
<span class="quote">“<span class="quote"><code class="literal">replydsn</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">feedback</code></span>”</span>, and
<span class="quote">“<span class="quote"><code class="literal">replyfeedback</code></span>”</span>, instead of only its
headers.
</p></dd><dt><span class="term">-e</span></dt><dd><p>
Generate a reply (<span class="quote">“<span class="quote">reply</span>”</span>-formats) to the
address listed in any <span class="quote">“<span class="quote">Errors-To</span>”</span> or
<span class="quote">“<span class="quote">Return-Path</span>”</span> header, if present, instead of the
<span class="quote">“<span class="quote">From</span>”</span> header.
</p></dd><dt><span class="term">-S <span class="quote">“<span class="quote">salutation</span>”</span></span></dt><dd><p>
Use the given <em class="replaceable"><code>salutation</code></em>
in the <span class="quote">“<span class="quote">reply</span>”</span>.
The default value is <span class="quote">“<span class="quote">%F writes:</span>”</span>.
The following substitutions are recognized in the salutation
string:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
<code class="literal">%%</code> - an explicit <code class="literal">%</code>
character.
</p></li><li class="listitem"><p>
<code class="literal">%n</code> - a newline character.
</p></li><li class="listitem"><p>
<code class="literal">%C</code> - the
<span class="quote">“<span class="quote">X-Newsgroup:</span>”</span> header from the original message.
</p></li><li class="listitem"><p>
<code class="literal">%N</code> - the <span class="quote">“<span class="quote">Newsgroups:</span>”</span>
header from the original message.
</p></li><li class="listitem"><p>
<code class="literal">%i</code> - the <span class="quote">“<span class="quote">Message-ID:</span>”</span>
header from the original message.
</p></li><li class="listitem"><p>
<code class="literal">%f</code> - the original message's sender's address.
</p></li><li class="listitem"><p>
<code class="literal">%F</code> - the original message's sender's name.
</p></li><li class="listitem"><p>
<code class="literal">%S</code> - the
<span class="quote">“<span class="quote">Subject:</span>”</span> header from the original message
</p></li><li class="listitem"><p>
<code class="literal">%d</code> - the original message's date, in the
local timezone.
</p></li><li class="listitem"><p>
<code class="literal">%{<em class="replaceable"><code>...</code></em>}d</code>
- use <code class="function">strftime</code>() to format the original
message's date.
A plain <code class="literal">%d</code> is equivalent to
<code class="literal">%{%a, %d %b %Y %H:%M:%S %z}d</code>.
</p></li></ul></div><p>
All other characters in the salutation string are left as is.
</p></dd><dt><span class="term">-F <span class="quote">“<span class="quote">marker</span>”</span></span></dt><dd><p>
When generating a <code class="literal">forward</code>, use the
<em class="replaceable"><code>marker</code></em> to separate the forwarded
message from the autoreply text, instead of the default
<span class="quote">“<span class="quote">--- Forwarded message ---</span>”</span>
</p></dd><dt><span class="term">-r <em class="replaceable"><code>addrlist</code></em></span></dt><dd><p>
<em class="replaceable"><code>addrlist</code></em> is a comma-separated list of
<a class="ulink" href="http://tools.ietf.org/html/rfc2822" target="_top" shape="rect">RFC 2822</a>
E-mail addresses.
<span class="command"><strong>mailbot</strong></span> sends an autoresponse only if
the original message has at least one of the specified addresses in any
<code class="literal">To:</code> or <code class="literal">Cc:</code> header.</p></dd><dt><span class="term">-d <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
Create a small database, <em class="replaceable"><code>filename</code></em>,
that keeps track of senders' 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 <code class="option">-d</code> option is only available if
<span class="command"><strong>maildrop</strong></span> has GDBM/DB extensions enabled.</p></dd><dt><span class="term">-D <em class="replaceable"><code>x</code></em></span></dt><dd><p>
Do not send duplicate autoresponses (see the
<code class="option">-d</code> option) for at least
<em class="replaceable"><code>x</code></em> days (default: 1 day). The
<code class="option">-d</code> 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 <code class="option">-D</code> option has elapsed.</p></dd><dt><span class="term">-s "<em class="replaceable"><code>subject</code></em>"</span></dt><dd><p>
Set the <code class="literal">Subject:</code> header on the autoresponse to
<em class="replaceable"><code>subject</code></em>.</p></dd><dt><span class="term">-n</span></dt><dd><p>
Show the resulting message, do not send it. Used for debugging
purposes.
</p></dd><dt><span class="term">--feedback-original-envelope-id <em class="replaceable"><code>"<envelopeid>"</code></em>,
--feedback-original-mail-from <em class="replaceable"><code>"<mailfrom>"</code></em>,
--feedback-reporting-mta "<em class="replaceable"><code>dns; hostname"</code></em>,
--feedback-source-ip <em class="replaceable"><code>aaa.bbb.ccc.ddd</code></em>,
--feedback-incidents <em class="replaceable"><code>n</code></em>,
--feedback-authentication-results <em class="replaceable"><code>"results"</code></em>,
--feedback-original-rcpt-to <em class="replaceable"><code>"<rcptto>"</code></em>,
--feedback-reported-domain <em class="replaceable"><code>example.com</code></em></span></dt><dd><p>
Optional parameters to include in the feedback report generated by
<span class="quote">“<span class="quote">feedback</span>”</span> and <span class="quote">“<span class="quote">replyfeedback</span>”</span>.
<span class="command"><strong>mailbot</strong></span> always adds
<span class="quote">“<span class="quote">Arrival-Date</span>”</span> with the current time, as well as
<span class="quote">“<span class="quote">Version</span>”</span> and <span class="quote">“<span class="quote">User-Agent</span>”</span>.
</p><p>
<span class="quote">“<span class="quote">--feedback-authentication-results</span>”</span>,
<span class="quote">“<span class="quote">--feedback-original-rcpt-to</span>”</span> and
<span class="quote">“<span class="quote">--feedback-reported-domain</span>”</span> may be specified more
than once.
</p><p>
Where appropriate, UTF-8 encoding should be used for non-ASCII
characters.
</p></dd><dt><span class="term">-l <em class="replaceable"><code>maildir</code></em></span></dt><dd><p>
Specifies the maildir for the <span class="quote">“<span class="quote">-T replydraft</span>”</span>
option. See <span class="quote">“<span class="quote">Autoreplies
from a maildir folder</span>”</span>, below.
</p></dd></dl></div><div class="refsect2"><a id="mailbot_autoreplies_from_a_maildir_folder" shape="rect"> </a><h3>Autoreplies from a maildir folder</h3><p>In <code class="filename">.mailfilter:</code></p><div class="blockquote"><blockquote class="blockquote"><div class="informalexample"><pre class="programlisting" xml:space="preserve">
cc "| mailbot -T replydraft -l './Maildir/.Vacation' \
-d autoresponsedb \
-A 'From: info@domain.com' /usr/bin/sendmail -f ''"
to "./Maildir"</pre></div></blockquote></div><p>
The <code class="option">-T replydraft</code> reply format takes the content of
the autoresponse from the most recent message in a maildir.
The <code class="option">-l</code> option specifies the maildir. The above
example takes the message from <code class="literal">$HOME/Maildir/.Drafts</code>
which should be a maildir (with the usual <code class="filename">cur</code>,
<code class="filename">new</code>, and <code class="filename">tmp</code> subdirectories).
It would typically get created by Courier-IMAP as a folder named
<span class="quote">“<span class="quote">Vacation</span>”</span>.
</p><p>
This makes it possible to install autoreplies via an IMAP client by
creating a folder named <span class="quote">“<span class="quote">Vacation</span>”</span>, and copying a message
into it. The contents of the message become the autoresponse.
</p><p>
If the named maildir does not exist, or is empty,
<span class="command"><strong>mailbot</strong></span> does nothing. If the named maildir has
more than one message, the most recent message gets used.
</p><p>
The above example uses additional <span class="command"><strong>mailbot</strong></span> options
to suppress duplicate autoresponses, and to set the <span class="quote">“<span class="quote">From:</span>”</span>
header on the autoresponse.
</p></div></div><div class="refsect1"><a id="mailbot_see_also" shape="rect"> </a><h2>SEE ALSO</h2><p>
<a class="ulink" href="maildrop.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">maildrop</span>(1)</span></a>,
<a class="ulink" href="reformail.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">reformail</span>(1)</span></a>,
<a class="ulink" href="reformime.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">reformime</span>(1)</span></a>.
</p></div></div></body></html>
|