Torsten Wagner | 20 Oct 04:41 2011
Picon

direct link to mails in gmail

Hi,
I just figured out some kind of very interesting possibility.
All the personal data and security feelings aside, I use a gmail account 
since I share it between many different computers.

In my org-files, I would sometimes like to link to a particular mail 
e.g., for reference purpose.
Today I noticed that each email in my google mail account has a unique 
and fixed URL.
Thus, I gave it a try

1. Open your gmail account (log-in)
2. Open the mail you like to refer too.
3. Copy the URL
4. Add the URL as a link (C-c C-l) to your org-file

After that, clicking on the link will open the mail directly in your 
standard webbrowser. If you logged out from google mail in between, you 
are ask to log-in first, after that select the link again.

But it is getting even better. You are not only able to link to 
particular mails within org-mode, but also to google mail labels 
(folders) or search results.

To make it even more org-mode friendly one can set-up org-capture in 
your webbrowser [1].

I added the following to the org-capture-templates list
("g" "Gmail-link" entry (file+headline "~/org/work.org" "Gmail-links") "%A")

(Continue reading)

Rainer M Krug | 20 Oct 09:06 2011
Picon

Re: direct link to mails in gmail



On Thu, Oct 20, 2011 at 4:41 AM, Torsten Wagner <torsten.wagner <at> gmail.com> wrote:
Hi,
I just figured out some kind of very interesting possibility.
All the personal data and security feelings aside, I use a gmail account since I share it between many different computers.

In my org-files, I would sometimes like to link to a particular mail e.g., for reference purpose.
Today I noticed that each email in my google mail account has a unique and fixed URL.
Thus, I gave it a try

1. Open your gmail account (log-in)
2. Open the mail you like to refer too.
3. Copy the URL
4. Add the URL as a link (C-c C-l) to your org-file

After that, clicking on the link will open the mail directly in your standard webbrowser. If you logged out from google mail in between, you are ask to log-in first, after that select the link again.


That is really nice - and I used it to link to gmail emails from rtm - but there is one thing youi should be aware of: the link is only valid, if the mail keeps the label. As an example: If I copy the link from the inbox, paste it into an org file, and *then* archive the mail, the link is, to my knowledge, not valid any more, as it contains the label in it.

So: it works, but it is essential to copy either the link when the label is selected which will be permanent, or, saver, copy the url in the All Mail folder.

Cheers and thanks for the tip,

Rainer

 
But it is getting even better. You are not only able to link to particular mails within org-mode, but also to google mail labels (folders) or search results.

To make it even more org-mode friendly one can set-up org-capture in your webbrowser [1].

I added the following to the org-capture-templates list
("g" "Gmail-link" entry (file+headline "~/org/work.org" "Gmail-links") "%A")

Thus, pressing the assigned button in your browser and emacs will ask you what kind of link you want to add to your file. Press g for gmail and enter the description for the link (this could be done automatically, but I find it to long and not helpful). You will find the link in your capture buffer in emacs for further processing

I really like it and I hope others find this useful too.
Not sure about the safety issue to link to URLs within your gmail account. Maybe others can comment on this.

All the best

Totti


[1] http://orgmode.org/worg/org-contrib/org-protocol.html









--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer <at> krugs.de

Skype:      RMkrug

Sebastien Vauban | 20 Oct 09:30 2011

Re: direct link to mails in gmail

Hi,

Rainer M Krug wrote:
> That is really nice - and I used it to link to gmail emails from rtm - but
> there is one thing youi should be aware of: the link is only valid, if the
> mail keeps the label. As an example: If I copy the link from the inbox,
> paste it into an org file, and *then* archive the mail, the link is, to my
> knowledge, not valid any more, as it contains the label in it.

Sad to say it is also true with Gnus: if you move the mail from one folder to
another, the link is not valid anymore...

I'd dream being able to even get "shareable" links: be able to make a valid
reference to a mail we received on a mailing list, and that this reference
would be not only valid for me, but (at least) for my colleagues using Gnus as
well...

Best regards,
  Seb

--

-- 
Sebastien Vauban

Carsten Dominik | 20 Oct 09:33 2011
Picon

Re: direct link to mails in gmail

On the mac, you can create links using the message-id (this is used in org-mac-message.el) - I would be
surprised if GMail did not have a way to find a message with a specific id...?

- Carsten

On Oct 20, 2011, at 9:30 AM, Sebastien Vauban wrote:

> Hi,
> 
> Rainer M Krug wrote:
>> That is really nice - and I used it to link to gmail emails from rtm - but
>> there is one thing youi should be aware of: the link is only valid, if the
>> mail keeps the label. As an example: If I copy the link from the inbox,
>> paste it into an org file, and *then* archive the mail, the link is, to my
>> knowledge, not valid any more, as it contains the label in it.
> 
> Sad to say it is also true with Gnus: if you move the mail from one folder to
> another, the link is not valid anymore...
> 
> I'd dream being able to even get "shareable" links: be able to make a valid
> reference to a mail we received on a mailing list, and that this reference
> would be not only valid for me, but (at least) for my colleagues using Gnus as
> well...
> 
> Best regards,
>  Seb
> 
> -- 
> Sebastien Vauban
> 
> 

- Carsten

Sebastien Vauban | 20 Oct 15:54 2011

Re: direct link to mails in gmail

Hi Carsten,

Carsten Dominik wrote:
> On Oct 20, 2011, at 9:30 AM, Sebastien Vauban wrote:
>> Sad to say it is also true with Gnus: if you move the mail from one folder
>> to another, the link is not valid anymore...
>>
>> I'd dream being able to even get "shareable" links: be able to make a valid
>> reference to a mail we received on a mailing list, and that this reference
>> would be not only valid for me, but (at least) for my colleagues using Gnus
>> as well...
>
> On the mac, you can create links using the message-id (this is used in
> org-mac-message.el) - I would be surprised if GMail did not have a way to
> find a message with a specific id...?

"Unluckily", I wasn't speaking of GMail mails, but of mails on our company
mail server (Courrier).

Best regards,
  Seb

--

-- 
Sebastien Vauban

Rainer M Krug | 20 Oct 09:42 2011
Picon

Re: direct link to mails in gmail



On Thu, Oct 20, 2011 at 9:30 AM, Sebastien Vauban <wxhgmqzgwmuf <at> spammotel.com> wrote:
Hi,

Rainer M Krug wrote:
> That is really nice - and I used it to link to gmail emails from rtm - but
> there is one thing youi should be aware of: the link is only valid, if the
> mail keeps the label. As an example: If I copy the link from the inbox,
> paste it into an org file, and *then* archive the mail, the link is, to my
> knowledge, not valid any more, as it contains the label in it.

Sad to say it is also true with Gnus: if you move the mail from one folder to
another, the link is not valid anymore...

I'd dream being able to even get "shareable" links: be able to make a valid
reference to a mail we received on a mailing list, and that this reference
would be not only valid for me, but (at least) for my colleagues using Gnus as
well...


Under gmail, you can open the mail under "All Mail", which then is a ink independent of the label. But it would be nice, to have access to that link more easily.

Cheers,

Rainer

 
Best regards,
 Seb

--
Sebastien Vauban





--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer <at> krugs.de

Skype:      RMkrug

Otto Pichlhöfer | 20 Oct 14:56 2011
Picon

Re: direct link to mails in gmail

As a workaround I use the following setup:

;; === org link abbreviations ===
(setq org-link-abbrev-alist
      '(("mail" . "https://mail.google.com/a/mydomain.at/#mbox/%s")
        ))

When I want to link to a mail message in Gmail I click twice into the address
line of firefox which conveniently selects the last part of the url (like
1331c8de4ddc74ed) which is kind of a message ID. Then I go to Emacs and copy and
paste this ID into my mail link.

Regards, 

Tom | 20 Oct 15:41 2011
Picon

Re: direct link to mails in gmail

Rainer M Krug <r.m.krug <at> gmail.com> writes:

>  That is really nice - and I used it to link to gmail emails
> from rtm - but there is one thing youi should be aware of: the
> link is only valid, if the mail keeps the label. As an example:
> If I copy the link from the inbox, paste it into an org file,
> and *then* archive the mail, the link is, to my knowledge, not
> valid any more, as it contains the label in it. So: it works,
> but it is essential to copy either the link when the label is
> selected which will be permanent, or, saver, copy the url in
> the All Mail folder.Cheers and thanks for the tip,Rainer  

Since any mail can be found under the All label by definition the
simplest solution is extracting the message id from the end of
the current url and then creating a new url pointing to All. 
This URL should always work unless the mail is deleted:

https://mail.google.com/mail/?shva=1#all/<msgid>

Niels Giesen | 22 Oct 08:48 2011
Picon

Re: direct link to mails in gmail

Since any mail can be found under the All label by definition the
simplest solution is extracting the message id from the end of
the current url and then creating a new url pointing to All.
This URL should always work unless the mail is deleted:

https://mail.google.com/mail/?shva=1#all/<msgid>


So this would work too:


[[gmail:1331f3490dff1205][conversation about gmail links]]

Too bad I have set up Emacs to use emacs-w3m, in which this does not work -- probably the hash part is handled by client-side JavaScript.


--
http://pft.github.com
suvayu ali | 22 Oct 12:01 2011
Picon

Re: direct link to mails in gmail

On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen <at> gmail.com> wrote:
> Too bad I have set up Emacs to use emacs-w3m, in which this does not work --
> probably the hash part is handled by client-side JavaScript.

You can try this:

https://mail.google.com/mail/h/

--

-- 
Suvayu

Open source is the future. It sets us free.

Niels Giesen | 22 Oct 13:43 2011
Picon

Re: direct link to mails in gmail

suvayu ali <fatkasuvayu+linux <at> gmail.com> writes:

> On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen <at> gmail.com> wrote:
>> Too bad I have set up Emacs to use emacs-w3m, in which this does not work --
>> probably the hash part is handled by client-side JavaScript.
>
> You can try this:
>
> https://mail.google.com/mail/h/

That link simply visits the HTML-version of gmail, but does not let one
select an article via the URL - as far as I know.

--

-- 
http://pft.github.com/

suvayu ali | 22 Oct 13:57 2011
Picon

Re: direct link to mails in gmail

On Sat, Oct 22, 2011 at 13:43, Niels Giesen <niels.giesen <at> gmail.com> wrote:
> suvayu ali <fatkasuvayu+linux <at> gmail.com> writes:
>
>> On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen <at> gmail.com> wrote:
>>> Too bad I have set up Emacs to use emacs-w3m, in which this does not work --
>>> probably the hash part is handled by client-side JavaScript.
>>
>> You can try this:
>>
>> https://mail.google.com/mail/h/
>
> That link simply visits the HTML-version of gmail, but does not let one
> select an article via the URL - as far as I know.
>

In that case you can try the "Message text garbled?" or "Show original" link.

Hope that helps.

--

-- 
Suvayu

Open source is the future. It sets us free.

Niels Giesen | 22 Oct 14:36 2011
Picon

Re: direct link to mails in gmail

suvayu ali <fatkasuvayu+linux <at> gmail.com> writes:

> On Sat, Oct 22, 2011 at 13:43, Niels Giesen <niels.giesen <at> gmail.com> wrote:
>> suvayu ali <fatkasuvayu+linux <at> gmail.com> writes:
>>
>>> On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen <at> gmail.com> wrote:
>>>> Too bad I have set up Emacs to use emacs-w3m, in which this does not work --
>>>> probably the hash part is handled by client-side JavaScript.
>>>
>>> You can try this:
>>>
>>> https://mail.google.com/mail/h/
>>
>> That link simply visits the HTML-version of gmail, but does not let one
>> select an article via the URL - as far as I know.
>>
>
> In that case you can try the "Message text garbled?" or "Show original" link.

Ok. This one seems to do the trick to show the original of a single
message:

https://mail.google.com/mail/h/?&v=om&th=MESSAGE-ID

And this one can be used for conversation view:

https://mail.google.com/mail/h/?&v=c&s=l&th=MESSAGE-ID

It seems v=c means view=conversation. But this is not enough by and of
itself, s=l is necessary too, whatever that means. Left out, your Inbox
will be presented.

Summing up, if you want to visit gmails articles without using
JavaScript, you may use this:

#+LINK: gmail https://mail.google.com/mail/h/?&v=c&s=l&th=
for HTML-only browsers/settings or
#+LINK: gmail https://mail.google.com/mail/?shva=1#all/
for JS-enabled browsers

or something like

#+begin_src emacs-lisp
  (org-add-link-type
   "gmail"
   (lambda (link)
     (browse-url
      ;; or "https://mail.google.com/mail/?shva=1#all/" for js-browser
      (concat "https://mail.google.com/mail/h/?&v=c&s=l&th=" link))))
#+end_src

to have the link type globally.

Then use this in an Org file:

[[gmail:1331f3490dff1205][conversation about gmail links]]

This way, if Google decides to change it's url structure, all you have
to do is redefine your link type, instead of all email links.

> Hope that helps.

--

-- 
http://pft.github.com/


Gmane