davmail icon indicating copy to clipboard operation
davmail copied to clipboard

Bug #382: Enhance davmail script to allow overrides

Open SethRobertson opened this issue 1 year ago • 2 comments

It should be backwards compatible, but now you can pass in environmental variables (seen below) to override various default settings. Even better, if you just want to add java arguments (example: UI scaling) you can set JAVA_USER_OPTS and not have to worry about anything else.

Not fully tested since I don't have all of those environments.

CLASSPATH EXTRA_CLASSPATH JAVA JAVA_CORE_OPTS JAVA_EXTRA2_OPTS JAVA_EXTRA_OPTS JAVA_NET_OPTS_DFL JAVA_OPTS JAVA_USER_OPTS JFX_CLASSPATH LD_LIBRARY_PATH SWT_GTK3

SethRobertson avatar Jan 14 '25 23:01 SethRobertson

This is a good idea, @SethRobertson ! May I suggest running the script through shellcheck (see https://www.shellcheck.net/)? It's an excellent linter for shell scripts. For example, it suggests using

: "${JAVA_CORE_OPTS:=-Xmx512M -Dsun.net.inetaddr.ttl=60}"

instead of

: ${JAVA_CORE_OPTS:="-Xmx512M -Dsun.net.inetaddr.ttl=60"}

esabol avatar Jan 15 '25 01:01 esabol

Launch script changed quite a lot, merged the "override JAVA_OPTS" idea based on just 3 variables $BASE_JAVA_OPTS $JFX_JAVA_OPTS $SWT_JAVA_OPTS

Please test this to confirm it's working in various environments.

mguessan avatar Nov 09 '25 20:11 mguessan