Hi, I would like to capture outgoing e-mail in my org file. I use the gcc mechanism in gnus with a nnml backend. I think I have read on the org mailing list that someone has implemented that feature. I did a search but could not find the article. I tried implementing it myself. I had a look at the function gnus-inews-do-gcc. It has the group and the article number. However org link expect the Message-ID header. How do I get it? Thanks, Ivan -- Software uses US measurements, but the OS is in metric... -- BOFH excuse #24
Hi Ivan, this is what I use : ======================================================================== ;; Hack to store Org links upon sending Gnus messages (defun bzg-message-send-and-org-gnus-store-link (&optional arg) "Send message with `message-send-and-exit' and store org link to message copy. If multiple groups appear in the Gcc header, the link refers to the copy in the last group." (interactive "P") (save-excursion (save-restriction (message-narrow-to-headers) (let ((gcc (car (last (message-unquote-tokens (message-tokenize-header (mail-fetch-field "gcc" nil t) " ,"))))) (buf (current-buffer)) (message-kill-buffer-on-exit nil) id to from subject desc link newsgroup xarchive) (message-send-and-exit arg) (or ;; gcc group found ... (and gcc (save-current-buffer (progn (set-buffer buf) (setq id (org-remove-angle-brackets (mail-fetch-field "Message-ID"))) (setq to (mail-fetch-field "To")) (setq from (mail-fetch-field "From")) (setq subject (mail-fetch-field "Subject")))) (org-store-link-props :type "gnus" :from from :subject subject :message-id id :group gcc :to to) (setq desc (org-email-link-description)) (setq link (org-gnus-article-link gcc newsgroup id xarchive)) (setq org-stored-links (cons (list link desc) org-stored-links))) ;; no gcc group found ... (message "Can not create Org link: No Gcc header found.")))))) (define-key message-mode-map [(control c) (control meta c)] 'bzg-message-send-and-org-gnus-store-link) ======================================================================== Then, in a message, I use C-c C-M-c instead of C-c C-c to send the message and create a link to it that I can reinsert later one. This is not really capturing, but it's good enough for my needs. HTH, -- Bastien
Ivan Kanis <ivan@kanis.fr> writes: > Hi, > > I would like to capture outgoing e-mail in my org file. > > I use the gcc mechanism in gnus with a nnml backend. > > I think I have read on the org mailing list that someone has implemented > that feature. I did a search but could not find the article. > > I tried implementing it myself. I had a look at the function > gnus-inews-do-gcc. It has the group and the article number. However org > link expect the Message-ID header. How do I get it? > > Thanks, > > Ivan Hi Ivan, That's something that Gnorb[1] can do. Make a capture template that you want to use for outgoing mail TODOs, and identify it: (setq gnorb-gnus-new-todo-capture-key "O") Then, while you're composing the email, call `gnorb-gnus-outgoing-do-todo' in the message buffer, which I have bound to "C-c t". You can also call it *after* sending the message, if you forgot, and it will initiate the same process from the last sent message. It works best when you're using Gcc, as that means Org is able to make a real link to the sent message. Gnorb will try to fake it, if you're not. If you set (setq gnorb-gnus-hint-relevant-article t), Gnorb will even notify you when you get a reply to your sent message. It's early days for Gnorb, but this part of it works well for me. I'd love a little more road-testing, if you're interested! I'm going to stick it in ELPA in a month or so, but for now: [1]: https://github.com/girzel/gnorb Hope it helps! E
I love it Thanks Cheers, M Sent from my iPhone ** May contain typos**
Eric Abrahamsen <eric@ericabrahamsen.net> writes: > [1]: https://github.com/girzel/gnorb "Some way to create a TODO for an outgoing mail, saying 'this mail needs a response, check in N days to see if we’ve got one.'" That's really cool and I've been looking for ages for something like that;) -- Esben Stien is b0ef@e s a http://www. s t n m irc://irc. b - i . e/%23contact sip:b0ef@ e e jid:b0ef@ n n
Esben Stien <b0ef@esben-stien.name> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> [1]: https://github.com/girzel/gnorb
>
> "Some way to create a TODO for an outgoing mail, saying 'this mail needs
> a response, check in N days to see if we’ve got one.'"
>
> That's really cool and I've been looking for ages for something like that;)
Give it a shot! gnorb-gnus-outgoing-do-todo, and then schedule the
resulting capture heading.
Hope it works for you,
E
On Sat, 14 Jun 2014 10:32:49 +0200 Ivan Kanis <ivan@kanis.fr> wrote: IK> I would like to capture outgoing e-mail in my org file. IK> I use the gcc mechanism in gnus with a nnml backend. IK> I think I have read on the org mailing list that someone has implemented IK> that feature. I did a search but could not find the article. IK> I tried implementing it myself. I had a look at the function IK> gnus-inews-do-gcc. It has the group and the article number. However org IK> link expect the Message-ID header. How do I get it? Well, I use the following to maintain a diary file. It's probably equally easy to use a Org file: (defun message-to-diary () (make-diary-entry (concat (format-time-string "%B %d, %Y %H:%M" (gnus-date-get-time (message-fetch-field "date"))) (if (message-fetch-field "newsgroups") (concat " Sent news To: " (message-fetch-field "newsgroups")) (concat " Sent mail To: " (message-fetch-field "to"))) " Subject: \"" (message-fetch-field "subject") "\"" " Message-ID: " (message-fetch-field "message-id"))) (save-buffer "diary")) (add-hook 'message-sent-hook 'message-to-diary) HTH Ted
[-- Attachment #1: Type: text/plain, Size: 995 bytes --] >> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes: Hello I just saw your code. > Well, I use the following to maintain a diary file. It's probably > equally easy to use a Org file: > (defun message-to-diary () > (make-diary-entry (concat > (format-time-string "%B %d, %Y %H:%M" (gnus-date-get-time (message-fetch-field "date"))) > (if (message-fetch-field "newsgroups") > (concat " Sent news To: " (message-fetch-field "newsgroups")) > (concat " Sent mail To: " (message-fetch-field "to"))) > " Subject: \"" (message-fetch-field "subject") "\"" > " Message-ID: " (message-fetch-field "message-id"))) > (save-buffer "diary")) > (add-hook 'message-sent-hook 'message-to-diary) I cannot see the relevant group entry. So how are you supposed to jump from the diary to the message. Uwe Brauer [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5556 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1036 bytes --] >> "Bastien" == Bastien <bzg@gnu.org> writes: Hi Bastien I just saw your code > Hi Ivan, > this is what I use : > ======================================================================== > ;; Hack to store Org links upon sending Gnus messages > (defun bzg-message-send-and-org-gnus-store-link (&optional arg) > (define-key message-mode-map [(control c) (control meta c)] > 'bzg-message-send-and-org-gnus-store-link) > ======================================================================== > Then, in a message, I use C-c C-M-c instead of C-c C-c to send the > message and create a link to it that I can reinsert later one. This > is not really capturing, but it's good enough for my needs. I tried it out and it is nice, the only thing which is missing is to insert automatically the link into an org file or the diary if you want. When I call org-insert-link an interactive query started which is nice but in this case time consuming regards Uwe Brauer [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5556 bytes --]