-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.postfix
More file actions
36 lines (30 loc) · 1.25 KB
/
Dockerfile.postfix
File metadata and controls
36 lines (30 loc) · 1.25 KB
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
30
31
32
33
34
35
36
FROM ubuntu:20.04
#
# Run Postfix mail server in container
#
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew vim-tiny bash curl wget git postfix postfix-mysql bsd-mailx gettext-base bind9-host sqlgrey libdbd-mysql-perl
# install bsmtp package for uucp mail delivery
#RUN wget https://download.opensuse.org/repositories/home:/eumel_8/Debian_7.0/amd64/bsmtp_1.02_amd64.deb
RUN wget --content-disposition "https://packagecloud.io/eumel8/gnuu/packages/ubuntu/focal/bsmtp_1.02_amd64.deb/download.deb?distro_version_id=210"
RUN dpkg -i bsmtp_1.02_amd64.deb
# entrypoint start script
COPY mail/postfix.sh /postfix.sh
COPY mail/sqlgrey.sh /sqlgrey.sh
# set permission and maildir
RUN chown root:uucp /usr/sbin/bsmtp
RUN chmod +s /usr/sbin/bsmtp
RUN mkdir -p /data/spool/bsmtp
RUN rm -rf /var/spool/bsmtp
RUN ln -s /data/spool/bsmtp /var/spool/bsmtp
# forward request and error logs to docker log collector
#RUN ln -sf /dev/stdout /var/log/mail.log
# expose postfix
EXPOSE 25
# expose sqlgrey
EXPOSE 2501
#RUN postmap /etc/postfix/virtual
RUN newaliases
ENV MAIL_CONFIG=/work-dir/etc/postfix
#CMD /usr/lib/postfix/sbin/master -c /work-dir/etc/postfix -d 2>&1