KLYRN
Blog

Email autoresponders done right: one reply a day, never to lists or spam

An out-of-office reply that answers everything gets a mail server blocklisted. The five rules a good autoresponder follows, and how to set one.

· 3 min read · KLYRN

How an out-of-office reply goes wrong

The naive autoresponder is a rule that says: for every message that arrives, send this text back. It works on the first day and causes trouble for the rest of the holiday.

  • A colleague who sends twelve messages gets twelve identical replies.
  • A mailing list gets a reply to every post, and every subscriber reads about your holiday.
  • Another autoresponder answers yours, yours answers back, and two mailboxes fill up overnight.
  • A spammer gets a reply, which confirms the address is real and read. Replies to forged senders land on strangers, and that is how a mail server ends up on a blocklist.

None of this is exotic. It is what happens when the reply rule knows nothing about mail.

The five rules

  1. One reply per sender per period. A day is a sensible period. The second message from the same person gets no second reply.
  2. Never to mailing lists, bounces or automatic mail. Messages that say they were sent by a machine are not waiting for an answer.
  3. Only when the message names you. Reply when your address is in To or Cc. A reply to a blind copy tells the sender you were copied in secret.
  4. Never to spam. Spam filtering has to run first and stop there. A message filed into Junk gets no reply.
  5. Dates that end on their own. A first day and a last day, checked when mail is delivered, so nobody has to remember to switch it off.

The good news is that this has been solved for years. The Sieve mail filtering language has a vacation action that does the first three without being asked. The mistake is to build a reply rule by hand instead of using it.

What that looks like in Sieve

On a server where Dovecot delivers mail and Sieve is switched on, this script in the mailbox is a complete autoresponder for the holidays:

require ["vacation", "date", "relational"];
if allof (currentdate :value "ge" "date" "2026-12-24",
          currentdate :value "le" "date" "2027-01-02") {
  vacation :days 1 :subject "Automatic reply"
           :addresses ["anna@example.com"]
           "Back on Monday 4 January. For anything urgent, call the office.";
}

:days 1 is the one reply a day. :addresses is the address that must be named in the message. The two currentdate tests are the first and last day.

Rule four is about order, not about this script. The server's spam rule has to run before the mailbox's own script and stop, so a message that went to Junk never reaches the vacation line.

Setting one in KLYRN

Autoresponders shipped in KLYRN 1.0.3, and they are that Sieve script, written for you. Set one on the mailbox in the panel, or from the command line:

klyrn mail autoreply anna@example.com --message "Back on Monday 4 January." --from 2026-12-24 --until 2027-01-02
klyrn mail autoreply anna@example.com off

--from and --until are optional, and so is --subject. Without a subject the reply is titled "Automatic reply".

Each sender gets one reply a day. Mailing lists, automatic mail and anything filed as spam get none. The dates are checked on delivery, in the server's own time, so an autoresponder set for next week starts next week, and one whose last day has passed goes quiet on its own.

The mailbox list shows which mailboxes have an autoresponder and for which days. That matters more than it sounds: a reply left on by accident is otherwise invisible to everyone except the people receiving it.

After a migration, set them again

Autoresponders are not copied when mailboxes are migrated from cPanel or DirectAdmin. KLYRN names them in the migration's job log instead, so you know which mailboxes had one. Set them again on the new server before you move the MX record, or the first person on holiday after the move will simply go silent.

What to write in it

Keep it to what the sender needs: when you are back, and who to contact if it cannot wait. Leave out where you are and how long the house is empty. The reply goes to anyone who writes to you, including people you have never met.

In the documentation

Try it on a spare server.One command on a clean Ubuntu 24.04 server. Free for one server and five sites, with no card and no account.

Install Free