emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] sending an email to an orgmode file?


From: Karl Voit
Subject: Re: [O] sending an email to an orgmode file?
Date: Thu, 22 Dec 2016 11:21:13 +0100
User-agent: slrn/pre1.0.0-18 (Linux)

In case you do have access to your mail server:

* Xebar Saram <address@hidden> 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): address@hidden
| {
|     :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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]