GoAdmio

responder

Create or delete an email autoresponder from the settings saved in GoAdmio, switch autoresponders on and off by their start and end dates, then rebuild the Postfix maps and restart the mail services

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

An autoresponder (vacation reply) sends an automatic answer to people who write to an email address. /go/responder manages these on the server. It:

The subject, message, active setting, and dates are not given on the command line. They are read from GoAdmio's autoresponder list (/var/lib/sqlite/responder.db). The autoresponse mail filter must be installed (see autoresponders).

[!WARNING] Every run, including one that only checks dates, restarts the mail services. Connected mail clients are briefly disconnected. See Restarts.


Quick start

# Create (or refresh) the autoresponder for info@example.com
/go/responder info@example.com add

Syntax

/go/responder <email> add
/go/responder <email> delete
Form Behavior
/go/responder <email> add Writes the reply file from the saved settings, and switches it on or off.
/go/responder <email> delete Removes the record and the reply file of that address.
Any other call, including /go/responder with no arguments Changes nothing for any address, but still runs the date check and the restarts.

Options

This command has no options. It takes the address and the action.

Argument Required Notes
<email> For add and delete The full email address, such as info@example.com.
<action> For add and delete add or delete. The words are case-sensitive.

Settings read from GoAdmio

For add and for the date check, the command reads these values for the address from the Responder table in /var/lib/sqlite/responder.db:

Setting Use
Subject The subject line of the reply.
Message The text of the reply.
Active 1 (or unset) switches the autoresponder on, 0 switches it off.
StartDate The first day on which the autoresponder replies.
EndDate The day on which it stops. The end date itself is not covered (see The date check).

If there is no record for the address, the reply file is created with an empty subject and message.


Output

Message Meaning
The autoresponder <email> was successfully created. The add steps ran. It is printed whether or not they worked.
The autoresponder <email> was deleted. The delete steps ran. It is printed whether or not they worked, and see the note below.

The autoresponse tool may print lines when the date check switches an autoresponder on or off. Every run is also recorded in /var/log/go/responder.log.

[!NOTE] Deleting an autoresponder that is switched on does not remove its reply file, because of a typing error in the script. See Troubleshooting.


Examples

# Create or refresh an autoresponder from its saved settings
/go/responder info@example.com add
# Delete an autoresponder that is switched on (disable it first)
autoresponse -d info@example.com
/go/responder info@example.com delete
# Run only the date check and the map rebuild
/go/responder
# See the reply files. A name ending in _DISABLED is switched off.
ls /var/spool/autoresponse/responses

Troubleshooting

Symptom Likely cause Fix
A deleted autoresponder still replies For a switched-on autoresponder, delete tries to remove a file name with a stray } at the end, so the real reply file stays. Run autoresponse -d <email> first, then /go/responder <email> delete. Or disable it and remove the file by hand.
The autoresponder has no subject or text There is no record for the address in the autoresponder list. Save the autoresponder settings in GoAdmio first, then run add again.
The autoresponder switches itself off The date check found the current time outside the start and end dates. If no dates are saved, the check treats the autoresponder as out of range and switches it off. Save a start and an end date.
Replies stop one day early The end date is not included. The autoresponder stops at 00:00 on the end date. Set the end date to the day after the last day you want replies.
An autoresponder with Active set to 0 never switches on The date check never changes an inactive autoresponder. Set it to active.
Mail clients are disconnected, or mail pauses briefly Every run restarts Postfix, Dovecot, and saslauthd. Avoid running it during busy hours.
The success message appears but nothing replies The message is printed regardless, or the filter isn't installed. Install it with autoresponders, and check that the file name has no _DISABLED ending.
autoresponse: command not found The autoresponse filter is not installed. Install it with autoresponders.
Nothing happens for a misspelled action Only add and delete are recognized. Use exactly add or delete.

Details

Files and data

Item Location
Autoresponder list /var/lib/sqlite/responder.db, table Responder
Reply files /var/spool/autoresponse/responses/<email>
A switched-off autoresponder The same file, named <email>_DISABLED

add

  1. Reads the subject, message, and active setting from the list.
  2. Removes the <email>_DISABLED file if there is one.
  3. Writes the reply file, in this layout:
From: <email>
To: THIS GETS REPLACED
Subject: <subject>


<message>
  1. Sets the file to mode 600, owned by the autoresponse user.
  2. If Active is 0, runs autoresponse -d <email> (off). Otherwise runs autoresponse -E <email> (on).
  3. Prints the success message.

delete

  1. Removes the record of the address from the list.
  2. Removes the <email>_DISABLED file if there is one.
  3. Tries to remove the reply file, but uses a wrong file name (see Troubleshooting), so the file of a switched-on autoresponder stays.
  4. Prints the message.

The date check

On every run, the command goes through all files in /var/spool/autoresponse/responses and compares the current time with the start and end dates of each one. Its own comment says this check is meant to run once a day at 00:00.

Condition Result
Now is on or after 00:00 on the start date, and not after 00:00 on the end date Switched on, if it was switched off and Active is 1.
Otherwise Switched off, if it was on and Active is 1.
Active is 0 Never changed.

Because the end date is compared at 00:00, the autoresponder stops at the start of the end date. If a start or end date is missing, it is treated as today at 00:00.

Restarts

After the date check, every run:

  1. Rebuilds the Postfix lookup maps custom_replies, vmail_domains, vmail_mailbox, and vmail_aliases with postmap.
  2. Restarts postfix, dovecot, and saslauthd.

Other notes


See also

Command Description
autoresponders Install the autoresponse Postfix content filter
mail Create an email address in GoAdmio via the command line
forward Configure per-domain email forwarding
vmail Rebuild the Postfix/Dovecot vmail maps
restoremail Recreate mail accounts from folders on disk
troubleshoot Troubleshoot email problems in GoAdmio