RFC2047-decode support for filters

[in Japanese]

warning: This is a patch for older version of exim (ver 4.14). Newer versions of exim (since ver. 4.202) have been applied this patch officially, so there is no need you download or apply it.

What is this?

This is a patch for exim. It enables exim to handle MIME-encoded string in a filter or in a configuration file.

Email messages in Asian languages, including Japanese language, are usually encoded in MIME with Base64 or Quoted-Printable encoding which are defined in RFC-2047. We have to decode them prior to filtering them, but exim itself does not support it for now.

Apply this patch so that exim can filter such encoded messages.

How to use

Download

Download eximime here:

Though you can freely distribute it as you like, it is not recommended as the specification and documentation are not matured.

ChangeLog:

2003-05-07  Norihisa Washitake  
        * Now the decoding happens automatically.

        * Filenames are completely new.

        * No more 'mime_decode' operator now.  Exim calls rfc2047_decode()
        function at the end of find_header() in src/expand.c...

2003-04-30  Norihisa Washitake  
	* Removed store_release() function from the source.  Because exim
	process does not live very long, we could forget about the memory,
	as long as we get it via store_get().

	* More flexible coding, so that eximime.c itself could be used
	independently.  We do not need exim.h any longer (when be compiled
	alone).

2003-04-26  Norihisa Washitake  
	* The first release.

Installation

This is a patch for the source file of exim. Decompress the tar ball and apply the patch in the source tree.

wassy ~% wget http://washitake.com/mail/exim/mime/rfc2047.patch.gz
wassy ~% gunzip rfc2047.patch.gz
wassy ~% cd /usr/src/exim-4.14
wassy exim-4.14% patch -p1 < ~/rfc2047.patch

Now you can build exim as you always do: copy src/EDITME to Local/Makefile, edit it, and make && make install. Or if you have ever build it, then remove `build-OS-arch' directory and then make it again:

wassy exim-4.14% rm -rf build-Linux-i386/
wassy exim-4.14% make && sudo make install

Usage

In either filters or configuration file, naturally write:

if $header_Subject: contains "decoded patterns" then
   save /dev/null
endif

You can use mime_decode not only in system-filter or user-filter, but also in configuration files.

Please note that the filter itself should be written in your system's character encoding (eg. Japanese users should write their filter in euc-jp encoding).

If you have iconv library in your system, edit Local/Makefile so that the last two lines (which begin with HAVE_ICONV and FILTER_ENCODING) are uncommented. Exim will then be capable of character set conversion with iconv from/to UTF, Big5, or any language iconv supports (but iconv is sometimes buggy, that's why HAVE_ICONV is not enabled by default).

Before)
# HAVE_ICONV=yes
# FILTER_ENCODING=\"UTF-8\"

After)
HAVE_ICONV=yes
FILTER_ENCODING=\"UTF-8\"

eximime as a library

You may also use this rfc2047 decoding function separately.

Any comment or suggestion welcome. Please send your message to me (nori@washitake.com) . Please do not send me a spam, but SPAM of Hormel is welcome :)