From: Stefano Zacchiroli Date: Sun, 17 Feb 2013 16:59:02 +0000 (+0100) Subject: check-in remember-mail X-Git-Url: https://projects.mako.cc/source/org-mutt/commitdiff_plain/d07b2b16a5adb824a99c516f95dbf10b284d8548?hp=782a16e2d0f07b9cac1dd24552d45363a9c75008 check-in remember-mail --- diff --git a/remember-mail b/remember-mail new file mode 100755 index 0000000..9e13e75 --- /dev/null +++ b/remember-mail @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w +# +# Helper for mutt to remember mails in Emacs' Org mode +# +# Copyright: © 2009-2010 Stefano Zacchiroli +# License: GNU General Public License (GPL), version 3 or above +# +# Example of mutt macro to invoke this hitting ESC-R (to be put in ~/.muttrc): +# macro index \eR "|~/bin/remember-mail\n" + +use strict; +use Mail::Internet; +use URI::Escape; + +my $msg = Mail::Internet->new(\*STDIN); +$msg->head->get('message-id') =~ /^<(.*)>$/; +my $mid = $1; +my $subject = $msg->head->get('subject') || ""; +my $from = $msg->head->get('from') || ""; +chomp ($subject, $from); +my $note_body = uri_escape(" Subject: $subject\n From: $from"); + +exec "emacsclient", "-t", "org-protocol:/remember:/m/mutt:$mid/mail/$note_body";