compose.php and HTML5's registerProtocolHandler

View: New views
4 Messages — Rating Filter:   Alert me  

compose.php and HTML5's registerProtocolHandler

by Michael A. Puls II :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I know that compose.php supports ?send_to=&subject=&body=&send_to_cc=&send_to_bcc=

However, is there support for doing it the following way?

http://squirrelmail_server.com/src/compose.php?url=mailto%3Ato%2540example.com%3Fsubject%3Dtest%2520subject%26body%3Dline1%250D%250Aline2%26cc%3Dcc%2540example.com%26bcc%3Dbcc%2540example.com

The reason I ask is that HTML5's registerProtocolHandler supports %s in its template string, which emits the data like that.

This is also how Firefox 3 makes "tools -> options -> applications -> mailto -> Use gmail" work.

For example with "https://mail.google.com/mail/?extsrc=mailto&url=%s" and a mailto URI of "mailto:to%40example.com?subject=test%20subject&body=line1%0D%0Aline2&cc=cc%40example.com&bcc=bcc%40example.com", you'd get "https://mail.google.com/mail/?extsrc=mailto&url=mailto%3Ato%2540example.com%3Fsubject%3Dtest%2520subject%26body%3Dline1%250D%250Aline2%26cc%3Dcc%2540example.com%26bcc%3Dbcc%2540example.com", which if you test, works great.

<https://developer.mozilla.org/en/DOM/window.navigator.registerProtocolHandler>
<http://www.whatwg.org/specs/web-apps/current-work/#dom-navigator-registerprotocolhandler>

If SM does not support this, is there any plan to?

Thanks

--
Michael



------------------------------------------------------------------------------
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel

Re: compose.php and HTML5's registerProtocolHandler

by Michael A. Puls II :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 04 Jan 2009 08:33:08 -0500, Michael A. Puls II <shadow2531@...> wrote:

> I know that compose.php supports  
> ?send_to=&subject=&body=&send_to_cc=&send_to_bcc=
>
> However, is there support for doing it the following way?
>
> http://squirrelmail_server.com/src/compose.php?url=mailto%3Ato%2540example.com%3Fsubject%3Dtest%2520subject%26body%3Dline1%250D%250Aline2%26cc%3Dcc%2540example.com%26bcc%3Dbcc%2540example.com

I see there's "mailto.php?emailaddress=", but it doesn't handle complicated mailto URI data very well or to my liking.

> The reason I ask is that HTML5's registerProtocolHandler supports %s in  
> its template string, which emits the data like that.
> This is also how Firefox 3 makes "tools -> options -> applications ->  
> mailto -> Use gmail" work.
>
> For example with "https://mail.google.com/mail/?extsrc=mailto&url=%s"  
> and a mailto URI of  
> "mailto:to%40example.com?subject=test%20subject&body=line1%0D%0Aline2&cc=cc%40example.com&bcc=bcc%40example.com",  
> you'd get  
> "https://mail.google.com/mail/?extsrc=mailto&url=mailto%3Ato%2540example.com%3Fsubject%3Dtest%2520subject%26body%3Dline1%250D%250Aline2%26cc%3Dcc%2540example.com%26bcc%3Dbcc%2540example.com",  
> which if you test, works great.
>
> <https://developer.mozilla.org/en/DOM/window.navigator.registerProtocolHandler>
> <http://www.whatwg.org/specs/web-apps/current-work/#dom-navigator-registerprotocolhandler>
>
> If SM does not support this, is there any plan to?
>
> Thanks
>
Attached is mailto_protocol_handler2.php. I used mailto.php as a reference.

It produces the exact results I want it to. There are just 2 problems.

1. How do I load compose.php in the right frame AND get compose.php to use ?send_to=&body= etc. like it does when not loaded in a frame?

2. When the user is not logged in, I want to redirect to login.php and retain the send_to=&body= etc. data after the user logs in.

mailto.php does these things, but it uses ?mailtodata=, which uses some funky data format that's percent-encoded, which compose.php decodes etc.

How do I make things work with "send_to=" etc. or how to I convert the to, cc, bcc, body and subject percent-encoded hvalues that I've built into something that ?mailtodata= understands?

If you look at mailto.php, I basically want to support the !$compose_only and $force_login features.

I'm doing this with 1.4.x

Thanks

On a side, when I have a signature set, SM inserts a blank line at the top of the body. How can I remove that?

--
Michael



------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel

mailto_protocol_handler2.php (5K) Download Attachment

Re: compose.php and HTML5's registerProtocolHandler

by Michael A. Puls II :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 10 Jan 2009 14:07:15 -0500, Michael A. Puls II <shadow2531@...> wrote:

> Attached is mailto_protocol_handler2.php. I used mailto.php as a  
> reference.
>
> It produces the exact results I want it to. There are just 2 problems.
>
> 1. How do I load compose.php in the right frame AND get compose.php to  
> use ?send_to=&body= etc. like it does when not loaded in a frame?
>
> 2. When the user is not logged in, I want to redirect to login.php and  
> retain the send_to=&body= etc. data after the user logs in.
>
> mailto.php does these things, but it uses ?mailtodata=, which uses some  
> funky data format that's percent-encoded, which compose.php decodes etc.
>
> How do I make things work with "send_to=" etc. or how to I convert the  
> to, cc, bcc, body and subject percent-encoded hvalues that I've built  
> into something that ?mailtodata= understands?
>
> If you look at mailto.php, I basically want to support the  
> !$compose_only and $force_login features.
>
> I'm doing this with 1.4.x
I figured it out. ?mailtodata= just wants a percent-encoded serialized array of the to, cc, bcc, subject and body values(decoded).

Attached is with everything working. It works much better with the mailto link at <http://shadow2531.com/opera/testcases/mailto/modern_mailto_uri_scheme.html#test> than mailto.php does.

--
Michael



------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel

mailto_protocol_handler2.php (6K) Download Attachment

Re: compose.php and HTML5's registerProtocolHandler

by Michael A. Puls II :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<http://www.nabble.com/Re%3A-compose.php-and-HTML5's-registerProtocolHandler-p21401609.html>

I uploaded the file to <http://shadow2531.com/sm/mailto_protocol_handler.zip> just in case anyone else want's to use it.

--
Michael




------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel