From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Email -> Org-mode: charset problem Date: Mon, 27 Jun 2011 22:04:17 +0200 Message-ID: <87fwmvghxa.wl%dmaus@ictsoc.de> References: <2011-06-27T10-18-00@devnull.Karl-Voit.at> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Mon_Jun_27_22:04:17_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbI2k-0003pw-DJ for emacs-orgmode@gnu.org; Mon, 27 Jun 2011 16:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbI2g-0004xu-OE for emacs-orgmode@gnu.org; Mon, 27 Jun 2011 16:04:25 -0400 Received: from app1a.xlhost.de ([213.202.242.161]:33517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbI2g-0004xN-5W for emacs-orgmode@gnu.org; Mon, 27 Jun 2011 16:04:22 -0400 In-Reply-To: <2011-06-27T10-18-00@devnull.Karl-Voit.at> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: news1142@Karl-Voit.at, Karl Voit Cc: emacs-orgmode@gnu.org --pgp-sign-Multipart_Mon_Jun_27_22:04:17_2011-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable At Mon, 27 Jun 2011 10:30:06 +0200, Karl Voit wrote: >=20 > Hi! >=20 > 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]) >=20 > Disclaimer: This is not directly related to Org-mode but I guess > there are people here with the very same problem. >=20 > 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). >=20 > This is quite handy since some tasks arrive at emails and I want to > capture this everywhere (smartphone, webmail, ...) using a simply > email forward. >=20 > 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] >=20 > I guess this is because procmail and formail[3] =E2=80=93 the tools I am > using to extract mail infos to append to the org-file =E2=80=93 are > 7-bit-only or similar. > > If this is the case, I guess I'll have to find a different approach > for this purpose. >=20 > 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=3Dus-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 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 --=20 OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Mon_Jun_27_22:04:17_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk4I4kEACgkQma24O1pEeOZCaQD/eRI/DH2NrHml+6JzoM6kcXWE j99CbFp82OeVXEsqr60A/AiTUxAxPxBgQDb3iC8oTWUORmpTZJOigDdmFcaxeTRk =Zoy0 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Mon_Jun_27_22:04:17_2011-1--