Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions conf/turnkey.d/postfix-local
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash -e

fatal() { "'$(basename "$0")' Error: $*" >&2; exit 1; }

if [[ ! "$HOSTNAME" ]]; then
echo "'$(basename "$0")' error: hostname not defined"
return 1
fatal "Hostname not defined"
fi

if ! grep -q ':25' <(ss -tlnp); then
fatal "Port 25 is already in use - must be available to set up postfix"
fi

postconf -e inet_interfaces=localhost
Expand Down