Sometimes you’ll get an email — without attachments, just text — and that email is base64–encoded for no good reason. Spammers have been known to do that in order to bypass spam filters. Mailing list software has been unwisely configured to send out encoded messages. Or clueless users tweaked their client the wrong way…

The end results:

Debbie was written to address this problem. It will filter a single email message piped into its stdin, and if said message is found to be:

andB.text–only (plain text, HTML text or generally text/*);

then Debbie will do four things:

  1. decode the message body;
  2. adjust the Content-Transfer-Encoding: header to 8bit;
  3. add an "X-Original-Content-Transfer-Encoding:" header;
  4. dump the resulting message to stdout.

and, optionally:

  1. add an X-Comment: header that marks the message as “filtered by debbie”

If the message does not satisfy requirements A and B and C, Debbie will simply repeat it unchanged. The same will happen in case of errors (e.g.: an “out of memory” condition, or lack of a base64–encoded message body). If the message body is malformed base64, Debbie will decode as far as it can — and then repeat the rest of the message as–is.


Debbie’s ideal place is in your email processing chain: invoked by procmail (or similar software) before any message body checks and spam filter. If you use procmail, the INSTALL file contains a suitable recipe. In a pinch, you can use Debbie from the shell too.


Version 2.0 — released on October 5, 2019 — includes the following improvements:


Debbie uses the decoding function unbase64 by William Sherif, specially modified for Debbie by Dario Niedermann. See file base64.h for details.

Requires: C99–compliant C compiler, make, m4, flex, groff
“Debbie” is Copyright © Dario Niedermann — Released with no warranty under the terms of the BSD 3-clause revised license. Written and tested on Linux using GNU tools.
HomeNo Javascript iconValid HTML 4.01 TransitionalValid CSS!