ideas for rfc2557 / MHTML support in kmail

Marc Mutz mutz at kde.org
Thu Jun 27 19:39:10 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I've thought this to and fro and finally, I have an idea on how to 
implement this cleanly, though some help from khtml would still be 
needed

The problem:
The problem is that a multipart/related body part can contain
1. cid/mid protocol URLs, which would result in "protocol not found" 
   errors
2. any other URL, whose pointed-to data may nonetheless be included in 
   the mp/rel part. In this case, khtml will either load the resource 
   from the net or not at all, depending on whether non-local resource 
   loading is enabled or not.
and that there are slightly
3. differing relative URL semantics for documents without <BASE> tag.

The solutions:
ad 1:
KMail keeps a list of encountered cid (mid refers to whole messages) 
URLs from
  Content-ID: foo
and
  Content-Location: CID:foo
headers.
Provide a kio_cid slave that queries this list (and the data in case of 
a match) from KMail through a dcop interface.
When khtml encounters a cid URL it will try to invoke the corresponding 
kio slave and if KMail runs and knows the CID, then the kio_cid slave 
will be able to fulfill the request, otherwise it will return an error.

This should be possible with the current versions of khtml and 
slavebase.

ad 2:
For this, khtml has to provide a facility to re-route urls requests, 
e.g. by emitting a signal translateUrl( QString & url ) or something 
like that, so that KMail can intercept the normal route of URL request 
resolution and point khtml to another resource (e.g. a local file where 
KMail has saved the corresponding body part).

If (1) is already in place, we can rename kio_cid to kio_kmail and let 
it handle x-kmail-*:, thismessage: and cid: protocols and KMail would 
use (2) to re-route all known non-cid URLs to 
x-kmail-<original-protocol>.

ad 3:
For this, khtml would either need to optionally delegate the 
relative-url to absolute-url resolving to KMail or provide a way to set 
the base url in case the document itself doesn't provide one.

Marc

- -- 
Marc Mutz <mutz at kde.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9G1vW3oWD+L2/6DgRAqCtAJ9Akb+6eHP0eVMYodKwDnT0i+7SigCg45Lp
66vMwcAmxKIQircstmHJkcE=
=lLSt
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list