emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Karl Voit <devnull@Karl-Voit.at>
To: emacs-orgmode@gnu.org
Subject: Re: sending an email to an orgmode file?
Date: Thu, 22 Dec 2016 11:21:13 +0100	[thread overview]
Message-ID: <2016-12-22T11-12-06@devnull.Karl-Voit.at> (raw)
In-Reply-To: CAOQHXPrwkYhEfQTc=OZMS9UfVSBwv=oeJ-cmVeJEjJUDFiC4Kw@mail.gmail.com

In case you do have access to your mail server:

* Xebar Saram <zeltakc@gmail.com> wrote:
>
> im looking for a simple solution that will allow me to send an email from
> my mobile phone and habr that email either be appended to a txt(org) file
> or perhaps another solution to get my mobile on the go notes onto my laptop
> orgmode file. i tried orgzly and mobile org but i would prefer a simple
> solution as to send an email

Since I do not use an Emacs-based mail setup, I created a workaround
by bouncing relevant emails to a special email address I use for
forwarding emails to Org-mode. I am maintaining my own email server
and I am using procmail[1] to filter/preprocess emails.

When an email is found to that specific email address the following
rule applies:

,----
| :0
| * ^(Resent-To|X-Original-To|To|Bcc|Cc): orgmode@MY-DOMAIN.AT
| {
|     :0
|     |/home/karl/src/vk-add-email-to-org.sh
| }
`----

With the script:

,----[ vk-add-email-to-org.sh ]
| #!/bin/sh
|
| ## generates an org-file-entry from the email sent through stdin
|
| ORGFILE="/home/karl/org/inbox.org"
|
| ## build email by adding input from stdin line by line:
| while IFS= read -r line
| do
| email="${email}
| ${line}"
| done
|
| subject=`echo "${email}"|formail -x "Subject"`
| header=`echo "${email}"|formail -X "From" -X "Subject" -X "Date" -X "Message-ID" -X "To"`
| body=`echo "${email}"| sed -e '1,/^$/ d'`
|
| echo "* TODO Email:"${subject} >> ${ORGFILE}
| echo >> ${ORGFILE}
| echo "#+BEGIN_QUOTE" >> ${ORGFILE}
| echo "${header}" >> ${ORGFILE}
| echo "#+END_QUOTE" >> ${ORGFILE}
| echo  >> ${ORGFILE}
`----

Refiling from my inbox.org is the same process as refiling my input from
MobileOrg.

HTH

[1] Please start with mailfilter instead if you do a fresh start.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

      parent reply	other threads:[~2016-12-22 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 10:36 sending an email to an orgmode file? Xebar Saram
2016-12-21 17:18 ` Richard Lawrence
     [not found] ` <20b6df15a79842e094d01fcc2ed2eda8@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-12-21 17:36   ` Eric S Fraga
2016-12-22 10:21 ` Karl Voit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2016-12-22T11-12-06@devnull.Karl-Voit.at \
    --to=devnull@karl-voit.at \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).