Feature request -> mailto: link subject parsing

140 views
Skip to first unread message

Brian Wang

unread,
Nov 8, 2012, 7:48:10 AM11/8/12
to k-9-...@googlegroups.com
Is it possible to add a feature to parse the Subject/Body parameters when the mailto link is clicked on, and fill in the Subject/Body field with the parsed value in the new message screen?

See below example :

mailto:XX...@YYY.COM?Subject=SUBJECTEXAMPLE&Body=BODYTEXT

After the above mailto link is clicked, the new message screen should have subject filled with "SUBJECTEXAMPLE" and message body with "BODYTEXT" in them.

Currently, this works in Thunderbird and iPad/iPhone's mail clients.  But it appears K-9 does not support this.  We actually need this feature for our organization's mail workflow solution.


-Brian

cketti

unread,
Nov 8, 2012, 11:58:44 AM11/8/12
to k-9-...@googlegroups.com
This should work. It is possible that the method we use to decode the
mailto URI treats parameters case sensitive. Try
mailto:te...@example.com?subject=your%20subject&body=some%20text%20here

Brian Wang

unread,
Nov 8, 2012, 8:18:57 PM11/8/12
to k-9-...@googlegroups.com, cke...@googlemail.com
Thank you for all the help!  Yes, it does work now after changing our mail workflow script to use all lowercase on Subject/Body parameters.

Perhaps, this could be case insensitive in the future?  We are able to modify our server scripts, but for all the website mailto links in the wild, this issue still exists.


-Brian

cketti

unread,
Nov 9, 2012, 8:32:12 AM11/9/12
to Brian Wang, k-9-...@googlegroups.com
On 09.11.2012 02:18, Brian Wang wrote:
> Thank you for all the help! Yes, it does work now after changing our
> mail workflow script to use all lowercase on Subject/Body parameters.
>
> Perhaps, this could be case insensitive in the future? We are able to
> modify our server scripts, but for all the website mailto links in the
> wild, this issue still exists.
>

There's no fast way to make that change, because the API we use handles
query parameters case-sensitive. I believe both Gmail and Email have the
same problem.

This issue is not very important to me, so I won't work on this anytime
soon. If anyone else wants to give it a try: the relevant method is
MessageCompose.initializeFromMailto():
https://github.com/k9mail/k-9/blob/master/src/com/fsck/k9/activity/MessageCompose.java#L3244

I'd be happy to review a patch for this.

Mouse

unread,
Nov 9, 2012, 8:39:53 AM11/9/12
to k-9-...@googlegroups.com
I would keep it case-sensitive. Applications that need insensitivity are welcome to do toLowerCase() or such before calling API. Just document it nicely.

My $0.02.
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

cketti

unread,
Nov 9, 2012, 8:48:57 AM11/9/12
to k-9-...@googlegroups.com
On 09.11.2012 14:39, Mouse wrote:
> I would keep it case-sensitive. Applications that need insensitivity are welcome to do toLowerCase() or such before calling API. Just document it nicely.
>
> My $0.02.

mailto-URIs are a documented in RFC 6068. I quote:

"<hfname> is case-insensitive, but <hfvalue> in general is case-sensitive"

<hfname> is e.g. the "body" in mailto:us...@example.com?body=some%20text

Veres-Szentkiralyi Andras

unread,
Nov 12, 2012, 10:48:07 AM11/12/12
to k-9-...@googlegroups.com
2012. november 9. péntek 14:32:12 dátummal cketti ezt írta:
> I'd be happy to review a patch for this.

Challenge accepted: https://github.com/k9mail/k-9/pull/205
--
Regards,
András Veres-Szentkirályi
Reply all
Reply to author
Forward
0 new messages