8000 Feature/catatnight pull request by guidohu · Pull Request #36 · catatnight/docker-postfix · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature/catatnight pull request #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
From ubuntu:trusty
MAINTAINER Elliott Ye
FROM ubuntu:focal

# Set noninteractive mode for apt-get
ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -9,10 +8,10 @@ RUN apt-get update

# Start editing
# Install package here for cache
RUN apt-get -y install supervisor postfix sasl2-bin opendkim opendkim-tools
RUN apt-get -y install postfix sasl2-bin opendkim opendkim-tools

# Add files
ADD assets/install.sh /opt/install.sh

# Run
CMD /opt/install.sh;/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
CMD /opt/install.sh;/opt/postfix.sh
25 changes: 5 additions & 20 deletions assets/install.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
#!/bin/bash

#judgement
if [[ -a /etc/supervisor/conf.d/supervisord.conf ]]; then
exit 0
fi

#supervisor
cat > /etc/supervisor/conf.d/supervisord.conf <<EOF
[supervisord]
nodaemon=true

[program:postfix]
command=/opt/postfix.sh

[program:rsyslog]
command=/usr/sbin/rsyslogd -n -c3
EOF

############
# postfix
############
cat >> /opt/postfix.sh <<EOF
#!/bin/bash
service postfix start
tail -f /var/log/mail.log
postfix start-fg
EOF

chmod +x /opt/postfix.sh
postconf -e myhostname=$maildomain
postconf -e maillog_file=/dev/stdout
postconf -e mydestination="localhost.localdomain,localhost"
postconf -F '*/*/chroot = n'

############
Expand Down Expand Up @@ -127,4 +112,4 @@ cat >> /etc/opendkim/SigningTable <<EOF
*@$maildomain mail._domainkey.$maildomain
EOF
chown opendkim:opendkim $(find /etc/opendkim/domainkeys -iname *.private)
chmod 400 $(find /etc/opendkim/domainkeys -iname *.private)
chmod 400 $(find /etc/opendkim/domainkeys -iname *.private)
3 changes: 1 addition & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/bash

docker build -t catatnight/postfix .
docker build -t catatnight/postfix .
0