Skip to content

Commit

Permalink
Bugfix/mda tmpfs (#14)
Browse files Browse the repository at this point in the history
MDA:
- Moved entrypoint.sh
- Solved file permission issues

Test:
- Wait for greylisting after sending junk mail
  • Loading branch information
jeboehm authored Nov 4, 2016
1 parent cb48900 commit 4cada89
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ services:
env_file: .env
read_only: true
tmpfs:
- /run
- /var/lib/dovecot
- /tmp
volumes:
- data-mail:/var/vmail
- data-tls:/media/tls:rw
Expand Down
12 changes: 9 additions & 3 deletions mda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ ENV MYSQL_HOST=db \

RUN apk --no-cache add dovecot dovecot-mysql dovecot-pigeonhole-plugin \
&& adduser -h /var/vmail -u 5000 -D vmail \
&& rm -rf /etc/ssl/dovecot/ /etc/dovecot/conf.d/15-lda.conf /etc/dovecot/dovecot-sql.conf.ext \
&& rm -rf /etc/ssl/dovecot/ \
/etc/dovecot/conf.d/15-lda.conf \
/etc/dovecot/dovecot-sql.conf.ext \
/run \
/var/lib/dovecot \
&& ln -sf /etc/dovecot/rw/15-lda.conf /etc/dovecot/conf.d/15-lda.conf \
&& ln -sf /etc/dovecot/rw/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext
&& ln -sf /etc/dovecot/rw/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext \
&& ln -sf /tmp /run \
&& ln -sf /tmp /var/lib/dovecot

COPY rootfs/ /
RUN sievec /etc/dovecot/sieve-after/spam-to-folder.sieve

EXPOSE 2003 9000 4190 143 110 993 995
VOLUME ["/var/vmail", "/etc/dovecot/rw"]

CMD ["/entrypoint.sh"]
CMD ["/usr/local/bin/entrypoint.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ fi

echo "Starting MDA..."

dovecot -F
/usr/sbin/dovecot -F
11 changes: 10 additions & 1 deletion test/rootfs/opt/tests/mailing.bats
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,20 @@

@test "send junk mail to local address" {
swaks --to [email protected] --data sample-spam.txt
sleep 3
[ "$?" -eq 0 ]
}

@test "check junk mail in junk folder (sieve rule is working)" {
if [ "$GREYLISTING_ENABLED" == "true" ]
then
echo "Waiting for greylisting"
sleep 60
postqueue -f
sleep 3
else
sleep 5
fi

files="$(ls -1 /var/vmail/example.com/admin/Maildir/.Junk/new/ | wc -l)"
[ "$files" -gt 0 ]
}

0 comments on commit 4cada89

Please sign in to comment.