-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·29 lines (22 loc) · 826 Bytes
/
run.sh
File metadata and controls
executable file
·29 lines (22 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
die () {
echo >&2 "$@"
exit 1
}
syslogd
PUID=${PUID:-5000}
PGID=${PGID:-5000}
id dovecot 2>/dev/null
[ ! $? -eq 0 ] && addgroup -g $PGID dovecot && adduser -u $PUID -G dovecot -D -s /bin/sh dovecot
if [ ! "$(id -u dovecot)" -eq "$PUID" ]; then usermod -o -u "$PUID" dovecot ; fi
if [ ! "$(id -g dovecot)" -eq "$PGID" ]; then groupmod -o -g "$PGID" dovecot ; fi
mkdir /config
echo "${VSITE_CIVIMAIL_USER}:{plain}${VSITE_CIVIMAIL_PASS}:${PUID}:${GUID}::/civimail" > /config/dovecot.passwd
chown -R dovecot:dovecot /config
if [ ! -f "/config/dovecot.passwd" ]; then
die "/config/dovecot.passwd does not exist - please create it. an example:
(username):(password with scheme):(uid):(gid)::(virtual home folder)
user:{plain}password:1050:1050::/mail/user"
fi
/usr/sbin/dovecot
tail -f /var/log/messages