7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 The present code repository contains email software which Mother Mychaela
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 developed for her own personal use; it is unlikely to be of interest to other
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 people as my tastes in personal technology tend to be very different from the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 rest of the world, but I publish almost all of my software nonetheless, as a
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 matter of general principle.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 The main program in the present collection is f-demime - it is a de-MIME-ing
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 tool. f-demime processes one or more email messages in UNIX mailbox format
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 (each message preceded and delimited by a '^From ' line) and applies the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 following transformations to each message:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 1] base64 blobs that aren't text parts are excised from the message; each such
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 blob is decoded and saved into its own file. These saved attachment files
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 are written into a special directory that must be indicated with
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 FDEMIME_ATT_DIR= environment variable.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 2] text/plain parts that are encoded in either base64 or quoted-printable are
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 decoded and written out in a form that (a) losslessly preserves the content
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 of the text part that originally contained non-ASCII characters and/or
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 insanely long lines, but also (b) is more suitable for direct consumption by
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 my wetware, rather than MIME software. The output form uses backslash
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 escapes to represent non-ASCII characters and machine-inserted line breaks.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 3] text/html and other non-plain text parts that are encoded in base64 are
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 losslessly transcoded from base64 to quoted-printable.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 The transformations applied by f-demime aren't fully lossless at level of
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 overall message lines and octets (one cannot take f-demime output and
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 reconstruct a message byte-identical to the original), but they are lossless at
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 the level of content which MIME itself promises to preserve.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 One important demiming function which f-demime does NOT do is collapsing
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 multipart/alternative structures, keeping text/plain and discarding HTML. The
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 rationale for this functional omission is that I will be inserting f-demime
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 into my incoming mail handling path, such that every incoming message will
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 automatically pass through f-demime before it hits my eyeballs. Given the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 current state of badness on the Internet, I occasionally receive mails in which
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 the HTML part (which would be thrown away in a multipart/alternative collapse)
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 contains some valuable or interesting information content that is missing in the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 text/plain version - thus fully automatic collapsing is not a workable approach
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 currently. I plan on implementing another program (resurrecting maltcollapse
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 from my previous cdemime attempt circa 2006) to do this multipart/alternative
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 collapsing, and then devising a practical way to invoke it once I have
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 determined that the HTML part is junk that can be safely thrown away.
|