Skip to content

Commit

Permalink
removed dkim helper because dkim is embedded by default in 6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
runningman84 committed Mar 8, 2018
1 parent 109dde1 commit 83b8b13
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 71 deletions.
29 changes: 9 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM frolvlad/alpine-glibc
FROM ubuntu:18.04
MAINTAINER Philipp Hellmich <phil@hellmi.de>

ARG BUILD_DATE
Expand All @@ -19,18 +19,18 @@ ENV MAILSERVER_DOMAIN=example.org \
CGPAV_EXTRA_SPAM_SCORE=10 \
CGPAV_VIRUS_ACTION=none

# install wget
RUN apk add --update wget tar ca-certificates openssl binutils curl
# Install wget
RUN apt-get update && \
apt-get -y install wget curl && \
rm -rf /var/lib/apt/lists/*

# install dumb init
RUN wget -q https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 \
-O /usr/local/bin/dumb-init \
&& chmod +x /usr/local/bin/dumb-init
RUN wget -q https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64.deb && \
dpkg -i dumb-init_*.deb && rm dumb-init_*.deb

# add our user to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN adduser -S cgatepro -h /var/CommuniGate -G mail \
RUN useradd -r cgatepro -d /var/CommuniGate -g mail \
&& mkdir -p /var/CommuniGate \
&& mkdir -p /opt/CommuniGate \
&& chown -R cgatepro.mail /var/CommuniGate

# install communigate 32bit static
Expand All @@ -48,20 +48,9 @@ RUN adduser -S cgatepro -h /var/CommuniGate -G mail \
RUN cd /tmp \
&& wget -q ftp://ftp.stalker.com/pub/CommuniGatePro/CGatePro-Linux_amd64.deb \
-O /tmp/CGatePro-Linux_amd64.deb \
&& ar x /tmp/CGatePro-Linux_amd64.deb \
&& tar -xzf /tmp/data.tar.gz \
&& mv /tmp/opt/CommuniGate/* /opt/CommuniGate \
&& dpkg -i /tmp/CGatePro-Linux_amd64.deb \
&& rm -fr /tmp/*

# install dkim helper
RUN apk add --update perl-mail-dkim \
&& wget -q https://www.communigate.com/ScriptRepository/helper_DKIM_verify.pl \
-O /opt/CommuniGate/helper_DKIM_verify.pl \
&& wget -q https://www.communigate.com/ScriptRepository/helper_DKIM_sign.pl \
-O /opt/CommuniGate/helper_DKIM_sign.pl \
&& chmod 755 /opt/CommuniGate/helper_DKIM_verify.pl \
&& chmod 755 /opt/CommuniGate/helper_DKIM_sign.pl

# install cgpav
# http://program.farit.ru/antivir/cgpav-1.5.tar.gz
ADD cgpav-64 /opt/CommuniGate/cgpav
Expand Down
2 changes: 1 addition & 1 deletion Main.settings
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ExternalBalancer = {Enabled=NO;LogLevel=3;};
ExternalBanner = {Enabled=NO;LogLevel=3;};
ExternalCDR = {Enabled=NO;LogLevel=3;};
ExternalFilters = ({Enabled=YES;LogLevel=5;Name=cgpav;ProgramName="/opt/CommuniGate/cgpav -f /etc/cgpav.conf";RestartPause=15s;Timeout=5m;},{Enabled=YES;LogLevel=5;Name=DKIM_verify;ProgramName="/opt/CommuniGate/helper_DKIM_verify.pl";RestartPause=15s;Timeout=5m;},{Enabled=YES;LogLevel=5;Name=DKIM_sign;ProgramName="/opt/CommuniGate/helper_DKIM_sign.pl";RestartPause=15s;Timeout=5m;});
ExternalFilters = ({Enabled=YES;LogLevel=5;Name=cgpav;ProgramName="/opt/CommuniGate/cgpav -f /etc/cgpav.conf";RestartPause=15s;Timeout=5m;});
ExternalRADIUS = {Enabled=NO;LogLevel=3;};
HTTPOutputCacheSize = 10;
HTTPOutputLogLevel = 2;
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CommuniGate

Introduction
----
This docker image installs CommuniGate Pro using Alpine Linux.
This docker image installs CommuniGate Pro using Ubuntu 18.04 base image.

A documentation can be found here:
[https://www.communigate.com/communigatepro/](https://www.communigate.com/communigatepro/)
Expand Down Expand Up @@ -57,13 +57,13 @@ Key | Description | Default
------------ | ------------- | -------------
MAILSERVER_DOMAIN | The primary domain of the mailserver | example.org
MAILSERVER_HOSTNAME | The hostname of the mailserver | mail.example.org
HELPER_THREADS | The number of helper threads for cgpav and DKIM | 3
HELPER_THREADS | The number of helper threads for cgpav | 1
CGPAV_SPAMASSASIN_HOST | The hostname of the spamd service | localhost
CGPAV_SPAMASSASIN_PORT | The port of the spamd service | 783
CGPAV_VIRUS_ACTION | How to handle infected mails | none (virus scanning disabled)
CGPAV_SPAM_ACTION | How to handle spam mails | addheaderjunk

CGPAV and DKIM filters are preconfigured. The CGPAV filter scans using spamassassin and the DKIM filter signs and verifes messages.
CGPAV filter is preconfigured. The CGPAV filter scans using spamassassin.

Finally
----
Expand Down
16 changes: 0 additions & 16 deletions Rules.settings
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,5 @@
("Message Size", "greater than", 1024)
),
((ExternalFilter, cgpav))
),
(
8,
DKIM_verify,
(("Header Field", is, "DKIM-Signature:*")),
((ExternalFilter, DKIM_verify))
),
(
7,
DKIM_sign,
(
(Source, in, "trusted,authenticated"),
("Header Field", "is not", "DKIM-Signature:*")
),
((ExternalFilter, DKIM_sign))
)
)

33 changes: 2 additions & 31 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SUPPLPARAMS="--dropRoot --logToConsole"

if [ -z ${MAILSERVER_DOMAIN+x} ]; then MAILSERVER_DOMAIN=example.org; fi
if [ -z ${MAILSERVER_HOSTNAME+x} ]; then MAILSERVER_HOSTNAME=mail.example.org; fi
if [ -z ${HELPER_THREADS+x} ]; then HELPER_THREADS=3; fi
if [ -z ${HELPER_THREADS+x} ]; then HELPER_THREADS=1; fi
if [ -z ${CGPAV_SPAMASSASIN_HOST+x} ]; then CGPAV_SPAMASSASIN_HOST=localhost; fi
if [ -z ${CGPAV_SPAMASSASIN_PORT+x} ]; then CGPAV_SPAMASSASIN_PORT=783; fi
if [ -z ${CGPAV_SPAM_ACTION+x} ]; then CGPAV_SPAM_ACTION=addheaderjunk; fi
Expand All @@ -27,9 +27,8 @@ echo " CGPAV spamd Port: $CGPAV_SPAMASSASIN_PORT"
echo " CGPAV spam action: $CGPAV_SPAM_ACTION ($CGPAV_EXTRA_SPAM_ACTION)"
echo " CGPAV virus action: $CGPAV_VIRUS_ACTION"
echo " Helper Threads: $HELPER_THREADS"
echo " DKIM keys folders: $BASEFOLDER/DKIM"
echo ""
echo " Helpers and rules for cgpav and DKIM are preconfigured"
echo " Helpers and rules for cgpav are preconfigured"
echo "========================================================================"


Expand Down Expand Up @@ -75,34 +74,6 @@ if [ -f ${BASEFOLDER}/Settings/Queue.settings ]; then
sed "s/EnqueuerProcessors =.*/EnqueuerProcessors = $HELPER_THREADS;/g" -i ${BASEFOLDER}/Settings/Main.settings
fi

if [ ! -d ${BASEFOLDER}/DKIM ] ; then
echo "Creating DKIM public and private keys..."
mkdir ${BASEFOLDER}/DKIM
openssl genrsa -out ${BASEFOLDER}/DKIM/dkim.key 1024
openssl rsa -in ${BASEFOLDER}/DKIM/dkim.key -out ${BASEFOLDER}/DKIM/dkim.public -pubout -outform PEM
chown -R cgatepro.mail ${BASEFOLDER}/DKIM
fi

echo "Found DKIM public key:"
cat ${BASEFOLDER}/DKIM/dkim.public

echo "Please create a DNS record in the following format with your key in p="
echo "mail._domainkey.$MAILSERVER_DOMAIN. IN TXT \"v=DKIM1; g=*; k=rsa; p=...\""

if [ -f ${APPLICATION}/helper_DKIM_sign.pl ]; then
echo "Applying DKIM sign configuration from ENVIRONMENT..."
sed "s/Threads.*=.*/Threads = $HELPER_THREADS;/g" -i /opt/CommuniGate/helper_DKIM_sign.pl
sed "s/domain1.dom/$MAILSERVER_DOMAIN/g" -i /opt/CommuniGate/helper_DKIM_sign.pl
sed "s/domain2.dom/$MAILSERVER_HOSTNAME/g" -i /opt/CommuniGate/helper_DKIM_sign.pl
sed "s/domain1.key/\/var\/CommuniGate\/DKIM\/dkim.key/g" -i /opt/CommuniGate/helper_DKIM_sign.pl
sed "s/domain2.key/\/var\/CommuniGate\/DKIM\/dkim.key/g" -i /opt/CommuniGate/helper_DKIM_sign.pl
fi

if [ -f ${APPLICATION}/helper_DKIM_verify.pl ]; then
echo "Applying DKIM verify configuration from ENVIRONMENT..."
sed "s/Threads.*=.*/Threads = $HELPER_THREADS;/g" -i /opt/CommuniGate/helper_DKIM_verify.pl
fi

if [ -f /etc/cgpav.conf ]; then
echo "Creating CGPAV configuration from ENVIRONMENT..."
sed "s/max_childs =.*/max_childs = $HELPER_THREADS/g" -i /etc/cgpav.conf
Expand Down

0 comments on commit 83b8b13

Please sign in to comment.