About me: My name is Solène Rapenne, pronouns she/her. I like learning and sharing knowledge. Hobbies: '(BSD OpenBSD Qubes OS Lisp cmdline gaming security QubesOS internet-stuff). I love percent and lambda characters. OpenBSD developer solene@. No AI is involved in this blog.

Contact me: solene at dataswamp dot org or @solene@bsd.network (mastodon).

I'm a freelance OpenBSD, FreeBSD, Linux and Qubes OS consultant, this includes DevOps, DevSecOps, technical writing or documentation work. If you enjoy this blog, you can sponsor my open source work financially so I can write this blog and contribute to Free Software as my daily job.

Read quoted-printable emails with qprint

Written by Solène, on 27 October 2023.
Tags: #openbsd #linux #unix

Comments on Fediverse/Mastodon

1. Introduction §

You may already have encountered emails in raw text that contained weird characters sequences like =E3 or =09, especially if you work with patch files embedded as text in emails.

There is nothing wrong with the text itself, or the sender email client. In fact, this shows the email client is doing the right thing by applying the RFC 1521. Non-ASCII character should be escaped in some way in emails.

RFC 1521: MIME part one

This is where qprint enters in action, it can be used to encode using the quoted-printable, or decode such content. The software can be installed on OpenBSD with the package named qprint.

qprint official website

I already introduced qprint in a blog post in a guide about OpenBSD pledge.

2. What does quoted-printable look like? §

If you search for an email from the OpenBSD mailing list, and display it in raw format, you may encounter this encoding. There isn't much you can do with the file, it's hard to read and can't be used with the program patch.

Email example featuring quoted-printable characters

A sample of the email looks like that:

	From italiano-=E6=97=A5=E6=9C=AC=E8=AA=9E (=E3=81=AB=E3=81=BB=E3=82=93=
=E3=81=94) FreeDict+WikDict dictionary ver.
	2022.11.18 [itajpn]:
=09
	  ciao //'=CA=A7ao// <interjection>
	  =E3=81=93=E3=82=93=E3=81=AB=E3=81=A1=E3=81=AF
=09

If you pipe this content through the command qprint -d, you will obtain a much more interesting text:

	From italiano-日本語 (にほんご) FreeDict+WikDict dictionary ver.
	2022.11.18 [itajpn]:
	
	  ciao //'ʧao// <interjection>
	  こんにちは
	

There is little use in encoding content with qprint, but it could do it as well.

3. Conclusion §

If you ever encounter this kind of encoding, now you should be able to figure what it is, and how to read it.

Qprint may not be available on all systems, but compiling it is quite easy, as long as you have a C compiler and make installed.