1MAILBOT(1)                  Double Precision, Inc.                  MAILBOT(1)
2
3
4

NAME

6       mailbot - A MIME-aware autoresponder utility
7

SYNOPSIS

9       mailbot [options] {program} [arg...]
10
11       In .mailfilter:
12
13       if (/^Subject: *info/)
14       {
15            cc "| mailbot -t /usr/share/autoresponse/info -d autoresponsedb \
16                   -A 'From: info@domain.com' /usr/bin/sendmail -f ''"
17       }
18

DESCRIPTION

20       mailbot reads an E-mail message on standard input and creates an E-mail
21       message replying to the original message's sender. A program is
22       specified as an argument to mailbot after all of mailbot options.
23       program is expected to read the created autoreply on its standard
24       input, and mail it. If program is not specified, mailbot runs 'sendmail
25       -f ""'.
26
27       mailbot has several options for suppressing duplicate autoresponse
28       messages. If mailbot chooses not to send an autoresponse, it quietly
29       terminates without running program. The autoresponse is optionally
30       formatted as a MIME delivery status notification.
31
32       The text of the autoresponse is specified by the -t or the -m argument.
33       Either one is required. Everything else is optional. The only exception
34       is the -T replydraft option, which requires the -l option instead of
35       either -t or -m. The default behavior is to send an autoresponse unless
36       the original message has the "Precedence: junk" or the "Precedence:
37       bulk" header, or the "Precedence: list" header, or the "List-ID:"
38       header, or if its MIME content type is "multipart/report" (this is the
39       MIME content type for delivery status notifications). The -M option
40       formats the the autoresponse itself as a MIME delivery status
41       notification.
42

OPTIONS

44       -A "header: value"
45           Add a header to the autoresponse. Multiple -A options are allowed.
46           In most situations, the -A option must be used to set the “From:”
47           header in the autogenerated response.
48
49       -faddress
50           Address the autoresponse to address, which must be an RFC 2822[1]
51           address. By default mailbot takes the autoresponse address from the
52           From: (or the Reply-To:) header in the original message.  -f, if
53           present, overrides and explicitly sets the autoresponse address.
54           "address" must immediately follow the -f option without an
55           intervening space (it's a single command line argument). An -f
56           option without an address takes the address from the SENDER
57           environment variable.
58
59       -t filename
60           Read text autoresponse from filename, which must contain a plain
61           text message in “flowed-text” format. In a “flowed-text”-formatted
62           message, each line that ends with a space character indicates that
63           the line logically flows into the next line. This allows the
64           message to be reformatted for any shown display width.
65
66               Note
67               Messages in languages (see the -c option) which use spaces as
68               word delimiters must have two spaces at the end of a flowed
69               line. The last space on a flowed line is logically removed, and
70               the first space separates the last word on the previous line
71               from the first word on the next line. Otherwise, the two words
72               will not have a logical space between them if they get
73               repositioned as part of adjusting the message's width for
74               display.
75
76               Messages in ideographic languages that do not use spaces as
77               word delimiters need only one space trailing a flowed line.
78
79               Note
80               The trailing whitespace has no visual impact when shown by
81               software that does not implemented flowed text format, and
82               always displays messages using their original width.
83
84       -c charset
85           Set the autoresponse's MIME character set to charset. Run mailbot
86           without any arguments to see the default character set.
87
88       -m filename
89           Read a MIME autoresponse from filename. This is similar to the -t
90           option, except that filename contains MIME headers, followed by a
91           blank line, and the corresponding MIME content. The contents of
92           filename are inserted in the autoresponse without further
93           processing.
94
95           The specified file must contain the “Content-Type” header
96           specifying the “text/plain” MIME type, with the “format=flowed”,
97           “delsp=yes”, and the “charset” attributes, which override the -c
98           parameter. If the specified file has a “Content-Transfer-Encoding”
99           header it must be either “7bit” or “8bit”, it may not be
100           “quoted-printable”.  mailbot always drops any existing
101           “Content-Transfer-Encoding” header and always adds the
102           “Content-Transfer-Encoding: 8bit” header, even with the -m, since
103           the salutation inserted into the message includes the sender's
104           name, which may contain 8-bit characters. Example:
105
106               Content-Type: text/plain; format=flowed; delsp=yes;
107                             charset="iso-8859-1"
108
109               Mary had a little lamb,
110               Its fleece was white as snow.
111               And everywhere Mary went,
112               The lamb was sure to go.
113
114               Note
115               When the -m option is specified mailbot ignores the locale's
116               character set and formats the autoreply according to the
117               character set read from the “Content-Type” header.
118
119       -M address
120           Format the autoresponse as a delivery status notification (RFC
121           1894[2]).  address is an RFC 2822[1] E-mail address that generates
122           the DSN. Note that the -A option should still be used in addition
123           to -M in order to set the From: header on the autoresponse.  -M
124           sets the DSN address only. The -M option automatically sets -T
125           replydsn
126
127       -R type
128           Specify the feedback report type, with type set to abuse, fraud,
129           other, or virus. Must be used together with “-T feedback” or “-T
130           replyfeedback”.
131
132       -T format
133           Set the reply format.  format must be one of the following values:
134
135           ·   “reply” - the default reply format.
136
137           ·   “replyall” - like “reply”, except also puts the recipients in
138               the original message's “To:” and “Cc:” headers into the “Cc:”
139               header of the generated reply.
140
141           ·   “replydsn” - like “reply”, except the message is formatted as a
142               delivery status notification.
143
144           ·   “replydraft” - like “reply”, with the text of the autoresponse
145               coming from a maildir specified by the -l option. See
146               “Autoreplies from a maildir folder”, below.
147
148           ·   “forward” - attach the original message as forwarded text.
149
150           ·   “forwardatt” - attach the original message as a forwarded
151               message attachment.
152
153           ·   “feedback” - generate an Email Feedback Report message (see RFC
154               5965[3]). The “-R” option is required when this is specified.
155
156           ·   “replyfeedback” - like “feedback”, but also adds a “To:”
157               header, addressed to the original message's sender.
158
159       -N
160           Do not quote the contents of the original message in the message
161           created by “reply”, “replyall”, “replydsn”, “feedback”, and
162           “replyfeedback” options.
163
164               Note
165               The original message gets quoted, in the absence of this
166               option, only if the original message was formatted as plain
167               text.  mailbot is unable to quote an original message which was
168               formatted as HTML, or any other non-plaintext format.
169
170               Note
171               For “replydsn”, “feedback”, and “replyfeedback” options, the
172               convention is to attach the original message, or only its
173               headers, separately; so this option should always be specified
174               for these three reply formats.
175
176       -a
177           Attach the entire message, for “replydsn”, “feedback”, and
178           “replyfeedback”, instead of only its headers.
179
180       -e
181           Generate a reply (“reply”-formats) to the address listed in any
182           “Errors-To” or “Return-Path” header, if present, instead of the
183           “From” header.
184
185       -S “salutation”
186           Use the given salutation in the “reply”. The default value is “%F
187           writes:”. The following substitutions are recognized in the
188           salutation string:
189
190           ·   %% - an explicit % character.
191
192           ·   %n - a newline character.
193
194           ·   %C - the “X-Newsgroup:” header from the original message.
195
196           ·   %N - the “Newsgroups:” header from the original message.
197
198           ·   %i - the “Message-ID:” header from the original message.
199
200           ·   %f - the original message's sender's address.
201
202           ·   %F - the original message's sender's name.
203
204           ·   %S - the “Subject:” header from the original message
205
206           ·   %d - the original message's date, in the local timezone.
207
208           ·   %{...}d - use strftime() to format the original message's date.
209               A plain %d is equivalent to %{%a, %d %b %Y %H:%M:%S %z}d.
210
211           All other characters in the salutation string are left as is.
212
213       -F “marker”
214           When generating a forward, use the marker to separate the forwarded
215           message from the autoreply text, instead of the default “---
216           Forwarded message ---”
217
218       -r addrlist
219           addrlist is a comma-separated list of RFC 2822[1] E-mail addresses.
220           mailbot sends an autoresponse only if the original message has at
221           least one of the specified addresses in any To: or Cc: header.
222
223       -d filename
224           Create a small database, filename, that keeps track of senders'
225           E-mail addresses, and prevent duplicate autoresponses going to the
226           same address (suppress autoresponses going back to the same
227           senders, for subsequent received messages). The -d option is only
228           available if maildrop has GDBM/DB extensions enabled.
229
230       -D x
231           Do not send duplicate autoresponses (see the -d option) for at
232           least x days (default: 1 day). The -d option creates a database of
233           E-mail addresses and the times an autoresponse was last mailed to
234           them. Another autoresponse to the same address will not be mailed
235           until at least the amount of time specified by the -D option has
236           elapsed.
237
238       -s "subject"
239           Set the Subject: header on the autoresponse to subject.
240
241       -n
242           Show the resulting message, do not send it. Used for debugging
243           purposes.
244
245       --feedback-original-envelope-id "<envelopeid>",
246       --feedback-original-mail-from "<mailfrom>",
247       --feedback-reporting-mta "dns; hostname",
248       --feedback-source-ip aaa.bbb.ccc.ddd, --feedback-incidents n,
249       --feedback-authentication-results "results",
250       --feedback-original-rcpt-to "<rcptto>",
251       --feedback-reported-domain example.com
252           Optional parameters to include in the feedback report generated by
253           “feedback” and “replyfeedback”.  mailbot always adds “Arrival-Date”
254           with the current time, as well as “Version” and “User-Agent”.
255
256           “--feedback-authentication-results”, “--feedback-original-rcpt-to”
257           and “--feedback-reported-domain” may be specified more than once.
258
259           Where appropriate, UTF-8 encoding should be used for non-ASCII
260           characters.
261
262       -l maildir
263           Specifies the maildir for the “-T replydraft” option. See
264           “Autoreplies from a maildir folder”, below.
265
266   Autoreplies from a maildir folder
267       In .mailfilter:
268
269           cc "| mailbot -T replydraft -l './Maildir/.Vacation' \
270                   -d autoresponsedb \
271                   -A 'From: info@domain.com' /usr/bin/sendmail -f ''"
272           to "./Maildir"
273
274       The -T replydraft reply format takes the content of the autoresponse
275       from the most recent message in a maildir. The -l option specifies the
276       maildir. The above example takes the message from $HOME/Maildir/.Drafts
277       which should be a maildir (with the usual cur, new, and tmp
278       subdirectories). It would typically get created by Courier-IMAP as a
279       folder named “Vacation”.
280
281       This makes it possible to install autoreplies via an IMAP client by
282       creating a folder named “Vacation”, and copying a message into it. The
283       contents of the message become the autoresponse.
284
285       If the named maildir does not exist, or is empty, mailbot does nothing.
286       If the named maildir has more than one message, the most recent message
287       gets used.
288
289       The above example uses additional mailbot options to suppress duplicate
290       autoresponses, and to set the “From:” header on the autoresponse.
291

SEE ALSO

293       maildrop(1)[4], reformail(1)[5], reformime(1)[6].
294

AUTHOR

296       Sam Varshavchik
297           Author
298

NOTES

300        1. RFC 2822
301           http://tools.ietf.org/html/rfc2822
302
303        2. RFC 1894
304           http://tools.ietf.org/html/rfc1894
305
306        3. RFC 5965
307           http://tools.ietf.org/html/rfc5965
308
309        4. maildrop(1)
310           http://www.courier-mta.org/maildrop/maildrop.html
311
312        5. reformail(1)
313           http://www.courier-mta.org/maildrop/reformail.html
314
315        6. reformime(1)
316           http://www.courier-mta.org/maildrop/reformime.html
317
318
319
320Courier Mail Server               07/29/2018                        MAILBOT(1)
Impressum