{
    "mode": "man",
    "parameter": "mailbot",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/mailbot/1/json",
    "generated": "2026-06-16T10:47:30Z",
    "synopsis": "mailbot [options] {program} [arg...]\nIn .mailfilter:\nif (/^Subject: *info/)\n{\ncc \"| mailbot -t /usr/share/autoresponse/info -d autoresponsedb \\\n-A 'From: info@domain.com' /usr/bin/sendmail -f ''\"\n}",
    "sections": {
        "NAME": {
            "content": "mailbot - A MIME-aware autoresponder utility\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mailbot [options] {program} [arg...]\n\nIn .mailfilter:\n\nif (/^Subject: *info/)\n{\ncc \"| mailbot -t /usr/share/autoresponse/info -d autoresponsedb \\\n-A 'From: info@domain.com' /usr/bin/sendmail -f ''\"\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "mailbot reads an E-mail message on standard input and creates an E-mail message replying to\nthe original message's sender. A program is specified as an argument to mailbot after all of\nmailbot options.  program is expected to read the created autoreply on its standard input,\nand mail it. If program is not specified, mailbot runs 'sendmail -f \"\"'.\n\nmailbot has several options for suppressing duplicate autoresponse messages. If mailbot\nchooses not to send an autoresponse, it quietly terminates without running program. The\nautoresponse is optionally formatted as a MIME delivery status notification.\n\nThe text of the autoresponse is specified by the -t or the -m argument. Either one is\nrequired. Everything else is optional. The only exception is the -T replydraft option, which\nrequires the -l option instead of either -t or -m. The default behavior is to send an\nautoresponse unless the original message has the \"Precedence: junk\" or the \"Precedence: bulk\"\nheader, or the \"Precedence: list\" header, or the \"List-ID:\" header, or if its MIME content\ntype is \"multipart/report\" (this is the MIME content type for delivery status notifications).\nThe -M option formats the the autoresponse itself as a MIME delivery status notification.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-A \"header: value\"\nAdd a header to the autoresponse. Multiple -A options are allowed. In most situations,\nthe -A option must be used to set the “From:” header in the autogenerated response.\n",
            "subsections": [
                {
                    "name": "-f_address_",
                    "content": "Address the autoresponse to address, which must be an RFC 2822[1] address. By default\nmailbot takes the autoresponse address from the From: (or the Reply-To:) header in the\noriginal message.  -f, if present, overrides and explicitly sets the autoresponse\naddress. \"address\" must immediately follow the -f option without an intervening space\n(it's a single command line argument). An -f option without an address takes the address\nfrom the SENDER environment variable.\n\n-t filename\nRead text autoresponse from filename, which must contain a plain text message in\n“flowed-text” format. In a “flowed-text”-formatted message, each line that ends with a\nspace character indicates that the line logically flows into the next line. This allows\nthe message to be reformatted for any shown display width.\n\nNote\nMessages in languages (see the -c option) which use spaces as word delimiters must\nhave two spaces at the end of a flowed line. The last space on a flowed line is\nlogically removed, and the first space separates the last word on the previous line\nfrom the first word on the next line. Otherwise, the two words will not have a\nlogical space between them if they get repositioned as part of adjusting the\nmessage's width for display.\n\nMessages in ideographic languages that do not use spaces as word delimiters need only\none space trailing a flowed line.\n\nNote\nThe trailing whitespace has no visual impact when shown by software that does not\nimplemented flowed text format, and always displays messages using their original\nwidth.\n\n-c charset\nSet the autoresponse's MIME character set to charset. Run mailbot without any arguments\nto see the default character set.\n\n-m filename\nRead a MIME autoresponse from filename. This is similar to the -t option, except that\nfilename contains MIME headers, followed by a blank line, and the corresponding MIME\ncontent. The contents of filename are inserted in the autoresponse without further\nprocessing.\n\nThe specified file must contain the “Content-Type” header specifying the “text/plain”\nMIME type, with the “format=flowed”, “delsp=yes”, and the “charset” attributes, which\noverride the -c parameter. If the specified file has a “Content-Transfer-Encoding” header\nit must be either “7bit” or “8bit”, it may not be “quoted-printable”.  mailbot always\ndrops any existing “Content-Transfer-Encoding” header and always adds the\n“Content-Transfer-Encoding: 8bit” header, even with the -m, since the salutation inserted\ninto the message includes the sender's name, which may contain 8-bit characters. Example:\n\nContent-Type: text/plain; format=flowed; delsp=yes; charset=\"iso-8859-1\"\n\nMary had a little lamb,\nIts fleece was white as snow.\nAnd everywhere Mary went,\nThe lamb was sure to go.\n\nNote\nWhen the -m option is specified mailbot ignores the locale's character set and\nformats the autoreply according to the character set read from the “Content-Type”\nheader.\n\n-M address\nFormat the autoresponse as a delivery status notification (RFC 1894[2]).  address is an\nRFC 2822[1] E-mail address that generates the DSN. Note that the -A option should still\nbe used in addition to -M in order to set the From: header on the autoresponse.  -M sets\nthe DSN address only. The -M option automatically sets -T replydsn\n\n-R type\nSpecify the feedback report type, with type set to abuse, fraud, other, or virus. Must be\nused together with “-T feedback” or “-T replyfeedback”.\n\n-T format\nSet the reply format.  format must be one of the following values:\n\n•   “reply” - the default reply format.\n\n•   “replyall” - like “reply”, except also puts the recipients in the original message's\n“To:” and “Cc:” headers into the “Cc:” header of the generated reply.\n\n•   “replydsn” - like “reply”, except the message is formatted as a delivery status\nnotification.\n\n•   “replydraft” - like “reply”, with the text of the autoresponse coming from a maildir\nspecified by the -l option. See “Autoreplies from a maildir folder”, below.\n\n•   “forward” - attach the original message as forwarded text.\n\n•   “forwardatt” - attach the original message as a forwarded message attachment.\n\n•   “feedback” - generate an Email Feedback Report message (see RFC 5965[3]). The “-R”\noption is required when this is specified.\n\n•   “replyfeedback” - like “feedback”, but also adds a “To:” header, addressed to the\noriginal message's sender.\n"
                },
                {
                    "name": "-N",
                    "content": "Do not quote the contents of the original message in the message created by “reply”,\n“replyall”, “replydsn”, “feedback”, and “replyfeedback” options.\n\nNote\nThe original message gets quoted, in the absence of this option, only if the original\nmessage was formatted as plain text.  mailbot is unable to quote an original message\nwhich was formatted as HTML, or any other non-plaintext format.\n\nNote\nFor “replydsn”, “feedback”, and “replyfeedback” options, the convention is to attach\nthe original message, or only its headers, separately; so this option should always\nbe specified for these three reply formats.\n",
                    "flag": "-N"
                },
                {
                    "name": "-a",
                    "content": "Attach the entire message, for “replydsn”, “feedback”, and “replyfeedback”, instead of\nonly its headers.\n",
                    "flag": "-a"
                },
                {
                    "name": "-e",
                    "content": "Generate a reply (“reply”-formats) to the address listed in any “Errors-To” or\n“Return-Path” header, if present, instead of the “From” header.\n\n-S “salutation”\nUse the given salutation in the “reply”. The default value is “%F writes:”. The following\nsubstitutions are recognized in the salutation string:\n\n•   %% - an explicit % character.\n\n•   %n - a newline character.\n\n•   %C - the “X-Newsgroup:” header from the original message.\n\n•   %N - the “Newsgroups:” header from the original message.\n\n•   %i - the “Message-ID:” header from the original message.\n\n•   %f - the original message's sender's address.\n\n•   %F - the original message's sender's name.\n\n•   %S - the “Subject:” header from the original message\n\n•   %d - the original message's date, in the local timezone.\n\n•   %{...}d - use strftime() to format the original message's date. A plain %d is\nequivalent to %{%a, %d %b %Y %H:%M:%S %z}d.\n\nAll other characters in the salutation string are left as is.\n\n-F “marker”\nWhen generating a forward, use the marker to separate the forwarded message from the\nautoreply text, instead of the default “--- Forwarded message ---”\n\n-r addrlist\naddrlist is a comma-separated list of RFC 2822[1] E-mail addresses.  mailbot sends an\nautoresponse only if the original message has at least one of the specified addresses in\nany To: or Cc: header.\n\n-d filename\nCreate a small database, filename, that keeps track of senders' E-mail addresses, and\nprevent duplicate autoresponses going to the same address (suppress autoresponses going\nback to the same senders, for subsequent received messages). The -d option is only\navailable if maildrop has GDBM/DB extensions enabled.\n\n-D x\nDo not send duplicate autoresponses (see the -d option) for at least x days (default: 1\nday). The -d option creates a database of E-mail addresses and the times an autoresponse\nwas last mailed to them. Another autoresponse to the same address will not be mailed\nuntil at least the amount of time specified by the -D option has elapsed.\n\n-s \"subject\"\nSet the Subject: header on the autoresponse to subject.\n",
                    "flag": "-e"
                },
                {
                    "name": "-n",
                    "content": "Show the resulting message, do not send it. Used for debugging purposes.\n\n--feedback-original-envelope-id \"<envelopeid>\", --feedback-original-mail-from \"<mailfrom>\",\n--feedback-reporting-mta \"dns; hostname\", --feedback-source-ip aaa.bbb.ccc.ddd,\n--feedback-incidents n, --feedback-authentication-results \"results\",\n--feedback-original-rcpt-to \"<rcptto>\", --feedback-reported-domain example.com\nOptional parameters to include in the feedback report generated by “feedback” and\n“replyfeedback”.  mailbot always adds “Arrival-Date” with the current time, as well as\n“Version” and “User-Agent”.\n\n“--feedback-authentication-results”, “--feedback-original-rcpt-to” and\n“--feedback-reported-domain” may be specified more than once.\n\n-l maildir\nSpecifies the maildir for the “-T replydraft” option. See “Autoreplies from a maildir\nfolder”, below.\n",
                    "flag": "-n"
                },
                {
                    "name": "Autoreplies from a maildir folder",
                    "content": "In .mailfilter:\n\ncc \"| mailbot -T replydraft -l './Maildir/.Vacation' \\\n-d autoresponsedb \\\n-A 'From: info@domain.com' /usr/bin/sendmail -f ''\"\nto \"./Maildir\"\n\nThe -T replydraft reply format takes the content of the autoresponse from the most recent\nmessage in a maildir. The -l option specifies the maildir. The above example takes the\nmessage from $HOME/Maildir/.Drafts which should be a maildir (with the usual cur, new, and\ntmp subdirectories). It would typically get created by Courier-IMAP as a folder named\n“Vacation”.\n\nThis makes it possible to install autoreplies via an IMAP client by creating a folder named\n“Vacation”, and copying a message into it. The contents of the message become the\nautoresponse.\n\nIf the named maildir does not exist, or is empty, mailbot does nothing. If the named maildir\nhas more than one message, the most recent message gets used.\n\nThe above example uses additional mailbot options to suppress duplicate autoresponses, and to\nset the “From:” header on the autoresponse.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "maildrop(1)[4], reformail(1)[5], reformime(1)[6].\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "",
            "subsections": [
                {
                    "name": "Sam Varshavchik",
                    "content": "Author\n"
                }
            ]
        },
        "NOTES": {
            "content": "1. RFC 2822\nhttp://tools.ietf.org/html/rfc2822\n\n2. RFC 1894\nhttp://tools.ietf.org/html/rfc1894\n\n3. RFC 5965\nhttp://tools.ietf.org/html/rfc5965\n\n4. maildrop(1)\nhttp://www.courier-mta.org/maildrop/maildrop.html\n\n5. reformail(1)\nhttp://www.courier-mta.org/maildrop/reformail.html\n\n6. reformime(1)\nhttp://www.courier-mta.org/maildrop/reformime.html\n\n\n\nCourier Mail Server                          06/20/2015                                   MAILBOT(1)",
            "subsections": []
        }
    },
    "summary": "mailbot - A MIME-aware autoresponder utility",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Address the autoresponse to address, which must be an RFC 2822[1] 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 must contain a plain text message in “flowed-text” format. In a “flowed-text”-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. Note Messages in languages (see the -c option) which use spaces as word delimiters must have two 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. Messages in ideographic languages that do not use spaces as word delimiters need only one space trailing a flowed line. Note 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. -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, with the “format=flowed”, “delsp=yes”, and the “charset” attributes, which override 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. Example: 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. Note When the -m option is specified mailbot ignores the locale's character set and formats the autoreply according to the character set read from the “Content-Type” header. -M address Format the autoresponse as a delivery status notification (RFC 1894[2]). address is an RFC 2822[1] 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 -R type Specify the feedback report type, with type set to abuse, fraud, other, or virus. Must be used together with “-T feedback” or “-T replyfeedback”. -T format Set the reply format. format must be one of the following values: • “reply” - the default reply format. • “replyall” - like “reply”, except also puts the recipients in the original message's “To:” and “Cc:” headers into the “Cc:” header of the generated reply. • “replydsn” - like “reply”, except the message is formatted as a delivery status notification. • “replydraft” - like “reply”, with the text of the autoresponse coming from a maildir specified by the -l option. See “Autoreplies from a maildir folder”, below. • “forward” - attach the original message as forwarded text. • “forwardatt” - attach the original message as a forwarded message attachment. • “feedback” - generate an Email Feedback Report message (see RFC 5965[3]). The “-R” option is required when this is specified. • “replyfeedback” - like “feedback”, but also adds a “To:” header, addressed to the original message's sender."
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": "Do not quote the contents of the original message in the message created by “reply”, “replyall”, “replydsn”, “feedback”, and “replyfeedback” options. 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. Note For “replydsn”, “feedback”, and “replyfeedback” 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."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "Attach the entire message, for “replydsn”, “feedback”, and “replyfeedback”, instead of only its headers."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "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: • %% - an explicit % character. • %n - a newline character. • %C - the “X-Newsgroup:” header from the original message. • %N - the “Newsgroups:” header from the original message. • %i - the “Message-ID:” header from the original message. • %f - the original message's sender's address. • %F - the original message's sender's name. • %S - the “Subject:” header from the original message • %d - the original message's date, in the local timezone. • %{...}d - use strftime() to format the original message's date. A plain %d is equivalent to %{%a, %d %b %Y %H:%M:%S %z}d. 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 RFC 2822[1] 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 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 -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."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "Show the resulting message, do not send it. Used for debugging purposes. --feedback-original-envelope-id \"<envelopeid>\", --feedback-original-mail-from \"<mailfrom>\", --feedback-reporting-mta \"dns; hostname\", --feedback-source-ip aaa.bbb.ccc.ddd, --feedback-incidents n, --feedback-authentication-results \"results\", --feedback-original-rcpt-to \"<rcptto>\", --feedback-reported-domain example.com Optional parameters to include in the feedback report generated by “feedback” and “replyfeedback”. mailbot always adds “Arrival-Date” with the current time, as well as “Version” and “User-Agent”. “--feedback-authentication-results”, “--feedback-original-rcpt-to” and “--feedback-reported-domain” may be specified more than once. -l maildir Specifies the maildir for the “-T replydraft” option. See “Autoreplies from a maildir folder”, below."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "maildrop",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/maildrop/1/json"
        },
        {
            "name": "reformail",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/reformail/1/json"
        },
        {
            "name": "reformime",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/reformime/1/json"
        }
    ]
}