Skip to content

Automatic replies

An automatic reply must not create a reply loop or backscatter to an unchecked sender. There is no universal Postfix setting for this: the responding application must apply these rules before sending.

Setup

Configure SPF, DKIM and DMARC for your own sending route. For the trigger message, use locally verified authentication rather than remote Authentication-Results. Exclude DSNs, mailing-list messages and already automated messages in the actual autoresponder. Limit reply volume per sender. Mark responses as Auto-Submitted: auto-replied and deliberately choose the envelope return path.

With an existing Dovecot LMTP/Sieve system, use its vacation extension and test in your own mailbox. This guide does not install new IMAP authentication or apply a generic vacation rule over existing delivery routes.

Test

Display the trigger context locally using your synthetic test message. This test checks eligibility prerequisites and does not send a reply:

set -euo pipefail
python3 - <<'PY'
from email.parser import BytesParser
from email.policy import default
from pathlib import Path
message = BytesParser(policy=default).parsebytes(Path('/root/mail-tests/sample.eml').read_bytes())
for name in ('Auto-Submitted', 'List-Id', 'List-Post', 'Precedence', 'Return-Path'):
    print(name + ':', message.get(name, '(not present)'))
assert message.get('Auto-Submitted', 'no').lower() == 'no'
assert not message.get('List-Id')
print('Local trigger has no automation/list headers; check authentication separately.')
PY

Next send the actual autoresponder a normal message, an Auto-Submitted: auto-replied message and a DSN: only the first should trigger a response. Check delivery and quota using mailboxes you control. The CLI context test alone does not prove complete autoresponder integration.