Skip to content

TF-3484, 3524, 3717 StallWart interoperability #3529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dab246
Copy link
Member

@dab246 dab246 commented Mar 4, 2025

Issue

#3484
#3524
#3717

Resolved

demo.webm

@dab246 dab246 requested a review from hoangdat March 4, 2025 04:58
@dab246 dab246 requested a review from tddang-linagora March 4, 2025 04:58
Copy link

github-actions bot commented Mar 4, 2025

This PR has been deployed to https://linagora.github.io/tmail-flutter/3529.

@dab246 dab246 requested a review from tddang-linagora March 4, 2025 08:31
@dscso
Copy link

dscso commented Mar 4, 2025

Does this also work compiling for web?

@dscso
Copy link

dscso commented Mar 4, 2025

I have just tried it on web, but using the standard configuration (env.file) it still uses standard auth.

tddang-linagora
tddang-linagora previously approved these changes Mar 5, 2025
@dab246
Copy link
Member Author

dab246 commented Mar 5, 2025

I have just tried it on web, but using the standard configuration (env.file) it still uses standard auth.

IMO, maybe some field configuration incorrect. If possible, please share your env.file with us.

@dscso

Propose

To run on the web with advanced auth (OIDC), in addition to setting the SERVER_URL value, you also need to configure DOMAIN_REDIRECT_URL and WEB_OIDC_CLIENT_ID in the env.file. If you are using Keycloak, go to Your Realm > Clients > Client Details to set these values correctly.

Screenshot 2025-03-06 at 14 02 15

We have also described it in the project's docs folder. Please see more here oidc_configuration.md

@dab246 dab246 force-pushed the customer-stalwart/tf-3484-stallwart-interoperability branch from 5e2ff75 to 9581fa1 Compare May 19, 2025 09:07
@dab246 dab246 changed the title TF-3484, 3524 StallWart interoperability TF-3484, 3524, 3717 StallWart interoperability May 19, 2025
@jkaberg
Copy link

jkaberg commented Jun 6, 2025

Would it be possible to (in this PR or another) enhance the docs to cover how to set this up properly with Stalwart?

@Haxverse
Copy link

Haxverse commented Jun 7, 2025

While the web version worked perfectly for my use case, I wasn't able to compile a android APK with the flutter ghcr.io/cirruslabs/flutter:3.24.5 docker image which seems to be used in the CI workflow. Getting all kinds of errors regarding kotlin/flutter/android-sdk versions. Is there a specific dev setup/image you guys use to build the android bundles?

@Haxverse
Copy link

Haxverse commented Jun 7, 2025

Would it be possible to (in this PR or another) enhance the docs to cover how to set this up properly with Stalwart?

It seems adding a OAuth client id in stalwart for teammail-web with a redirect url of https://webmail.example.com/login-callback.html and compiling the docker image like below does the trick.

For the mobile version the client id is teammail-mobile with the redirect url of teammail.mobile://oauthredirect.

git clone -b customer-stalwart/tf-3484-stallwart-interoperability https://github.com/linagora/tmail-flutter
cd tmail-flutter
nano env.file # Change SERVER_URL to https://stalwart.example.com, and DOMAIN_REDIRECT_URL to https://webmail.example.com
docker build -t tmail-web:latest .
docker run -d -ti -p 8080:80 --name web tmail-web:latest

Hope this helps.

@hoangdat
Copy link
Member

hoangdat commented Jun 7, 2025

While the web version worked perfectly for my use case, I wasn't able to compile a android APK with the flutter ghcr.io/cirruslabs/flutter:3.24.5 docker image which seems to be used in the CI workflow. Getting all kinds of errors regarding kotlin/flutter/android-sdk versions. Is there a specific dev setup/image you guys use to build the android bundles?

Hi, it is my env to build app

flutter doctor -v 
[✓] Flutter (Channel stable, 3.24.5, on macOS 15.4.1 24E263 darwin-x64, locale en-VN)
    • Flutter version 3.24.5 on channel stable at /Users/datph/FlutterInstall/flutter3_24_5/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (7 months ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/datph/Library/Android/sdk/
    • Platform android-36, build-tools 34.0.0
    • ANDROID_HOME = /Users/datph/Library/Android/sdk/
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915915-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915915-b509.11)

[✓] VS Code (version 1.100.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.112.0

[✓] Connected device (3 available)            
    • M2003J15SC (mobile) • 6d92ce630406 • android-arm64  • Android 12 (API 31)
    • macOS (desktop)     • macos        • darwin-x64     • macOS 15.4.1 24E263 darwin-x64
    • Chrome (web)        • chrome       • web-javascript • Google Chrome 137.0.7151.69
    ! Error: Browsing on the local area network for iPhone Đạt . Ensure the device is unlocked and attached with a cable or associated with the same local area network
      as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Ip12 của Đạt. Ensure the device is unlocked and attached with a cable or associated with the same local area network
      as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Nqhh.dev. Ensure the device is unlocked and attached with a cable or associated with the same local area network as
      this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!

@hoangdat
Copy link
Member

hoangdat commented Jun 7, 2025

And java version

java --version 
openjdk 17.0.14 2025-01-21
OpenJDK Runtime Environment Homebrew (build 17.0.14+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.14+0, mixed mode, sharing)

@hoangdat hoangdat merged commit 25c2eb0 into master Jun 9, 2025
23 checks passed
@jkaberg
Copy link

jkaberg commented Jun 10, 2025

Would it be possible to (in this PR or another) enhance the docs to cover how to set this up properly with Stalwart?

It seems adding a OAuth client id in stalwart for teammail-web with a redirect url of https://webmail.example.com/login-callback.html and compiling the docker image like below does the trick.

For the mobile version the client id is teammail-mobile with the redirect url of teammail.mobile://oauthredirect.

git clone -b customer-stalwart/tf-3484-stallwart-interoperability https://github.com/linagora/tmail-flutter
cd tmail-flutter
nano env.file # Change SERVER_URL to https://stalwart.example.com, and DOMAIN_REDIRECT_URL to https://webmail.example.com
docker build -t tmail-web:latest .
docker run -d -ti -p 8080:80 --name web tmail-web:latest

Hope this helps.

Thanks a lot, would you mind sharing some screenshots on how you setup the Stalwart side of things? Looking over the Authentication-Directories-Create directory (in Stalwart admin interface) this isn't plainly obvious for me :-(

@Haxverse
Copy link

Would it be possible to (in this PR or another) enhance the docs to cover how to set this up properly with Stalwart?

It seems adding a OAuth client id in stalwart for teammail-web with a redirect url of https://webmail.example.com/login-callback.html and compiling the docker image like below does the trick.
For the mobile version the client id is teammail-mobile with the redirect url of teammail.mobile://oauthredirect.

git clone -b customer-stalwart/tf-3484-stallwart-interoperability https://github.com/linagora/tmail-flutter
cd tmail-flutter
nano env.file # Change SERVER_URL to https://stalwart.example.com, and DOMAIN_REDIRECT_URL to https://webmail.example.com
docker build -t tmail-web:latest .
docker run -d -ti -p 8080:80 --name web tmail-web:latest

Hope this helps.

Thanks a lot, would you mind sharing some screenshots on how you setup the Stalwart side of things? Looking over the Authentication-Directories-Create directory (in Stalwart admin interface) this isn't plainly obvious for me :-(

image

@jkaberg
Copy link

jkaberg commented Jun 10, 2025

Would it be possible to (in this PR or another) enhance the docs to cover how to set this up properly with Stalwart?

It seems adding a OAuth client id in stalwart for teammail-web with a redirect url of https://webmail.example.com/login-callback.html and compiling the docker image like below does the trick.
For the mobile version the client id is teammail-mobile with the redirect url of teammail.mobile://oauthredirect.

git clone -b customer-stalwart/tf-3484-stallwart-interoperability https://github.com/linagora/tmail-flutter
cd tmail-flutter
nano env.file # Change SERVER_URL to https://stalwart.example.com, and DOMAIN_REDIRECT_URL to https://webmail.example.com
docker build -t tmail-web:latest .
docker run -d -ti -p 8080:80 --name web tmail-web:latest

Hope this helps.

Thanks a lot, would you mind sharing some screenshots on how you setup the Stalwart side of things? Looking over the Authentication-Directories-Create directory (in Stalwart admin interface) this isn't plainly obvious for me :-(

image

Thanks! I've documented an working example here: stalwartlabs/stalwart#513 (comment)

@chibenwa
Copy link
Member

@jkaberg

This example is valuable.

I think it deserve to be in https://github.com/linagora/tmail-flutter/tree/master/docs/configuration in stallwart-compatibility.md

Feel free to propose us a PR, this would be MUCH MUCH appreciated ;-)

Have a good day,

Benoit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants