emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* direct link to mails in gmail
@ 2011-10-20  2:41 Torsten Wagner
  2011-10-20  7:06 ` Rainer M Krug
  0 siblings, 1 reply; 13+ messages in thread
From: Torsten Wagner @ 2011-10-20  2:41 UTC (permalink / raw)
  To: Org Mode Mailing List

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")

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20  2:41 direct link to mails in gmail Torsten Wagner
@ 2011-10-20  7:06 ` Rainer M Krug
  2011-10-20  7:30   ` Sebastien Vauban
  2011-10-20 13:41   ` Tom
  0 siblings, 2 replies; 13+ messages in thread
From: Rainer M Krug @ 2011-10-20  7:06 UTC (permalink / raw)
  To: Torsten Wagner; +Cc: Org Mode Mailing List

[-- Attachment #1: Type: text/plain, Size: 2894 bytes --]

On Thu, Oct 20, 2011 at 4:41 AM, Torsten Wagner <torsten.wagner@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<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@krugs.de

Skype:      RMkrug

[-- Attachment #2: Type: text/html, Size: 3686 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20  7:06 ` Rainer M Krug
@ 2011-10-20  7:30   ` Sebastien Vauban
  2011-10-20  7:33     ` Carsten Dominik
  2011-10-20  7:42     ` Rainer M Krug
  2011-10-20 13:41   ` Tom
  1 sibling, 2 replies; 13+ messages in thread
From: Sebastien Vauban @ 2011-10-20  7:30 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20  7:30   ` Sebastien Vauban
@ 2011-10-20  7:33     ` Carsten Dominik
  2011-10-20 13:54       ` Sebastien Vauban
  2011-10-20  7:42     ` Rainer M Krug
  1 sibling, 1 reply; 13+ messages in thread
From: Carsten Dominik @ 2011-10-20  7:33 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20  7:30   ` Sebastien Vauban
  2011-10-20  7:33     ` Carsten Dominik
@ 2011-10-20  7:42     ` Rainer M Krug
  2011-10-20 12:56       ` Otto Pichlhöfer
  1 sibling, 1 reply; 13+ messages in thread
From: Rainer M Krug @ 2011-10-20  7:42 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

On Thu, Oct 20, 2011 at 9:30 AM, Sebastien Vauban <
wxhgmqzgwmuf@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@krugs.de

Skype:      RMkrug

[-- Attachment #2: Type: text/html, Size: 2215 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20  7:42     ` Rainer M Krug
@ 2011-10-20 12:56       ` Otto Pichlhöfer
  0 siblings, 0 replies; 13+ messages in thread
From: Otto Pichlhöfer @ 2011-10-20 12:56 UTC (permalink / raw)
  To: emacs-orgmode

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, 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20  7:06 ` Rainer M Krug
  2011-10-20  7:30   ` Sebastien Vauban
@ 2011-10-20 13:41   ` Tom
  2011-10-22  6:48     ` Niels Giesen
  1 sibling, 1 reply; 13+ messages in thread
From: Tom @ 2011-10-20 13:41 UTC (permalink / raw)
  To: emacs-orgmode

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>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20  7:33     ` Carsten Dominik
@ 2011-10-20 13:54       ` Sebastien Vauban
  0 siblings, 0 replies; 13+ messages in thread
From: Sebastien Vauban @ 2011-10-20 13:54 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-20 13:41   ` Tom
@ 2011-10-22  6:48     ` Niels Giesen
  2011-10-22 10:01       ` suvayu ali
  0 siblings, 1 reply; 13+ messages in thread
From: Niels Giesen @ 2011-10-22  6:48 UTC (permalink / raw)
  To: Tom; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

>
> 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:

#+LINK: gmail https://mail.google.com/mail/?shva=1#all/

[[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

[-- Attachment #2: Type: text/html, Size: 1102 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-22  6:48     ` Niels Giesen
@ 2011-10-22 10:01       ` suvayu ali
  2011-10-22 11:43         ` Niels Giesen
  0 siblings, 1 reply; 13+ messages in thread
From: suvayu ali @ 2011-10-22 10:01 UTC (permalink / raw)
  To: Niels Giesen; +Cc: emacs-orgmode, Tom

On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen@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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-22 10:01       ` suvayu ali
@ 2011-10-22 11:43         ` Niels Giesen
  2011-10-22 11:57           ` suvayu ali
  0 siblings, 1 reply; 13+ messages in thread
From: Niels Giesen @ 2011-10-22 11:43 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode, Tom

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

> On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen@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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-22 11:43         ` Niels Giesen
@ 2011-10-22 11:57           ` suvayu ali
  2011-10-22 12:36             ` Niels Giesen
  0 siblings, 1 reply; 13+ messages in thread
From: suvayu ali @ 2011-10-22 11:57 UTC (permalink / raw)
  To: Niels Giesen; +Cc: emacs-orgmode, Tom

On Sat, Oct 22, 2011 at 13:43, Niels Giesen <niels.giesen@gmail.com> wrote:
> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>
>> On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen@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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: direct link to mails in gmail
  2011-10-22 11:57           ` suvayu ali
@ 2011-10-22 12:36             ` Niels Giesen
  0 siblings, 0 replies; 13+ messages in thread
From: Niels Giesen @ 2011-10-22 12:36 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode, Tom

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

> On Sat, Oct 22, 2011 at 13:43, Niels Giesen <niels.giesen@gmail.com> wrote:
>> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>>
>>> On Sat, Oct 22, 2011 at 8:48 AM, Niels Giesen <niels.giesen@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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-10-22 12:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-20  2:41 direct link to mails in gmail Torsten Wagner
2011-10-20  7:06 ` Rainer M Krug
2011-10-20  7:30   ` Sebastien Vauban
2011-10-20  7:33     ` Carsten Dominik
2011-10-20 13:54       ` Sebastien Vauban
2011-10-20  7:42     ` Rainer M Krug
2011-10-20 12:56       ` Otto Pichlhöfer
2011-10-20 13:41   ` Tom
2011-10-22  6:48     ` Niels Giesen
2011-10-22 10:01       ` suvayu ali
2011-10-22 11:43         ` Niels Giesen
2011-10-22 11:57           ` suvayu ali
2011-10-22 12:36             ` Niels Giesen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).