Edit file File name : mailbot.html Content :<?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 V1.78.1"/><link rel="home" href="#idm255216686912" 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="idm255216686912" 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="idm255218054800" 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="idm255212760032" 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></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="idm255212630800" 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="idm255212619520" 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> Save