Compare commits

...

1 Commits

  1. 10
      mailsrv/Containerfile
  2. 10
      mailsrv/Systemdfile
  3. 8
      mailsrv/assets/apache/roundcube.conf
  4. 0
      mailsrv/assets/bugfix/cronfix
  5. 5
      mailsrv/assets/pg_hba.conf
  6. 7
      mailsrv/docs/Deploy.md

10
mailsrv/Containerfile

@ -29,7 +29,7 @@ ARG FILESUID=5000
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
# install packages we want # install packages we want
RUN apt update -y && apt install -y rsyslog postfix dovecot-imapd dovecot-lmtpd dovecot-sieve cron RUN apt update -y && apt install -y rsyslog postfix dovecot-imapd dovecot-lmtpd dovecot-sieve cron apache2 postgresql roundcube roundcube-pgsql roundcube-plugins
# add virtual mail user # add virtual mail user
RUN addgroup --gid ${FILESUID:?} vmail && \ RUN addgroup --gid ${FILESUID:?} vmail && \
@ -74,6 +74,12 @@ COPY assets/dovecot /etc/dovecot
# make symlink to mail dir # make symlink to mail dir
RUN ln -s /vol/mail /var/mail/virtual RUN ln -s /vol/mail /var/mail/virtual
###
### Roundcube
###
### ###
### Working Directory ### Working Directory
### ###
@ -89,5 +95,5 @@ WORKDIR /vol/data
### ###
# bugfix for cron # bugfix for cron
COPY bugfix/cronfix /root/ COPY assets/bugfix/cronfix /root/
RUN chmod +x /root/cronfix && /root/cronfix RUN chmod +x /root/cronfix && /root/cronfix

10
mailsrv/Systemdfile

@ -0,0 +1,10 @@
#!/bin/bash
# Create PostgreSQL database and user
cmd() {
sudo -u postgres psql -c "$1"
}
cmd "CREATE USER $DBUSER;"
cmd "CREATE DATABASE $DBNAME;"
cmd "GRANT ALL PRIVILEGES ON DATABASE $DBNAME TO $DBUSER;"

8
mailsrv/assets/apache/roundcube.conf

@ -0,0 +1,8 @@
<VirtualHost *:80>
#ServerAdmin webmaster@localhost
DocumentRoot /var/lib/roundcube
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#LogLevel debug
</VirtualHost>

0
mailsrv/bugfix/cronfix → mailsrv/assets/bugfix/cronfix

5
mailsrv/assets/pg_hba.conf

@ -0,0 +1,5 @@
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all localhost trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust

7
mailsrv/docs/Deploy.md

@ -65,9 +65,12 @@ Then exit and relogin to refresh the bash hash
``` ```
acme.sh --issue --alpn --pre-hook 'systemctl stop haproxy' \ acme.sh --issue --alpn --pre-hook 'systemctl stop haproxy' \
--post-hook 'systemctl start haproxy' -d ${domain:?} --post-hook 'systemctl start haproxy' -d ${domain:?}
acme.sh --install-cert -d ${domain:?} \ DEPLOY_HAPROXY_PEM_PATH=/etc/haproxy/certs \
DEPLOY_HAPROXY_RELOAD="/usr/sbin/service haproxy reload" \
acme.sh --install-cert --deploy --deploy-hook haproxy \
--fullchain-file /srv/vol/mailsrv/ssl/fullchain.pem \ --fullchain-file /srv/vol/mailsrv/ssl/fullchain.pem \
--key-file /srv/vol/mailsrv/ssl/privkey.pem --key-file /srv/vol/mailsrv/ssl/privkey.pem \
-d ${domain:?}
``` ```
## make users and aliases ## make users and aliases

Loading…
Cancel
Save