GoAdmio

autoresponders

Install the autoresponse Postfix content filter

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


Overview

An autoresponder sends an automatic reply, such as an out-of-office message, when mail arrives for an address. /go/autoresponders installs the software that does this for Postfix. It:

It installs the filter only. To create or delete the autoresponder of an address, use responder.

[!WARNING] The command does not reload Postfix. The filter takes effect only after you reload or restart Postfix, for example with systemctl reload postfix.


Quick start

# Install the autoresponse filter (run as root)
/go/autoresponders

# Then make Postfix use it
systemctl reload postfix

Syntax

/go/autoresponders

The command takes no arguments or options. Run it as root. Postfix must already be installed.


Output

The command prints the output of the tools it runs: the wget download progress and the list of files tar unpacks. If Postfix is already set up for the filter, it also prints an empty line and changes nothing in Postfix.

Message Meaning
useradd: user 'autoresponse' already exists The user was created by an earlier run. This is harmless.

Examples

# Install the filter
/go/autoresponders
# Apply the Postfix changes
systemctl reload postfix
# Check that the filter line and the service were added
grep -n "autorespon" /etc/postfix/master.cf
# Review the log of past runs
tail -n 20 /var/log/go/autoresponders.log

Troubleshooting

Symptom Likely cause Fix
Autoresponses are not sent Postfix was not reloaded, or no autoresponder exists for the address. Reload Postfix, then create the responder with responder.
grep shows the autoresponder unix service but no -o content_filter=autoresponder:dummy line The smtp line in master.cf has different spacing, so the filter line was not inserted. Add the -o content_filter=autoresponder:dummy line under the smtp inet service by hand.
Postfix reports the autoresponder service twice The command was run again after the filter line failed to insert. See above. Delete the duplicate autoresponder unix entry from /etc/postfix/master.cf, then reload Postfix.
Mail is delayed after the install The filter is failing, so mail cannot pass through it. Read /var/log/maillog. To switch the filter off, remove it as shown below.
No reply for mail sent through ports 587 or 465 Only the smtp service on port 25 uses the filter. None. See Postfix changes.
wget fails or hangs The server cannot reach www.nefaria.com, or the file is no longer there. Check the server's internet access and try again.
useradd fails with a permission error The command was not run as root. Run it as root.
Files are left in /tmp The command does not delete the download. Remove /tmp/autoresponse-1.6.2.tar.gz and /tmp/autoresponse yourself.

Removing the filter

To switch the filter off, delete the -o content_filter=autoresponder:dummy line and the two autoresponder unix lines from /etc/postfix/master.cf, then reload Postfix. The command has no uninstall option.


Details

What it does

# Step
1 Download http://www.nefaria.com/scriptz/autoresponse-1.6.2.tar.gz to /tmp and unpack it.
2 Create the user autoresponse, with /var/spool/autoresponse as its home and a no-login shell.
3 Create /var/spool/autoresponse/log and /var/spool/autoresponse/responses.
4 Copy the autoresponse program to /usr/local/sbin/.
5 Give the autoresponse user ownership of /var/spool/autoresponse, with mode 0770.
6 Change /etc/postfix/master.cf and main.cf, unless the filter line is already in master.cf.

[!WARNING] The download uses plain HTTP, comes from a third-party server, and is not checked against a checksum. Anyone who can tamper with that connection could change what is installed.

Postfix changes

Postfix is changed only when master.cf does not already contain -o content_filter=autoresponder:dummy.

File Change
master.cf The line -o content_filter=autoresponder:dummy is added under the smtp inet service, which receives mail on port 25.
master.cf A new autoresponder service is added. It runs /usr/local/sbin/autoresponse as the autoresponse user, and passes it the sender, the recipient, the SASL user name, and the client address.
main.cf autoresponder_destination_recipient_limit = 1 is set, so the filter handles one recipient at a time.

The filter line is inserted only when the smtp line in master.cf has the standard spacing. Mail sent through the submission ports does not go through this filter.

Logging

Every run appends a timestamp to /var/log/go/autoresponders.log.

What a run does

flowchart TD
    A["autoresponders"] --> B["Download and unpack autoresponse"]
    B --> C["Create the user, folders, and program"]
    C --> D{"Filter line already in master.cf?"}
    D -- "Yes" --> X["Change nothing in Postfix"]
    D -- "No" --> E["Add the filter line and the autoresponder service"]
    E --> F["Set the recipient limit in main.cf"]

See also

Command Description
responder Create or delete an email autoresponder
installmail Install and configure webmail services (Postfix and Dovecot)
filter Manage per-domain email filters (Sieve)
troubleshoot Troubleshoot email problems in GoAdmio
outgoing Report today's outbound mail sessions
incoming Report today's inbound mail sessions