You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2025/12/08 13:11:46 UTC

(openoffice) branch trunk updated: On *nix, call xdg-email to send emails when MAILER is unset.

This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a946b6ba3d On *nix, call xdg-email to send emails when MAILER is unset.
a946b6ba3d is described below

commit a946b6ba3de16eea6759ad8ef894a11e8109c5d6
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Mon Dec 8 15:10:03 2025 +0200

    On *nix, call xdg-email to send emails when MAILER is unset.
    
    Patch by: me
    Fixes: https://bz.apache.org/ooo/show_bug.cgi?id=107752
           shell: allow xdg-email as an email client
---
 main/shell/source/unix/misc/senddoc.sh | 43 +++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/main/shell/source/unix/misc/senddoc.sh b/main/shell/source/unix/misc/senddoc.sh
index 3f427c3fc7..b32db3afcd 100644
--- a/main/shell/source/unix/misc/senddoc.sh
+++ b/main/shell/source/unix/misc/senddoc.sh
@@ -375,8 +375,49 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
 
 	"")
 
+		XDG_EMAIL=`which xdg-email`
+		if [ -n "$XDG_EMAIL" ]; then
+			while [ "$1" != "" ]; do
+				case $1 in
+					--to)
+						if [ "${TO}" != "" ]; then
+							MAILTO="${MAILTO:-}${MAILTO:+&}cc=$2"
+						else
+							TO="$2"
+						fi
+						shift
+						;;
+					--cc)
+						MAILTO="${MAILTO:-}${MAILTO:+&}cc="`echo "$2" | "${URI_ENCODE}"`
+						shift
+						;;
+					--bcc)
+						MAILTO="${MAILTO:-}${MAILTO:+&}bcc="`echo "$2" | "${URI_ENCODE}"`
+						shift
+						;;
+					--subject)
+						MAILTO="${MAILTO:-}${MAILTO:+&}subject="`echo "$2" | "${URI_ENCODE}"`
+						shift
+						;;
+					--body)
+						MAILTO="${MAILTO:-}${MAILTO:+&}body="`echo "$2" | "${URI_ENCODE}"`
+						shift
+						;;
+					--attach)
+						MAILTO="${MAILTO:-}${MAILTO:+&}attach="`echo "$2" | "${URI_ENCODE}"`
+						shift
+						;;
+					*)
+						;;
+				esac
+				shift;
+			done
+
+			MAILTO="mailto:${TO}?${MAILTO}"
+			${XDG_EMAIL} "${MAILTO}" &
+
 		# DESKTOP_LAUNCH, see http://freedesktop.org/pipermail/xdg/2004-August/004489.html
-		if [ -n "$DESKTOP_LAUNCH" ]; then
+		elif [ -n "$DESKTOP_LAUNCH" ]; then
 			while [ "$1" != "" ]; do
 				case $1 in
 					--to)