feat: add the ability to set a MAILFROM value for local cron emails

Closes #7419
This commit is contained in:
Jose Diaz-Gonzalez
2024-12-17 00:27:08 -05:00
parent 819f9a84c9
commit b93a47c35b
7 changed files with 50 additions and 5 deletions

View File

@@ -48,10 +48,30 @@ When running scheduled cron tasks, there are a few items to be aware of:
- Schedules are performed on the hosting server's timezone, which is typically UTC.
- At this time, only the `PATH` and `SHELL` environment variables are specified in the cron template.
- A `MAILTO` value can be set via the `cron:set` command.
- A `MAILFROM` value can be set via the `cron:set` command.
- Each scheduled task is executed within a one-off `run` container, and thus inherit any docker-options specified for `run` containers. Resources are never shared between scheduled tasks.
- Scheduled cron tasks are supported on a per-scheduler basis, and are currently only implemented by the `docker-local` scheduler.
- Tasks for _all_ apps managed by the `docker-local` scheduler are written to a single crontab file owned by the `dokku` user. The `dokku` user's crontab should be considered reserved for this purpose.
#### Specifying a MAILFROM value
> [!IMPORTANT]
> New as of 0.35.14
Users can specify a value for `MAILFROM` via the global `mailfrom` cron property by using the `cron:set` command.
```shell
dokku cron:set --global mailfrom example@example.com
```
All output for individual cron runs will be sent from the specified email.
Cron emails can be reset to use the system email by running the `cron:set` command for the global `mailfrom` property with no value.
```shell
dokku cron:set --global mailfrom
```
#### Specifying a MAILTO value
By default, cron tasks complete and do not perform any reporting. Users can specify a value for `MAILTO` via the global `mailto` cron property by using the `cron:set` command.