Skip to content

Commit b4a1830

Browse files
committed
add vmail user
1 parent 98a0581 commit b4a1830

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

dovecot/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ ARG DOVECOT_UID=4006
55
ARG DOVECOT_GID=4006
66
RUN apt-get update && apt-get install -qy dovecot-core dovecot-imapd
77

8+
RUN groupadd -g ${VMAIL_GID} vmail && \
9+
useradd -u $VMAIL_UID -g vmail -s /bin/false vmail && \
10+
mkdir /mail && \
11+
chown -R vmail:vmail /mail
12+
813
RUN groupadd postfix -g $POSTFIX_GID && \
914
useradd postfix -u ${POSTFIX_UID} -g postfix -s /bin/false && \
1015
gpasswd -a mail postfix
1116

1217
RUN groupmod dovecot -g ${DOVECOT_GID} && \
1318
usermod dovecot -u $DOVECOT_UID -g $DOVECOT_GID -s /bin/false
1419

15-
USER dovecot
16-
1720
CMD [ "/usr/sbin/dovecot", "-F" ]

postfix/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ ARG POSTFIX_UID=4005
44
ARG POSTFIX_GID=4005
55
ARG DOVECOT_UID=4006
66
ARG DOVECOT_GID=4006
7+
ARG VMAIL_UID=4007
8+
ARG VMAIL_GID=4007
79
RUN apt-get update && apt-get install -qy postfix
810

11+
RUN groupadd -g ${VMAIL_GID} vmail && \
12+
useradd -u $VMAIL_UID -g vmail -s /bin/false vmail && \
13+
mkdir /mail && \
14+
chown -R vmail:vmail /mail
15+
916
RUN groupadd -g ${DOVECOT_GID} dovecot && \
1017
useradd -u $DOVECOT_UID -g dovecot -s /bin/false dovecot
1118
RUN groupmod -g ${POSTFIX_GID} postfix && \
1219
usermod -u ${POSTFIX_UID} -g ${POSTFIX_GID} postfix
1320

14-
USER postfix
15-
1621
CMD [ "/usr/sbin/postfix" "start-fg" ]

0 commit comments

Comments
 (0)