Skip to content

Commit 6810186

Browse files
committed
JMAP fix
Signed-off-by: sami <[email protected]>
1 parent 415c0fc commit 6810186

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

server/apps/distributed-app/docker-composeOLD.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ services:
1515
image: ghcr.io/appscode/inbox-server:latest
1616
container_name: james
1717
hostname: james.local
18-
# volumes:
19-
# - $PWD/webadmin.properties:/root/conf/webadmin.properties
18+
volumes:
19+
- $PWD/jmap.properties:/root/conf/jmap.properties
2020
command:
2121
- --generate-keystore
2222
networks:
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Configuration file for JMAP
2+
# Read https://james.apache.org/server/config-jmap.html for further details
3+
4+
enabled=true
5+
jmap.version.default=rfc-8621
6+
tls.keystoreURL=file://conf/keystore
7+
tls.secret=james72laBalle
8+
9+
10+
jmap.port=80
11+
url.prefix=http://localhost
12+
websocket.url.prefix=ws://localhost
13+
14+
email.send.max.size=100M
15+
max.size.attachments.per.mail=100M
16+
# only not work for RabbitMQ mail queue
17+
#delay.sends.enabled=true
18+
19+
# Alternatively TLS keys can be supplied via PEM files
20+
# tls.privateKey=file://conf/private.nopass.key
21+
# tls.certificates=file://conf/certs.self-signed.csr
22+
# An optional secret might be specified for the private key
23+
# tls.secret=james72laBalle
24+
# view.email.query.enabled=true
25+
#authentication.strategy.draft=BasicAuthenticationStrategy
26+
user.provisioning.enabled=false
27+
#
28+
# If you wish to use OAuth authentication, you should provide a valid JWT public key.
29+
# The following entry specify the link to the URL of the public key file,
30+
# which should be a PEM format file.
31+
#
32+
jwt.publickeypem.url=file://conf/rs256-4096-public.pem
33+
# Should simple Email/query be resolved against a Cassandra projection, or should we resolve them against OpenSearch?
34+
# This enables a higher resilience, but the projection needs to be correctly populated. False by default.
35+
# view.email.query.enabled=true
36+
37+
# If you want to specify authentication strategies for Jmap draft version
38+
# For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
39+
# authentication.strategy.draft=AccessTokenAuthenticationStrategy,JWTAuthenticationStrategy,QueryParameterAccessTokenAuthenticationStrategy
40+
41+
# If you want to specify authentication strategies for Jmap rfc-8621 version
42+
# For custom Authentication Strategy not inside package "org.apache.james.jmap.http", you have to specify its FQDN
43+
44+
authentication.strategy.rfc8621=JWTAuthenticationStrategy,BasicAuthenticationStrategy
45+
46+
# Prevent server side request forgery by preventing calls to the private network ranges. Defaults to true, can be disabled for testing.
47+
webpush.prevent.server.side.request.forgery=false

server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/JMAPApiRoutes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class JMAPApiRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticator:
102102
.`then`()))
103103

104104
private def handleError(throwable: Throwable, response: HttpServerResponse): SMono[Void] = throwable match {
105-
case e: UserNotFoundException => respondDetails(e.addHeaders(response), ProblemDetails(status = NOT_FOUND, detail = e.getMessage))
105+
case e: UserNotFoundException => respondDetails(e.addHeaders(response), ProblemDetails.forThrowable(throwable))
106106
case e: UnauthorizedException => respondDetails(e.addHeaders(response), ProblemDetails.forThrowable(throwable))
107107
case _ => respondDetails(response, ProblemDetails.forThrowable(throwable))
108108
}

0 commit comments

Comments
 (0)