blob: 2eeeb2f7361ae9c1756ff4484789cb1590e8abf5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/bin/sh
set -e
echo "Setting up dovecot for the test"
# Move aside 10-auth.conf to disable passwd-based auth
if [ -f /etc/dovecot/conf.d/10-auth.conf ]; then
mv /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.bak
fi
cat >/etc/dovecot/local.conf <<-EOF
auth_mechanisms = plain
mail_location = maildir:~/Maildir
passdb {
driver = static
args = password=test
}
userdb {
driver = static
args = uid=nobody gid=nogroup home=/srv/dovecot-dep8/%u
}
EOF
mkdir -p /srv/dovecot-dep8
chown nobody:nogroup /srv/dovecot-dep8
echo "Restarting the service"
systemctl restart dovecot
echo "Sending a test message via the LDA"
/usr/lib/dovecot/dovecot-lda -f "test@example.com" -d dep8 <<EOF
Return-Path: <test@example.com>
Message-Id: <dep8-test-1@debian.org>
From: Test User <test@example.com>
To: dep8 <dep8@example.com>
Subject: DEP-8 test
This is just a test
EOF
echo "Verifying that the email was correctly delivered"
if [ -z "$(doveadm search -u dep8 header message-id dep8-test-1@debian.org)" ]; then
echo "Message not found"
exit 1
fi
echo "Done"
echo
|