[Portland] [PATCH] xdg-email: Case-insensitive run_thunderbird

Jack Bates 2bramw at nottheoilrig.com
Sun Jan 21 15:52:26 UTC 2018


I clicked the "Reply to: john doe (on-list)" link on this page [1] and 
was surprised that the new message that Thunderbird opened lacked a "Cc: 
debian-boot at lists.debian.org" header.

The problem is that the <hfname> in the mailto URL is capitalized (Cc=), 
which xdg-email currently ignores.

I confirmed that a mailto: <hfname> *is* case-insensitive [2], so this 
patch replaces "grep" with "grep -i" and "sed s/.../.../" with "sed 
s/.../.../i" in the necessary spots.

[1] https://lists.debian.org/debian-boot/2018/01/msg00265.html
[2] https://tools.ietf.org/html/rfc6068#section-2

diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in
index 3614776..f15ca2d 100644
--- a/scripts/xdg-email.in
+++ b/scripts/xdg-email.in
@@ -43,12 +43,12 @@ run_thunderbird()
      fi

      MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g')
-    TO=$(/bin/echo -e $(echo "$MAILTO" | grep '^to=' | sed 
's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
-    CC=$(/bin/echo -e $(echo "$MAILTO" | grep '^cc=' | sed 
's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
-    BCC=$(/bin/echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 
's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
-    SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1)
-    BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1)
-    ATTACH=$(/bin/echo -e $(echo "$MAILTO" | grep '^attach=' | sed 
's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 
's/,$//'))
+    TO=$(/bin/echo -e $(echo "$MAILTO" | grep -i '^to=' | sed 
's/^to=//i;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
+    CC=$(/bin/echo -e $(echo "$MAILTO" | grep -i '^cc=' | sed 
's/^cc=//i;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
+    BCC=$(/bin/echo -e $(echo "$MAILTO" | grep -i '^bcc=' | sed 
's/^bcc=//i;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
+    SUBJECT=$(echo "$MAILTO" | grep -i '^subject=' | tail -n 1)
+    BODY=$(echo "$MAILTO" | grep -i '^body=' | tail -n 1)
+    ATTACH=$(/bin/echo -e $(echo "$MAILTO" | grep -i '^attach=' | sed 
's/^attach=//i;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 
's/,$//'))

      if [ -z "$TO" ] ; then
          NEWMAILTO=


More information about the Portland mailing list