This commit is contained in:
parent
7a958d4382
commit
c65f98a437
22
Dockerfile
22
Dockerfile
@ -1,18 +1,38 @@
|
||||
#Dockerfile for a Postfix email relay service
|
||||
FROM alpine:3.16
|
||||
FROM alpine:3
|
||||
MAINTAINER Juan Luis Baptiste juan.baptiste@gmail.com
|
||||
|
||||
RUN apk update && \
|
||||
apk add bash gawk cyrus-sasl cyrus-sasl-login cyrus-sasl-crammd5 mailx \
|
||||
postfix && \
|
||||
apk add make go pkgconfig libsecret libsecret-dev git gpg gpg-agent pass && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
mkdir -p /var/log/supervisor/ /var/run/supervisor/ && \
|
||||
sed -i -e 's/inet_interfaces = localhost/inet_interfaces = all/g' /etc/postfix/main.cf
|
||||
|
||||
# Gpg for pass/pmb
|
||||
RUN mkdir /root/.gnupg
|
||||
#RUN echo "default-cache-ttl 34560000" >> /root/.gnupg/gpg-agent.conf
|
||||
#RUN echo "max-cache-ttl 34560000" >> /root/.gnupg/gpg-agent.conf
|
||||
RUN gpg-agent --daemon --batch --disable-scdaemon
|
||||
RUN gpg --quick-gen-key --batch --passphrase '' pmbkey
|
||||
RUN pass init pmbkey
|
||||
|
||||
COPY run.sh /
|
||||
COPY passpgp.sh /
|
||||
RUN chmod +x /run.sh
|
||||
RUN chmod +x /passpgp.sh
|
||||
RUN newaliases
|
||||
|
||||
# ProtonMailBridge
|
||||
RUN git clone https://github.com/ProtonMail/proton-bridge.git pb
|
||||
WORKDIR pb
|
||||
RUN echo "BUILDING BRIDGE"
|
||||
RUN make build-nogui
|
||||
RUN rm -rf /root/.cache && rm -rf /root/go
|
||||
|
||||
WORKDIR /
|
||||
|
||||
EXPOSE 25
|
||||
#ENTRYPOINT ["/run.sh"]
|
||||
CMD ["/run.sh"]
|
||||
|
@ -3,6 +3,8 @@
|
||||
[![Docker Stars](https://img.shields.io/docker/stars/juanluisbaptiste/postfix.svg?style=flat-square)](https://hub.docker.com/r/juanluisbaptiste/postfix/)
|
||||
[![Docker Pulls](https://img.shields.io/docker/pulls/juanluisbaptiste/postfix.svg?style=flat-square)](https://hub.docker.com/r/juanluisbaptiste/postfix/)
|
||||
|
||||
## This is a merge of juanluisbaptiste/postfix and ProtonMail/proton-bridge
|
||||
|
||||
Simple Postfix SMTP TLS relay [docker](http://www.docker.com) alpine based image with no local authentication enabled (to be run in a secure LAN).
|
||||
|
||||
This image is available for the following architectures:
|
||||
|
@ -1,11 +1,29 @@
|
||||
version: '2'
|
||||
services:
|
||||
postfix:
|
||||
image: juanluisbaptiste/postfix:latest
|
||||
dpo:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
#image: juanluisbaptiste/postfix:latest
|
||||
expose:
|
||||
- "25"
|
||||
env_file:
|
||||
- .env
|
||||
restart: always
|
||||
volumes:
|
||||
- dpo_root:/root
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
networks:
|
||||
- mn
|
||||
|
||||
deb:
|
||||
image: debian:latest
|
||||
tty: yes
|
||||
stdin_open: yes
|
||||
networks:
|
||||
- mn
|
||||
|
||||
networks:
|
||||
mn:
|
||||
volumes:
|
||||
dpo_root:
|
||||
|
12
run.sh
12
run.sh
@ -2,6 +2,17 @@
|
||||
|
||||
[ "${DEBUG}" == "yes" ] && set -x
|
||||
|
||||
# GPG Area
|
||||
#exec gpg-agent --daemon --batch --disable-scdaemon
|
||||
gpg-agent --daemon --batch --disable-scdaemon
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Postfix area
|
||||
|
||||
function add_config_value() {
|
||||
local key=${1}
|
||||
local value=${2}
|
||||
@ -35,6 +46,7 @@ add_config_value "myorigin" '$mydomain'
|
||||
add_config_value "relayhost" "[${SMTP_SERVER}]:${SMTP_PORT}"
|
||||
add_config_value "smtp_use_tls" "yes"
|
||||
if [ ! -z "${SMTP_USERNAME}" ]; then
|
||||
add_config_value "smtp_sasl_mechanism_filter" "login"
|
||||
add_config_value "smtp_sasl_auth_enable" "yes"
|
||||
add_config_value "smtp_sasl_password_maps" "lmdb:/etc/postfix/sasl_passwd"
|
||||
add_config_value "smtp_sasl_security_options" "noanonymous"
|
||||
|
Loading…
x
Reference in New Issue
Block a user