# HG changeset patch
# User Ben Schmidt
# Date 1424896141 -39600
# Node ID b68213ccb9d28b29185cf4d3903d2845b07e1012
# Parent 04d916168efba6736758a9e53fbefef58cc4a7b5
Add README.footers and footer-related resources.
diff -r 04d916168efb -r b68213ccb9d2 ChangeLog
--- a/ChangeLog Wed Feb 25 18:22:37 2015 +1100
+++ b/ChangeLog Thu Feb 26 07:29:01 2015 +1100
@@ -1,3 +1,4 @@
+ o Add README.footers and footer-related resources
o Support ESMTP so OpenSMTPD uses 8 bits (Paul Fariello)
o Use iconv to convert unknown character sets
o Handle unfolded header lines better
diff -r 04d916168efb -r b68213ccb9d2 Makefile.am
--- a/Makefile.am Wed Feb 25 18:22:37 2015 +1100
+++ b/Makefile.am Thu Feb 26 07:29:01 2015 +1100
@@ -4,7 +4,7 @@
EXTRA_DIST = include VERSION LICENSE UPGRADE FAQ \
TUNABLES README.access README.archives README.listtexts man \
README.exim4 README.sendmail README.security README.qmail \
- README.postfix
+ README.postfix README.footers
CLEANFILES = *~ mlmmj-*.tar.*
man1_MANS = man/mlmmj-bounce.1 man/mlmmj-make-ml.1 man/mlmmj-receive.1 \
diff -r 04d916168efb -r b68213ccb9d2 README.footers
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README.footers Thu Feb 26 07:29:01 2015 +1100
@@ -0,0 +1,47 @@
+README.footers
+
+Footers in Mlmmj
+================
+
+Mlmmj's built-in footer support is very rudimentary. It will work for plain
+text emails, and that's about it. It doesn't understand HTML or MIME or
+anything like that.
+
+There are a few solutions to this. They all involve piping incoming mail
+through a filter before it reaches Mlmmj. A script to do this, called
+mlmmj-amime-receive, is included in amime-receive in the contrib directory.
+
+It can be used with a number of different pre-processors. One day we also hope
+to improve the integration of these external filters with Mlmmj, e.g. so only
+list posts are processed. However, the piping solution has worked for a number
+of people over the years quite satisfactorily, so this is not a high priority.
+
+Here are some pre-processors you can use.
+
+alterMIME
+---------
+
+The mlmmj-amime-receive script is designed to work with a program called
+alterMIME. The script itself (in amime-receive in the contrib directory)
+contains links to that software, and instructions.
+
+Foot Filter
+-----------
+
+alterMIME didn't allow me to reach my particular goals, so I wrote an
+alternative called Foot Filter. It is a single source-file C program; the code
+and a very simple Makefile can be found in foot_filter in the contrib
+directory, along with an altered version of mlmmj-amime-receive, called
+mlmmj-recieve-ff.
+
+Foot Filter will output documentation if you run it without arguments, and
+again, instructions for the script that handles the piping are found within it.
+
+Py-MIME
+-------
+
+A third option is Py-MIME. It was developed for use at The Document Foundation
+(LibreOffice) and is included in pymime in the contrib directory.
+
+
+
diff -r 04d916168efb -r b68213ccb9d2 README.listtexts
--- a/README.listtexts Wed Feb 25 18:22:37 2015 +1100
+++ b/README.listtexts Thu Feb 26 07:29:01 2015 +1100
@@ -1,6 +1,6 @@
README.listtexts
-List texts in mlmmj
+List texts in Mlmmj
===================
List texts are stored in listdir/text. They specify the content of various
diff -r 04d916168efb -r b68213ccb9d2 contrib/Makefile.am
--- a/contrib/Makefile.am Wed Feb 25 18:22:37 2015 +1100
+++ b/contrib/Makefile.am Thu Feb 26 07:29:01 2015 +1100
@@ -1,4 +1,4 @@
## Process this file with automake to produce Makefile.in
-EXTRA_DIST = web amime-receive
+EXTRA_DIST = web amime-receive foot_filter pymime
SUBDIRS = receivestrip
diff -r 04d916168efb -r b68213ccb9d2 contrib/foot_filter/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/foot_filter/Makefile Thu Feb 26 07:29:01 2015 +1100
@@ -0,0 +1,14 @@
+all: foot_filter
+dev: tags splint foot_filter
+.PHONY: splint clean clobber
+tags: foot_filter.c
+ ctags --excmd=number '--regex-c=-/\*[[:blank:]]*tag:[[:blank:]]*([[:alnum:]_]+)-\1-' foot_filter.c
+splint:
+ splint +unixlib -exitarg -initallelements foot_filter.c
+foot_filter: foot_filter.c
+ gcc -Wall -g -o foot_filter foot_filter.c -O3
+clean:
+ -rm tags
+clobber: clean
+ -rm foot_filter
+ -rm test
diff -r 04d916168efb -r b68213ccb9d2 contrib/foot_filter/foot_filter.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/foot_filter/foot_filter.c Thu Feb 26 07:29:01 2015 +1100
@@ -0,0 +1,2685 @@
+/*
+
+foot_filter.c
+
+(C) 2010 Ben Schmidt
+
+This Source Code Form is subject to the terms of the Mozilla Public License
+Version 2.0. If a copy of the MPL was not distributed with this file, You can
+obtain one at http://mozilla.org/MPL/2.0/.
+
+*/
+
+// Check out the -V option; it outputs this and more
+#define FOOT_FILTER_VERSION "foot_filter version 1.2, (C) 2010 Ben Schmidt"
+
+static const char * USAGE="\n\
+usage: foot_filter [-p plain_footer_file] [-h html_footer_file]\n\
+ [{-P|-H} mime_footer_file] [-s]\n\
+ foot_filter -V\n\
+\n\
+plain_footer_file, if present, will be appended to mails with plain text\n\
+sections only. Similarly, html_footer_file. If mime_footer_file (either\n\
+plain, -P, or HTML, -H) is given, it will be used when a mail with\n\
+alternative formats is encountered, or if the footer for the relevant\n\
+type of mail is not present; a new MIME section will be added.\n\
+\n\
+-s turns on smart mode which endeavours to remove included/quoted copies of\n\
+the (or a similar) footer by surrounding the footer with patterns it later\n\
+recognises. It also endeavours to strip 'padding' surrounding the old\n\
+footers to make things as clean as possible. This includes whitespace\n\
+(including ' ' and '
'), '>' quoting characters, various pairs of\n\
+HTML tags (p, blockquote, div, span, font; it's naive, it doesn't check\n\
+tags in between are balanced at all, so in '
prefix
suffix
' the\n\ +first and last tags are paired), and even horizontal rules when inside\n\ +paired tags (e.g. use '