TF-2953 Set up test environment for Patrol tests

Made sure only 1 test using ngrok is running at a time
This commit is contained in:
DatDang
2024-10-11 11:58:55 +07:00
committed by Dat H. Pham
parent 25437ba92e
commit 8fe9f2ece0
7 changed files with 403 additions and 12 deletions
+21
View File
@@ -0,0 +1,21 @@
version: "3"
services:
tmail-backend:
image: linagora/tmail-backend:memory-branch-master
container_name: tmail-backend
volumes:
- ./jwt_publickey:/root/conf/jwt_publickey
- ./jwt_privatekey:/root/conf/jwt_privatekey
- ./mailetcontainer.xml:/root/conf/mailetcontainer.xml
- ./imapserver.xml:/root/conf/imapserver.xml
- ./jmap.properties:/root/conf/jmap.properties
ports:
- "80:80"
environment:
- DOMAIN=example.com
networks:
- tmail
networks:
tmail:
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!-- Read https://james.apache.org/server/config-imap4.html for further details -->
<imapservers>
<imapserver enabled="true">
<jmxName>imapserver</jmxName>
<bind>0.0.0.0:143</bind>
<connectionBacklog>200</connectionBacklog>
<tls socketTLS="false" startTLS="true">
<!-- To create a new keystore execute:
keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-->
<keystore>file://conf/keystore</keystore>
<secret>james72laBalle</secret>
<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
</tls>
<connectionLimit>0</connectionLimit>
<connectionLimitPerIP>0</connectionLimitPerIP>
<idleTimeInterval>120</idleTimeInterval>
<idleTimeIntervalUnit>SECONDS</idleTimeIntervalUnit>
<enableIdle>true</enableIdle>
<plainAuthDisallowed>false</plainAuthDisallowed>
</imapserver>
<imapserver enabled="true">
<jmxName>imapserver-ssl</jmxName>
<bind>0.0.0.0:993</bind>
<connectionBacklog>200</connectionBacklog>
<tls socketTLS="true" startTLS="false">
<!-- To create a new keystore execute:
keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-->
<keystore>file://conf/keystore</keystore>
<secret>james72laBalle</secret>
<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
</tls>
<connectionLimit>0</connectionLimit>
<connectionLimitPerIP>0</connectionLimitPerIP>
<idleTimeInterval>120</idleTimeInterval>
<idleTimeIntervalUnit>SECONDS</idleTimeIntervalUnit>
<enableIdle>true</enableIdle>
</imapserver>
</imapservers>
+1
View File
@@ -0,0 +1 @@
url.prefix=https://a872-222-252-23-73.ngrok-free.app
+155
View File
@@ -0,0 +1,155 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!-- Read https://james.apache.org/server/config-mailetcontainer.html for further details -->
<mailetcontainer enableJmx="true">
<context>
<!-- When the domain part of the postmaster mailAddress is missing, the default domain is appended.
You can configure it to (for example) <postmaster>postmaster@myDomain.com</postmaster> -->
<postmaster>postmaster</postmaster>
</context>
<spooler>
<threads>20</threads>
<errorRepository>memory://var/mail/error/</errorRepository>
</spooler>
<processors>
<processor state="root" enableJmx="true">
<mailet match="All" class="PostmasterAlias"/>
<mailet match="RelayLimit=30" class="Null"/>
<mailet match="All" class="ToProcessor">
<processor>transport</processor>
</mailet>
</processor>
<processor state="error" enableJmx="true">
<mailet match="All" class="MetricsMailet">
<metricName>mailetContainerErrors</metricName>
</mailet>
<mailet match="All" class="Bounce"/>
<mailet match="All" class="ToRepository">
<repositoryPath>memory://var/mail/error/</repositoryPath>
<onMailetException>propagate</onMailetException>
</mailet>
</processor>
<processor state="transport" enableJmx="true">
<matcher name="relay-allowed" match="org.apache.james.mailetcontainer.impl.matchers.Or">
<matcher match="SMTPAuthSuccessful"/>
<matcher match="SMTPIsAuthNetwork"/>
<matcher match="SentByMailet"/>
<matcher match="org.apache.james.jmap.mailet.SentByJmap"/>
</matcher>
<mailet match="All" class="RemoveMimeHeader">
<name>bcc</name>
<onMailetException>ignore</onMailetException>
</mailet>
<mailet match="All" class="RecipientRewriteTable">
<errorProcessor>rrt-error</errorProcessor>
</mailet>
<mailet match="RecipientIsLocal" class="ToProcessor">
<processor>local-delivery</processor>
</mailet>
<mailet match="HostIsLocal" class="ToProcessor">
<processor>local-address-error</processor>
<notice>550 - Requested action not taken: no such user here</notice>
</mailet>
<mailet match="relay-allowed" class="ToProcessor">
<processor>relay</processor>
</mailet>
<mailet match="All" class="ToProcessor">
<processor>relay-denied</processor>
</mailet>
</processor>
<processor state="local-delivery" enableJmx="true">
<mailet match="All" class="VacationMailet"/>
<mailet match="All" class="Sieve"/>
<mailet match="All" class="AddDeliveredToHeader"/>
<mailet match="All" class="org.apache.james.jmap.mailet.filter.JMAPFiltering"/>
<mailet match="SenderIsLocal" class="com.linagora.tmail.mailets.ContactsCollection">
<attribute>ContactAttribute1</attribute>
</mailet>
<mailet match="All" class="com.linagora.tmail.mailets.TmailLocalDelivery"/>
</processor>
<processor state="relay" enableJmx="true">
<mailet match="All" class="RemoteDelivery">
<outgoingQueue>outgoing</outgoingQueue>
<delayTime>5000, 100000, 500000</delayTime>
<maxRetries>3</maxRetries>
<maxDnsProblemRetries>0</maxDnsProblemRetries>
<deliveryThreads>10</deliveryThreads>
<sendpartial>true</sendpartial>
<bounceProcessor>bounces</bounceProcessor>
</mailet>
</processor>
<processor state="local-address-error" enableJmx="true">
<mailet match="All" class="MetricsMailet">
<metricName>mailetContainerLocalAddressError</metricName>
</mailet>
<mailet match="All" class="Bounce">
<attachment>none</attachment>
</mailet>
<mailet match="All" class="ToRepository">
<repositoryPath>memory://var/mail/address-error/</repositoryPath>
</mailet>
</processor>
<processor state="relay-denied" enableJmx="true">
<mailet match="All" class="MetricsMailet">
<metricName>mailetContainerRelayDenied</metricName>
</mailet>
<mailet match="All" class="Bounce">
<attachment>none</attachment>
</mailet>
<mailet match="All" class="ToRepository">
<repositoryPath>memory://var/mail/relay-denied/</repositoryPath>
<notice>Warning: You are sending an e-mail to a remote server. You must be authenticated to perform such an operation</notice>
</mailet>
</processor>
<processor state="bounces" enableJmx="true">
<mailet match="All" class="MetricsMailet">
<metricName>bounces</metricName>
</mailet>
<mailet match="All" class="DSNBounce">
<passThrough>false</passThrough>
</mailet>
</processor>
<processor state="rrt-error" enableJmx="false">
<mailet match="All" class="ToRepository">
<repositoryPath>memory://var/mail/rrt-error/</repositoryPath>
<passThrough>true</passThrough>
</mailet>
<mailet match="IsSenderInRRTLoop" class="Null"/>
<mailet match="All" class="Bounce"/>
</processor>
</processors>
</mailetcontainer>