2016-12-30 20:06:44 +01:00
|
|
|
#! /bin/bash
|
2016-08-29 13:44:36 +02:00
|
|
|
|
2016-12-30 20:06:44 +01:00
|
|
|
DATABASE=${DATABASE:-/tmp/docker-mailserver/postfix-accounts.cf}
|
2016-08-29 13:44:36 +02:00
|
|
|
|
2016-12-30 20:06:44 +01:00
|
|
|
errex() {
|
|
|
|
echo "$@" 1>&2
|
|
|
|
exit 1
|
|
|
|
}
|
2016-08-29 13:44:36 +02:00
|
|
|
|
2016-12-30 20:06:44 +01:00
|
|
|
[ -f $DATABASE ] || errex "No postfix-accounts.cf file"
|
|
|
|
[ -s $DATABASE ] || errex "Empty postfix-accounts.cf - no users have been added"
|
2016-08-29 13:44:36 +02:00
|
|
|
|
2016-12-30 20:06:44 +01:00
|
|
|
awk -F '|' '{ print $1; }' $DATABASE
|