Skip to content

Commit b114e82

Browse files
authored
Make webmail user management case insensitive (#423)
* Make webmail user management case insensitive * Enable versioning of client emails test package * Increase integration test delay for live tests * Visualize test delays
1 parent d4ef260 commit b114e82

17 files changed

Lines changed: 147 additions & 9 deletions

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LOKOLE_EMAIL_SERVER_QUEUES_NAMESPACE=
1515
LOKOLE_SENDGRID_KEY=
1616
LOKOLE_RESOURCE_SUFFIX=
1717
REGISTRATION_CREDENTIALS=admin:password
18+
TEST_STEP_DELAY=10
1819

1920
CLOUDBROWSER_PORT=10001
2021
AZURITE_PORT=10000

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ before_script: |
2626
export AZURITE_KEY="$TEST_AZURE_STORAGE_KEY"
2727
export AZURITE_HOST=""
2828
export AZURITE_SECURE="True"
29+
export TEST_STEP_DELAY=90
2930
else
3031
export REGISTRATION_CREDENTIALS="admin:password"
3132
export LOKOLE_QUEUE_BROKER_SCHEME="amqp"

docker/docker-compose.test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ services:
1313
AZURITE_ACCOUNT: ${AZURITE_ACCOUNT}
1414
AZURITE_KEY: ${AZURITE_KEY}
1515
AZURITE_HOST: ${AZURITE_HOST}
16+
TEST_STEP_DELAY: ${TEST_STEP_DELAY}
1617
volumes:
1718
- /var/run/docker.sock:/var/run/docker.sock

docker/integtest/2-client-uploads-emails.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ mkdir -p "${out_dir}"
99
. "${scriptdir}/utils.sh"
1010

1111
emails_to_send="${in_dir}/client-emails.tar.gz"
12+
tar -czf "${emails_to_send}" -C "${in_dir}" emails.jsonl zzusers.jsonl
13+
1214
client_id="$(jq -r '.client_id' < "${out_dir}/register1.json")"
1315
resource_container="$(jq -r '.resource_container' < "${out_dir}/register1.json")"
1416
resource_id="$(uuidgen).tar.gz"

docker/integtest/3-receive-email-for-client.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ http --check-status -f POST \
2626
"dkim={@sendgrid.com : pass}" \
2727
"SPF=pass" \
2828
"email=@${email_to_receive}"
29+
30+
# simulate delivery of another email
31+
http --check-status -f POST \
32+
"http://nginx:8888/api/email/sendgrid/${client_id}" \
33+
"dkim={@sendgrid.com : pass}" \
34+
"SPF=pass" \
35+
"email=@${in_dir}/inbound-email-2.mime"

docker/integtest/4-client-downloads-emails.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ mkdir -p "${out_dir}"
77
# shellcheck disable=SC1090
88
. "${scriptdir}/utils.sh"
99

10+
declare -A num_emails_expected_for_client
11+
num_emails_expected_for_client[1]=2
12+
num_emails_expected_for_client[2]=1
13+
1014
for i in 1 2; do
1115

1216
client_id="$(jq -r '.client_id' < "${out_dir}/register${i}.json")"
@@ -29,7 +33,7 @@ az_storage download "${resource_container}" "${resource_id}" "${out_dir}/downloa
2933
tar xzf "${out_dir}/downloaded${i}.tar.gz" -C "${out_dir}"
3034

3135
num_emails_actual="$(wc -l "${out_dir}/emails.jsonl" | cut -d' ' -f1)"
32-
num_emails_expected=1
36+
num_emails_expected="${num_emails_expected_for_client[${i}]}"
3337

3438
if [[ "${num_emails_actual}" -ne "${num_emails_expected}" ]]; then
3539
echo "Got ${num_emails_actual} emails but expected ${num_emails_expected}" >&2

docker/integtest/files/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
test.out/
2+
client-emails.tar.gz
-533 Bytes
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{"from":"clemens@developer1.lokole.ca","to":["clemens.wolff@gmail.com","laura.barluzzi@gmail.com"],"subject":"First test email sent from Lokole client","body":"Some content","_uid":"ed262575-73db-49cc-9c87-e2e95f8ac9cc","sent_at":"2019-10-26 11:23"}
2+
{"from":"laura@developer1.lokole.ca","to":["clemens.wolff@gmail.com"],"subject":"Second test email sent from Lokole client","body":"Some more content","_uid":"d03fff22-5c51-4f10-8111-5b24686964ba","attachments":[{"filename":"test.txt","content":"dGVzdCBhdHRhY2htZW50"}],"sent_at":"2019-10-25 05:00"}
3+
{"from":"Clemens@developer1.lokole.ca","to":["clemens@gmail.com","laura.barluzzi@gmail.com"],"subject":"Third test email sent from Lokole client","body":"Some extra content","_uid":"43f619b3-64ba-4ea3-963d-740cf0e58989","sent_at":"2019-10-26 12:34"}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Received: by mx0028p1mdw1.sendgrid.net with SMTP id Yt3NEnbnLU Mon, 13 Feb 2017 06:25:41 +0000 (UTC)
2+
Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) by mx0028p1mdw1.sendgrid.net (Postfix) with ESMTPS id C726D640B63; Mon, 13 Feb 2017 06:25:41 +0000 (UTC)
3+
Received: by mail-yw0-f176.google.com with SMTP id w75so45612320ywg.1; Sun, 12 Feb 2017 22:25:41 -0800 (PST)
4+
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ViHLGS6kOdo9Q9CkDDSSSS3bgKuN0a+UXhwMw06ak4Q=; b=f3WGzjgLe0tPG2edhiHxiCEZatThUga/qJFnWZNyY4lEVjRM9l3qn1BZ4ITawT9tDK LS6qFx//6in7u0rV0YKoa8TfScUFOpPHGCmq1Wxdp7mrWP7GDuCOz3LzyXQsrBe/erGy YEjAVU876sWJ109mcMcmbgOL1SD3d4ak+8GVBSC8oMKPj5XWZsET7WmsonhKf5PHE9IW eJHKqdOkxiPbmDutVx7uS1Bi5u4d9UYPhgxFwAK9lWyJ/Esw6yffjlrUvmQCPibSCxRv o979yY6FyJXDJ82l4ErntcOloFNpzWZ89WkRhb1aBLUoZs3402s6D3wC0ljpmvneIAkw 3D6A==
5+
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ViHLGS6kOdo9Q9CkDDSSSS3bgKuN0a+UXhwMw06ak4Q=; b=sWY7uU6kK3dg62wVuxcLsRYLg3eGcoLuoLjL0Ju/sl9rGqSDxVc2saIS0ThfUaHlfZ g1zvF+rBoxa7v9jk7MhEw3izW01WXDMm0w2JGc1QLTo3ZM2xW9Clss63R3ZtNKabuyhd 77NHAgbarmQGW5XuqwS1Fy0NMWHkAlLsZd2AnkNb6gCI/VHCCv/oem19bWvNWwRTPBYE cQDPJfzRiUzRPNZPLtlL5ybd2yyb4lcuG+2QoQV8uxPsKS4eDOjNmM76UWZ9s/Ul/mR+ Qbyui7suOO0vPy8GFJHPV9X2ffLqesafTAetCj3LClCdLIdfQDaK86mmVHOT6zldeCTa HH6Q==
6+
X-Gm-Message-State: AMke39n2h/OZU6fwgOdDltzsKqISVbe3ez6t19OeVrg2sT3pDRhSSQiIcwGzKjdWOD/oX96rQlTi0O9t9yhUfA==
7+
X-Received: by 10.129.81.4 with SMTP id f4mr15409224ywb.239.1486967141412; Sun, 12 Feb 2017 22:25:41 -0800 (PST)
8+
MIME-Version: 1.0
9+
Received: by 10.129.156.139 with HTTP; Sun, 12 Feb 2017 22:25:01 -0800 (PST)
10+
From: Clemens Wolff <clemens.wolff@gmail.com>
11+
Date: Sun, 12 Feb 2017 22:25:01 -0800
12+
Message-ID: <CAL79TcnjhV5PinZVY8Y3QEoNNcSa9uuNU5N3EP-gqcYPFfuHLA@mail.gmail.com>
13+
Subject: Two recipients
14+
To: Clemens@developer1.lokole.ca, LaUrA@developer1.lokole.ca
15+
Content-Type: multipart/alternative; boundary=001a1146392641b94705486384bf
16+
17+
--001a1146392641b94705486384bf
18+
Content-Type: text/plain; charset=UTF-8
19+
20+
Body of the message.
21+
22+
--001a1146392641b94705486384bf
23+
Content-Type: text/html; charset=UTF-8
24+
25+
<div dir="ltr">Body of the message.</div>
26+
27+
--001a1146392641b94705486384bf--

0 commit comments

Comments
 (0)