The admin sends its test email with your site's settings. Order emails are sent by the background worker, which can end up with a different set of settings. When those have no mail server login, the server refuses to relay and the job fails with "relay access denied".
Why it happens
It happens on sites with a user/env/<host>/ folder, such as user/env/shop.example.com/. When that folder exists, the admin saves the Email plugin's settings there. The worker runs from cron as the cli environment, which never reads that folder, so it uses whatever user/config/plugins/email.yaml holds.
Fix it
- Confirm the cause:
bin/plugin kahunacart check
The Worker environment check names the folder and the settings the worker is missing.
- Pick one of these:
- Move the settings from
user/env/<host>/config/plugins/email.yamlintouser/config/plugins/email.yaml. This is the simplest fix for a store on one address. - Pin the environment by adding
GRAV_ENVIRONMENT=shop.example.comto the.envfile in the Grav root. - Pin it on the cron line:
* * * * * cd /path/to/grav && GRAV_ENVIRONMENT=shop.example.com php bin/grav scheduler 1>> /dev/null 2>&1
- Retry the failed jobs with Run now on KahunaCart → Operations → Jobs.
The Worker environment check goes green on the worker's next run.