1 <refentry id="gmime-filters">
3 <refentrytitle>GMime Stream Filters</refentrytitle>
4 <refmiscinfo>GMime Library</refmiscinfo>
8 <refname>GMime Stream Filters</refname>
9 <refpurpose>How to use GMime Stream Filters</refpurpose>
11 <refsect1 id="filter-overview">
12 <title>Overview of Filters</title>
13 <para>Stream filters are an efficient way of converting data from
14 one format to another. To use a stream filter, you must first
15 construct a GMimeStreamFilter stream and then add the desired
18 <para>GMime comes equipped with some basic filters such as
19 GMimeFilterBasic, GMimeFilterCharset, GMimeFilterCRLF,
20 GMimeFilterFrom and GMimeFilterHTML.</para>
22 <para>The GMimeFilterBasic filter is actually a collection of
23 filters for common transfer encodings used by MIME. So far, it is
24 able to handle encoding and decoding of base64, quoted-printable
25 and (x-)uuencode.</para>
27 <para>For internationalization support, GMime also includes a
28 filter for converting between any 2 charsets,
29 GMimeFilterCharset. With this filter, mail user agents can allow
30 the user to read the message content in his or her own
33 <para>A common conversion needed for text is CRLF -> LF and LF ->
34 CRLF which is needed for most (all?) internet protocols. Luckily,
35 GMime comes equipped with a filter to handle this for you,
36 GMimeFilterCRLF. You'll notice that GMimeFilterCRLF can also
37 handle dot-escaping, which is especially useful for SMTP
40 <para>On Unix systems, mail often resides in spools in mbox
41 format. Mbox uses a line that starts with "From " to delimit
42 messages which means that message bodies are forbidden to contain
43 lines starting with "From ". The common way to escape these from
44 lines in message bodies is to prepend the line with a greater-than
45 character ('>') producing ">From ". You'll find GMimeFilterFrom
46 handy when dealing with this.</para>
48 <para>The GMimeFilterHTML filter converts a normal text stream
49 into an html stream. This is especially useful if you are using a
50 widget such as GtkHTML to display the contents of an email