mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-20 02:34:43 +02:00
scripts: new log (#2493)
* added new `_log` function With `_log`, the `_notify` method wa rendered obsolete. `_notify` was not completely removed due to test failures in `check-for-changes.sh`. The new `_log` function properly uses log levels such as `trace`, `debug`, `info`, `warn` and `error`. It provides a cleaner solution and renders `DMS_DEBUG` obsolete too (as only `_notify` depends on it). * converted all helper script to new `_log` function * converted all startup stacks to new `log` function * `start-mailserver.sh` now uses new `_log` function * final test and misc small script adjustments * updated documentation
This commit is contained in:
parent
d8d4b6a189
commit
24031ae365
19 changed files with 367 additions and 221 deletions
|
@ -115,7 +115,7 @@ A positive example, which is taken from `setup-stack.sh`, would be
|
|||
```bash
|
||||
function _setup_postfix_aliases
|
||||
{
|
||||
_notify 'task' 'Setting up Postfix Aliases'
|
||||
_log 'debug' 'Setting up Postfix aliases'
|
||||
|
||||
: >/etc/postfix/virtual
|
||||
: >/etc/postfix/regexp
|
||||
|
@ -139,10 +139,10 @@ function _setup_postfix_aliases
|
|||
DOMAIN=$(echo "${FROM}" | cut -d @ -f2)
|
||||
|
||||
# if they are equal it means the line looks like: "user1 other@example.com"
|
||||
[[ ${UNAME} != "${DOMAIN}" ]] && echo "${DOMAIN}" >> /tmp/vhost.tmp
|
||||
[[ ${UNAME} != "${DOMAIN}" ]] && echo "${DOMAIN}" >>/tmp/vhost.tmp
|
||||
done < <(grep -v "^\s*$\|^\s*\#" /tmp/docker-mailserver/postfix-virtual.cf || true)
|
||||
else
|
||||
_notify 'inf' "Warning '/tmp/docker-mailserver/postfix-virtual.cf' is not provided. No mail alias/forward created."
|
||||
_log 'debug' "'/tmp/docker-mailserver/postfix-virtual.cf' not provided - no mail alias/forward created"
|
||||
fi
|
||||
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue