emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: news1142@Karl-Voit.at, Karl Voit <devnull@Karl-Voit.at>
Cc: emacs-orgmode@gnu.org
Subject: Re: Email -> Org-mode: charset problem
Date: Mon, 27 Jun 2011 22:04:17 +0200	[thread overview]
Message-ID: <87fwmvghxa.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <2011-06-27T10-18-00@devnull.Karl-Voit.at>

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

At Mon, 27 Jun 2011 10:30:06 +0200,
Karl Voit wrote:
> 
> Hi!
> 
> Is there somebody who managed to develop an email to Org-mode bridge
> without having charset problems? (No, I do not use Emacs as a
> MUA[4])
> 
>     Disclaimer: This is not directly related to Org-mode but I guess
>     there are people here with the very same problem.
> 
> I am using a procmail[1] with an entry to forward emails containing
> a keyword in the subject into my inbox.org (where also MobileOrg[2]
> entries are written to).
> 
> This is quite handy since some tasks arrive at emails and I want to
> capture this everywhere (smartphone, webmail, ...) using a simply
> email forward.
> 
> Unfortunately I get weird stuff like uuencoded things, UTF-8 in
> ASCII, ... which messes up my inbox.org and I am not able to read it
> afterwards.[5]
> 
> I guess this is because procmail and formail[3] – the tools I am
> using to extract mail infos to append to the org-file – are
> 7-bit-only or similar.
>
> If this is the case, I guess I'll have to find a different approach
> for this purpose.
> 
> Any ideas?


As far as I know a lot, if not most, email messages are transfered in
7bit for backward compatibility reasons and getting things other than
text/plain; charset=us-ascii across the net via email requires a lot
of things to consider (RFC2045-49 in all their glory). And if you
receive message from others, their mua might get things wrong and you
end up with things like utf-8 in ascii.

So dumping the raw message won't help, you need functions for
processing the raw message informaton.

Here's an idea (or two).

I do use an Emacs base mua (Wanderlust) and recently started to file
reference notes for certain messages. Because in cases I want to keept
the message (e.g. an interesting usenet post) I save the raw message
to a temporary file and add it as an attachment. This works nice,
although I'd really like to have an automated way of save+attache when
capturing.

So, what about org-capture? You could use a script that serializes the
raw message to disk and -- somehow -- calls capture with a reference
to this file. Emacs opens the mail file and extracts information
required for the template using the build-in MIME libaries (mml-*
IIRC) which are capable of correctly parsing and if necessary decoding
(e.g. quoted printable encoded letters in the subject). After
extracting the information Emacs creates the appropriate capture
entry, somehow adds the message file as attachment and finishes the
capture process.

-or-

Don't dump the message in the org buffer "as is", but wrap it in a
#+begin_src <MIME MODE> where MIME-MODE is the build in mode for
decoding MIME messages. You could then view the original message with
C-c ' -- only task left is dealing with the subject line for the entry
headline.

Best,
  -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

  reply	other threads:[~2011-06-27 20:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27  8:30 Email -> Org-mode: charset problem Karl Voit
2011-06-27 20:04 ` David Maus [this message]
2011-06-28  4:43   ` Richard Lawrence
2011-06-28 17:13   ` Capture from GNU screen to Org-mode (was: Email -> Org-mode: charset problem) Karl Voit

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=87fwmvghxa.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=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).