Re: Configuration of userrepository

Benoit TELLIER <[email protected]> Tue, 14 Oct 2025 15:28:15 +0000
Newsgroups gmane.comp.jakarta.james.user
Message-ID <[email protected]>
---=Part.bb2.39d6ca8605f698ab.199e3561b3f.41148cd288de9cc5=-
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Accept-Language: fr-FR, en-US, vi-VN, ru-RU, ar-TN, it-IT, de-DE
Content-Language: en-US

Hello Felix

>=C2=A01=2E All examples contain the setting `enableForwarding=
` but I do not find any references to it=2E What's the purpose of the setti=
ng?

A quick code search shows no matches in code=2E

This unmapped configu=
ration property is likely a very old James 2=2Ex legacy=2E

I believe we ca=
n safely drop it in the ~8 files it appears in=2E

Contribution welcomed=2E=



>=C2=A02=2E What is the difference between configuring password salting =
via the `algorithm` or `hashingMode` setting (more below)?

CF=C2=A0https:/=
/github=2Ecom/apache/james-project/blob/ddfef1e05403a46a9136023721807bc791f=
20431/upgrade-instructions=2Emd?plain=3D1#L1097=C2=A0

The property "hashin=
gMode" is solely here to prevent a breaking change=2E If you are not runnig=
 a pre-2021 Jaems then safely ignore hashingMode

>=C2=A0I would like to co=
nfigure my james instance with postgres user backend to use password salts=
=2E

https://github=2Ecom/apache/james-project/blob/master/server/apps/post=
gres-app/sample-configuration/usersrepository=2Exml=C2=A0achieves this goal=


>=C2=A0 It would be nice if the difference would be mentioned in the docu=
mentation=2E
Contribution welcomed=2E
--=C2=A0

Best regards,

Benoit TELLI=
ER

General manager of Linagora VIETNAM=2E
Product owner for Team-Mail prod=
uct=2E
Chairman of the Apache James project=2E

Mail: btellier@linagora=2Ec=
om
Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal)


On Oct 7, 2025 7:57 PM, f=
rom Felix Auringer <felix=2Eauringer@giz=2Eberlin>Good evening,

I have two=
 questions regarding the configuration in userrepository=2Exml=2E

1=2E All=
 examples contain the setting `enableForwarding` but I do not find any refe=
rences to it=2E What's the purpose of the setting?
2=2E What is the differe=
nce between configuring password salting via the `algorithm` or `hashingMod=
e` setting (more below)?


I would like to configure my james instance with=
 postgres user backend to use password salts=2E For this, I have the follow=
ing userrepository=2Exml:
<usersrepository name=3D"LocalUsers">
    <algori=
thm>PBKDF2-SHA512</algorithm>
    <hashingMode>salted</hashingMode>
    <en=
ableVirtualHosting>true</enableVirtualHosting>
</usersrepository>

Based on=
 the documentation (docs/modules/servers/partials/configure/usersrepository=
=2Eadoc), I would have expected the algorithm in the database to be `PBKDF2=
-SHA512/salted` but it is `PBKDF2-SHA512/plain`=2E
When I use the following=
 userrepository=2Exml, the algorithm in the database is `PBKDF2-SHA512/salt=
ed` as expected:
<usersrepository name=3D"LocalUsers">
    <algorithm>PBKDF=
2-SHA512/salted</algorithm>
    <enableVirtualHosting>true</enableVirtualHo=
sting>
</usersrepository>

If I understand the code path correctly, the has=
h mode is read from the config in server/data/data-postgres/src/main/java/o=
rg/apache/james/user/postgres/PostgresUsersRepositoryConfiguration=2Ejava=
=2E
The algorithm and hashing mode are then used in server/data/data-postgr=
es/src/main/java/org/apache/james/user/postgres/PostgresUsersDAO=2Ejava=2E =
However, the hashing mode is only used once as a fallback when retrieving a=
 user and does not make it into the database=2E

Still, in both configurati=
ons, the password is salted with the username=2E

Best regards,
Felix


---=

Gesellschaft f=C3=BCr interkulturelles
Zusammenleben gGmbH (GIZ)
Felix Aur=
inger
IT
Reformationsplatz 2
13597 Berlin

Tel: 030/513 0100 00; Fax: 030/5=
13 0100 09 
giz=2Eberlin; felix=2Eauringer@giz=2Eberlin

Amtsgericht Charlo=
ttenburg HRB 200872 B
Gesch=C3=A4ftsf=C3=BChrerin: Dr=2E Britta Marschke

-=
--------------------------------------------------------------------
To uns=
ubscribe, e-mail: server-user-unsubscribe@james=2Eapache=2Eorg
For addition=
al commands, e-mail: server-user-help@james=2Eapache=2Eorg



---=Part.bb2.39d6ca8605f698ab.199e3561b3f.41148cd288de9cc5=---