Link to IMAP URL Scheme?
Asked Answered
V

1

12

There is a RFC for IMAP URL Scheme: https://www.rfc-editor.org/rfc/rfc5092

Creating a link which matches the scheme in HTML is easy.

How can I make a link like this work in web clients?

<a href="imap://psicorp.example.org/~peter/..">Peter's mail</a>

Use case

An intranet application should be enabled to link to mails which are stored in a local IMAP server.

Verbalism answered 7/8, 2015 at 8:10 Comment(7)
Web browsers aren't required to implement any particular set of URL schemes. Each URL scheme is defined for the utility of someone, but that someone does not have to include web browsers. (You may also have heard about the recently defined vnc://... scheme, but web browsers aren't rushing to integrate VNC clients.)Shelah
OK, standard web browsers don't support IMAP links. That's ok. But if I want it to work in my browser: How can I get this done?Verbalism
Uh, you can register the imap:// protocol at the system level to potentially launch some sort of mail software, if it understands imap:// links.Reprisal
Can you give a little more information about your use case? I think curl can do basic imap urls.Reprisal
@max I added a use case to the question: An intranet application should be enabled to link to mails which are stored in a local IMAP server.Verbalism
Related: registering URI schemes on Windows.Merriott
@GrahamLeggett no, I never solved that. AFAIK this is not possibleVerbalism
O
0

Links like this are evaluated client-side. It is up to the Web browser to interpret the URL.

What you need to have client side is an IMAP client that can be "fed" the URL, and a Web browser that you can control.

In the Web browser, you need to add the URL scheme imap if it is not already there (your IMAP client may have already put it there). For instance, in Firefox, you go to Preferences, Applications.

In Windows and Internet Explorer, this is actually a systemwide setting, not just within the browser. I am not sure if Google Chrome, Firefox or Microsoft Edge also use these systemwide settings. My guess is that Chrome does, but Firefox does not. No idea about Edge.

See also the link provided by approxiblue in an earlier comment.

That said, I'm not sure how useful IMAP URLs would be in the first place. They might help (slightly) to set up an IMAP client, but that is a one-time thing.

If I understand your use case correctly, you want to fetch an email from an IMAP server and display it in the context of your Web page? In that case, you should retrieve the email server side, and display it as plain HTML. If your Web site is written in PHP, you may want to look at the php imap class (see http://php.net/manual/en/book.imap.php for details). Other languages will have similar libraries.

If you really want to link to a user's mailbox, maybe a better option than trying to control the client-side IMAP access would be to link to an IMAP Web client, such as Horde or RoundCube.

Of course, I may have misunderstood the intent of your use case.

Oswin answered 18/8, 2015 at 6:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.