# mailbot

## Name

mailbot -- A MIME-aware autoresponder utility

## Synopsis

mailbot [options] {`program`} [arg...]

In `.mailfilter:`

    if (/^Subject: *info/)
    {
         cc "| mailbot -t /usr/share/autoresponse/info -d autoresponsedb \
                -A 'From: info@domain.com' /usr/bin/sendmail -f ''"
    }

## DESCRIPTION

mailbot reads an E-mail message on standard input, creates an E-mail message responding to the original message's sender, then runs program, that's specified as an argument to mailbot after all of mailbot options. program is expected to read the autoresponse 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 if's MIME content type is (delivery status notifications use the `multipart/report` MIME content type). The `-M` option formats the the autoresponse itself as a MIME delivery status notification.

## OPTIONS

-t `filename`

  Read text autoresponse from `filename`, which should contain a plaintext 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 MIME autoresponse, like the `-t` option. except that `filename` contains MIME headers, followed by a blank line, then the corresponding MIME content. The contents of `filename` are inserted in the autoresponse without further processing.

-M `address`

  Format the autoresponse as a delivery status notification (RFC 1894). `address` is an RFC 2822 E-mail address that generates the DSN. Note that the `-A` option should be used in ddition to `-M` in order to set the `From:` header on the autoresponse.

-r `addrlist`

  `addrlist` is a comma separated list of RFC 2822 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 been configured with GDBM/DB extensions.

-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`.

-A "`header: value`"

  Add an arbitrary header to the autoresponse. Multiple `-A` options are allowed.

## SEE ALSO

maildrop(1), reformail(1), reformime(1).