MAILBOT(1)

πŸ’Œ MAILBOT β€” the manual, but make it cute πŸ’Œ

ok so welcome to the mailbot(1) page bestie, this is section 1 of the manual and it's giving "S. Varshavchik" in the corner, iconic, we love a credited author 🫢


✨ NAME ✨

mailbot β€” a MIME-aware autoresponder utility πŸ’…

🌸 SYNOPSIS 🌸

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

and in your .mailfilter, it looks like this:

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

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so here's the vibe: mailbot reads an E-mail message on standard input, and then it creates an E-mail message replying to the original message's sender. like, it's an autoresponder bestie, that's the whole thing πŸ’–

you give it a program as an argument to mailbot after all the mailbot options. that program is expected to read the created autoreply on its standard input, and mail it. if program is not specified, mailbot runs 'sendmail -f ""'. periodt.

mailbot has several options for suppressing duplicate autoresponse messages. and if mailbot chooses not to send an autoresponse, it quietly terminates without running program. no drama, no message, it just ghosts ✨

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 only exception is the -T replydraft option, which requires the -l option instead of either -t or -m. iykyk πŸ‘‘

and now the default behaviour, listen up: by default mailbot sends an autoresponse unless the original message has the "Precedence: junk" header, or the "Precedence: bulk" header, or the "Precedence: list" header, or the "List-ID:" header, or if its MIME content type is "multipart/report" β€” that's the MIME content type for delivery status notifications, for the record. 😌

and the -M option formats the the autoresponse itself as a MIME delivery status notification. slay πŸŽ€


more parts coming bestie, don't go anywhere πŸ’œ

✨ OPTIONS ✨

Bestie, this is the whole toolkit. Every flag, every vibe, all of it πŸ’…

  • -A "header: value" β€” drops a header into the autoresponse. You can stack -A as many times as you want. And lowkey? In most situations you have to use -A to set the From: header on your autogenerated response. Like, it's not optional-optional. Set it. 🫢
  • -faddress β€” addresses the autoresponse to address, which has to be an RFC 2822[1] address. Normally mailbot just steals the autoresponse address from the From: header (or the Reply-To: header) of the original message. But -f, when it shows up, overrides all that and explicitly sets the autoresponse address. Heads up tho: address has to come immediately after -f with no space in between β€” it's one single command line argument, no cap. And if you write -f with no address at all? Then it pulls the address from the SENDER environment variable. ✨
  • -t filename β€” reads the text autoresponse out of filename, which must contain a plain text message in "flowed-text" format. And bestie, "flowed-text" means: every line that ends with a space character is saying "hey, I logically flow into the next line." That's the whole trick β€” it lets the message get reformatted for literally any display width. 🌊
Note β€” If your message is in a language (peep the -c option) that uses spaces as word delimiters, you need two spaces at the end of a flowed line. Why? Because the last space on a flowed line gets logically removed, and the first space is what separates the last word on the previous line from the first word on the next line. Skip that and your two words end up with no logical space between them if they get repositioned while adjusting the message width for display. 😭 But messages in ideographic languages that don't use spaces as word delimiters? They only need one space trailing a flowed line. Different rules, different slay. πŸŽ€
Note β€” The trailing whitespace has zero visual impact when it's shown by software that doesn't implement flowed text format, and that kind of software always displays messages using their original width. So it's giving invisible, not giving messy. πŸ’…
  • -c charset β€” sets the autoresponse's MIME character set to charset. Wanna know the default character set? Run mailbot with no arguments and it'll tell you. πŸ‘‘
  • -m filename β€” reads a MIME autoresponse from filename. It's basically the -t option's cousin, except filename holds MIME headers, then a blank line, then the matching MIME content. The contents of filename get inserted into the autoresponse with no further processing. Periodt.

Okay so the rules on that file, listen up:

  • It must contain the Content-Type header specifying the text/plain MIME type, with the format=flowed, delsp=yes, and the charset attributes β€” and those override the -c parameter.
  • If the 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 Content-Transfer-Encoding: 8bit, even with -m β€” because the salutation inserted into the message includes the sender's name, which may contain 8-bit characters. Not negotiable, sorry bestie. πŸ’€

Example, so you can see the shape of it:

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 -m is specified, mailbot ignores the locale's character set and formats the autoreply according to the character set it read from the Content-Type header. It's that header's world and we're just living in it. πŸ¦‹
  • -M address β€” formats the autoresponse as a delivery status notification (RFC 1894[2]). address is an RFC 2822[1] E-mail address that generates the DSN. Quick note: you should still use -A in addition to -M so the From: header gets set on the autoresponse β€” -M only sets the DSN address. Also, -M automatically sets -T replydsn for you. ✨
  • -R type β€” specifies the feedback report type, where type is abuse, fraud, other, or virus. This one must be used together with -T feedback or -T replyfeedback. No solo runs. 🚫
  • -T format β€” sets the reply format. format has to be one of these values:
    • "reply" β€” the default reply format. πŸ’–
    • "replyall" β€” like "reply", except it also scoops up the recipients in the original message's To: and Cc: headers and puts them into the Cc: header of the generated reply. Everyone's invited fr fr.
    • "replydsn" β€” like "reply", except the message gets formatted as a delivery status notification.
    • "replydraft" β€” like "reply", but the text of the autoresponse comes from a maildir specified by the -l option. Peep "Autoreplies from a maildir folder" below. πŸŽ€
    • "forward" β€” attaches the original message as forwarded text.
    • "forwardatt" β€” attaches the original message as a forwarded message attachment.
    • "feedback" β€” generates an Email Feedback Report message (see RFC 5965[3]). When you specify this one, the -R option is required. πŸ”₯
    • "replyfeedback" β€” like "feedback", except it also adds a To: header addressed to the original message's sender.
  • -N β€” do not quote the contents of the original message in the message created by "reply", "replyall", "replydsn", "feedback", and "replyfeedback". Not me being picky about quoting πŸ™ˆ
Note β€” Without this option, the original message only gets quoted if the original message was formatted as plain text. mailbot literally cannot quote an original message formatted as HTML, or any other non-plaintext format. It's not being lazy, it's just not possible. 😭 Also, using the -m option to specify MIME contents other than plain text automatically implies -N. Sneaky, but correct. Note β€” For the "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 those three reply formats. Always always. πŸ’…
  • -a β€” attaches the entire message for "replydsn", "feedback", and "replyfeedback", instead of only its headers. Go big. πŸ‘‘
  • -e β€” generates a reply ("reply"-formats) to the address listed in any Errors-To or Return-Path header, if one's present, instead of the From header. Taking the scenic route home. 🌈
  • -S "salutation" β€” uses the given salutation in the "reply". The default value is %F writes:. Here's every substitution it recognizes, bestie, memorize the chart:
    • %% β€” 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.

And literally every other character in the salutation string just gets left as is. Simple as that. ✨

  • -F "marker" β€” when generating a forward, use the marker to separate the forwarded message from the autoreply text, instead of the default --- Forwarded message ---. Pick your own divider, main character energy. πŸ¦‹
  • -r addrlist β€” addrlist is a comma-separated list of RFC 2822[1] E-mail addresses. mailbot will send an autoresponse only if the original message has at least one of the specified addresses in any To: or Cc: header. Strict guest list. πŸŽ€
  • -d filename β€” creates a small database, filename, that keeps track of senders' E-mail addresses and prevents duplicate autoresponses going to the same address (so it suppresses autoresponses going back to the same senders, for subsequent received messages). Big note tho: the -d option is only available if maildrop has GDBM/DB extensions enabled. No extensions, no database, no dice. πŸ’€
  • -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. Patience is a vibe. ⏳
  • -s "subject" β€” sets the Subject: header on the autoresponse to subject. Cute, catchy, iconic. πŸ’–
  • -n β€” shows you the resulting message, does not send it. It's for debugging purposes. Look, don't touch. πŸ‘€
  • --feedback-original-envelope-id "<envelopeid>" β€” optional parameter you can include in the feedback report generated by "feedback" and "replyfeedback" (all the details are right below).
  • --feedback-original-mail-from "<mailfrom>" β€” same deal, optional, goes in the feedback report.
  • --feedback-reporting-mta "dns; hostname" β€” optional, feedback report. ✨
  • --feedback-source-ip aaa.bbb.ccc.ddd β€” optional, feedback report.
  • --feedback-incidents n β€” optional, feedback report.
  • --feedback-authentication-results "results" β€” optional, feedback report.
  • --feedback-original-rcpt-to "<rcptto>" β€” optional, feedback report.
  • --feedback-reported-domain example.com β€” optional, feedback report.

So these are the 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 β€” those come free, bestie. 🫢

--feedback-authentication-results, --feedback-original-rcpt-to and --feedback-reported-domain may be specified more than once. Stack away.

Where appropriate, UTF-8 encoding should be used for non-ASCII characters.

  • -l maildir β€” specifies the maildir for the -T replydraft option. Peep "Autoreplies from a maildir folder" below for the full tutorial. πŸŽ€

πŸŽ€ Autoreplies from a maildir folder πŸŽ€

In .mailfilter:

cc "| mailbot -T replydraft -l './Maildir/.Vacation' \
        -d autoresponsedb \
        -A 'From: info@domain.com' /usr/bin/sendmail -f ''"
to "./Maildir"

The -T replydraft reply format takes the content of the autoresponse from the most recent message in a maildir. The -l option specifies the maildir. The example above takes the message from $HOME/Maildir/.Drafts, which should be a maildir (with the usual cur, new, and tmp subdirectories). It would typically get created by Courier-IMAP as a folder named "Vacation". Yes, it's lowkey a genius hack and yes it ate. πŸ’…

This makes it possible to install autoreplies via an IMAP client by creating a folder named "Vacation", and copying a message into it. The contents of that message become the autoresponse. That's it, that's the whole magic trick ✨

If the named maildir does not exist, or is empty, mailbot does nothing. Silent. Unbothered.

If the named maildir has more than one message, the most recent message gets used. Recency wins, as always. πŸ‘‘

The example above uses additional mailbot options to suppress duplicate autoresponses, and to set the From: header on the autoresponse. Teamwork fr fr. 🫢

🌈 SEE ALSO 🌈

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

✨ AUTHOR ✨

  • Sam Varshavchik β€” Author πŸ‘‘

No cap, that's the whole section. One (1) icon, one (1) job, and he did it. Respect the author bestie πŸ’–


🌸 NOTES 🌸

Okay so these are the footnote receipts β€” all the RFCs and sibling man pages that got referenced up in the SEE ALSO zone. NOT me forgetting them, we're listing them fr fr 🫢

  1. RFC 2822 β€” https://datatracker.ietf.org/doc/html/rfc2822
  2. RFC 1894 β€” https://datatracker.ietf.org/doc/html/rfc1894
  3. RFC 5965 β€” https://datatracker.ietf.org/doc/html/rfc5965
  4. maildrop(1) β€” http://www.courier-mta.org/maildrop/maildrop.html
  5. reformail(1) β€” http://www.courier-mta.org/maildrop/reformail.html
  6. reformime(1) β€” http://www.courier-mta.org/maildrop/reformime.html
Tap any of those links if you wanna go full lore-mode on the specs, bestie πŸ¦‹ iykyk

And that's a wrap on MAILBOT(1) πŸ’… this one's from the Courier Mail Server, dated 01/30/2026 β€” go forth and let your autoreplies be iconic, main character energy only, periodt βœ¨πŸ‘‘πŸŽ€

πŸ“¦ where this page comes from
  • ubuntu stonking: maildrop 4.0.4-1 Β· GPL-3~with-OpenSSL-exception
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms