File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM alpine:edge
2+ # install packages
3+ RUN apk update --no-cache \
4+ && apk add --no-cache --update postfix bash openssl tini \
5+ && apk add --no-cache --upgrade musl musl-utils \
6+ && apk add dockerize --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
7+ && (rm "/tmp/" * 2>/dev/null || true) && (rm -rf /var/cache/apk/* 2>/dev/null || true)
8+
9+ RUN openssl genrsa -des3 -passout pass:x -out /etc/ssl/private/mailout.pass.key 4096 \
10+ && openssl rsa -passin pass:x -in etc/ssl/private/mailout.pass.key \
11+ -out /etc/ssl/private/mailout.key \
12+ && openssl req -new -key /etc/ssl/private/mailout.key -out /etc/ssl/private/mailout.csr \
13+ -subj "/C=DE/ST=Berlin/L=Berlin/O=OrgName/OU=Standards/CN=sovereigncloudstack.org" \
14+ && openssl x509 -req -days 3650 -in /etc/ssl/private/mailout.csr -signkey /etc/ssl/private/mailout.key \
15+ -out /etc/ssl/certs/mailout.crt \
16+ && rm /etc/ssl/private/mailout.pass.key
17+
18+ COPY main.cf /etc/postfix/main.cf.tmpl
19+ COPY relay_map /etc/postfix/relay_map
20+ COPY security /etc/postfix/security
21+ RUN postmap /etc/postfix/security
22+ RUN postmap /etc/postfix/relay_map
23+ COPY entrypoint.sh /
24+ RUN chmod +x /entrypoint.sh
25+ RUN rm /etc/postfix/security
26+ RUN rm /etc/postfix/relay_map
27+
28+ EXPOSE 25
29+ STOPSIGNAL SIGKILL
30+
31+ ENTRYPOINT ["/sbin/tini" , "--" ]
32+ CMD ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ exec dockerize -template /etc/postfix/main.cf.tmpl:/etc/postfix/main.cf postfix start-fg
Original file line number Diff line number Diff line change 1+ alias_database = hash:/etc/aliases
2+ alias_maps = hash:/etc/aliases
3+ append_dot_mydomain = no
4+ biff = no
5+ compatibility_level = 2
6+ cyrus_sasl_config_path = /etc/postfix/sasl
7+ inet_interfaces = all
8+ inet_protocols = ipv4
9+ mailbox_size_limit = 0
10+ maillog_file = /dev/stdout
11+ mydestination = localhost.localdomain, localhost
12+ myhostname = {{ .Env.POSTFIX_MYHOSTNAME }}
13+ mynetworks = 127.0.0.0/8
14+ myorigin = {{ .Env.POSTFIX_MYORIGIN }}
15+ readme_directory = no
16+ recipient_delimiter = +
17+ relayhost =
18+ sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_map
19+ smtpd_banner = $myhostname ESMTP
20+ smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
21+ smtpd_sasl_authenticated_header = yes
22+ smtpd_tls_cert_file=/etc/ssl/certs/mailout.crt
23+ smtpd_tls_key_file=/etc/ssl/private/mailoout.key
24+ smtpd_tls_security_level=encrypt
25+ smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
26+ smtp_helo_name = {{ .Env.POSTFIX_SMTP_HELO_NAME }}
27+ smtp_sasl_password_maps=hash:/etc/postfix/security
28+ smtp_sasl_security_options = noanonymous
29+ smtp_tls_note_starttls_offer = yes
30+ smtp_tls_security_level = encrypt
31+ smtp_tls_security_level=encrypt
32+ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
Original file line number Diff line number Diff line change 1+ POSTFIX_MYHOSTNAME = foo
2+ POSTFIX_MYORIGIN = foo.bar
Original file line number Diff line number Diff line change 1+ @foo.bar [smtp.bar.foo]:587
Original file line number Diff line number Diff line change 1+ foo@bar.foo foo@bar.foo:mytotalsecuresecret
You can’t perform that action at this time.
0 commit comments