**Spam/virus shows "DiscardedOpenRelay" or "DiscardedOutbound" and never reaches quarantine:** Amavisd treats the recipient as non-local (outbound) and discards instead of quarantining. Set **`AMAVISD_LOCAL_DOMAINS`** to the **parent domain** of your local recipients (e.g. `plud.org` so that `user@muletrain.plud.org` is considered local). Use a single value; avoid extra words (e.g. use `plud.org`, not `plud.org and muletrain.plud.org`). In the stack env set e.g. `AMAVISD_LOCAL_DOMAINS=plud.org`, then **restart** the amavisd container (no image rebuild—config is read at startup). If `AMAVISD_LOCAL_DOMAINS` is unset, amavisd falls back to `MYDOMAIN` (e.g. set `MYDOMAIN=plud.org` so it matches). To confirm the variable in the container: `docker exec mailhub-amavisd env | grep AMAVISD_LOCAL_DOMAINS`. **Portainer users (env vars not in container):** (1) Ensure the stack’s **Compose content** is the latest `portainer-stack.yml`—the `mailhub-amavisd` service must list every env var (MYDOMAIN, AMAVISD_LOCAL_DOMAINS, AMAVISD_SPAM_QUARANTINE_TO, etc.) in its `environment:` section, or they will not be passed into the container even if set in Environment variables. (2) Add `AMAVISD_LOCAL_DOMAINS=plud.org` and the rest under the stack’s **Environment variables**. (3) Redeploy the stack so the amavisd container is recreated with the new env. If you override config via a file in the amavisd data dir (`amavisd.conf`), ensure it does not clear or override `@local_domains_acl` / `@local_domains_maps`, as 50-user.conf sets these after that file is loaded. If the stack never passes these env vars into the container (e.g. Portainer), use **stack.env**: in the amavisd data dir copy `stack.env.example` to `stack.env`, set `AMAVISD_LOCAL_DOMAINS=plud.org`, `MYDOMAIN=plud.org`, quarantine addresses, etc., then restart the amavisd container; the entrypoint sources `stack.env` at startup. See `host-data-skeleton/mailhub-amavisd/README.md`.
0 commit comments