From ef958138c5ea66bb112c52e38228503e44cb148e Mon Sep 17 00:00:00 2001
From: Nigel Cunningham <nigel@tuxonice.net>
Date: Fri, 12 Nov 2010 07:25:16 +1100
Subject: [PATCH] Postfix install instructions.

Signed-off-by: Nigel Cunningham <nigel@tuxonice.net>
---
 postfix_og_mailinglist/INSTALL.txt |  109 ++++++++++++++++++++++++++++++++++++
 1 files changed, 109 insertions(+), 0 deletions(-)
 create mode 100644 postfix_og_mailinglist/INSTALL.txt

diff --git a/postfix_og_mailinglist/INSTALL.txt b/postfix_og_mailinglist/INSTALL.txt
new file mode 100644
index 0000000..bc5aeca
--- /dev/null
+++ b/postfix_og_mailinglist/INSTALL.txt
@@ -0,0 +1,109 @@
+og_mailing list: Installation in a Postfix environment.
+
+The integration between og_mailinglist and Postfix requires:
+
+1) A properly configured site_info.php
+
+Either:
+2) An alias address in a virtual domain, using a pipe command
+
+OR
+
+3) Definition of the email addresses
+4) The transport map
+5) The transport command
+
+Each of these elements are described below:
+
+==========================================================================
+
+1) A properly configured site_info.php
+--------------------------------------
+
+The posting of messages into Drupal is accomplished by using Curl to
+post to a special url (in the format http://example.com/og_mailinglist).
+The script which does this work needs to be supplied with configuration
+info - the URL to which it should post and the unique validation string
+that authenticates the script, in order to stop this URL from being abused.
+This validation string can be set on your website, via the path
+http://example.com/admin/og/og_mailinglist. site_info.php should be
+placed in the og_mailinglist module's exim_og_mailinglist subdirectory.
+It should look like this:
+
+<?php
+
+/*
+ * @return array of sites w/ associated POST urls.
+ */
+function og_mailinglist_site_info() {
+  return array (
+    'groups.example.com' => array(
+            'post_url' => 'http://www.example.com/og_mailinglist',
+            'validation_string' => 'my unguessable validation string',
+           ),
+  );
+}
+
+In the above example, the website is 'www.example.com', and email will
+be sent to groups.example.com.
+
+In addition to the above, to actually deliver an email, it expects the
+first argument to be the domain to which it should deliver (groups.example.com
+in the above configuration) and (on stdin) the message itself.
+
+2) An alias address in a virtual domain, using a pipe command
+-------------------------------------------------------------
+
+The simplest way of linking an address to the transport script is by using a
+pipe command in your Postfix alias file (as is often done for Mailman
+addresses):
+
+test:              "|/path/to/og_mailinglist_script.sh ${DOMAIN}"
+
+Your script will need to cd to the root of the website and then invoke
+exim_og_mailinglist/og_mailinglist_exim4_transport.php in the og_mailinglist
+module directory, sending the text of the message (which it received on stdin)
+to stdin of the script, and putting the domain (groups.example.com in our
+site_info.php above) into argv[1]. You may want to pipe stdout and stderr
+to a /tmp file while debugging.
+
+Sample test script:
+
+#!/bin/bash
+
+cat >/tmp/message.$$
+(cd /path/to/website_document_root; cat /tmp/message.$$ | \
+  sites/all/modules/og_mailinglist/exim_og_mailinglist/950_exim4-config_drupal_og_mailinglist_router $1 >/tmp/message.$$.log 2>&1 )
+
+As mentioned above, if you follow step 2, you can stop here. The following steps
+provide an alternative to step 2 that may be preferable in some circumstances.
+
+==========================================================================
+
+3) Definition of the email addresses
+------------------------------------
+
+Instead of using a simple Mailman type pipe to a command, it is also possible to
+define email addresses in the normal way, then use a special transport (steps 4
+& 5) to handle delivery. You might want to do this if, like me, you define a
+good portion of your addresses via MySQL.
+
+A line in your virtual map might thus look like this:
+
+test@example.com @groups.example.com
+
+4) The transport map
+--------------------
+
+The transport map tells Postfix how to deliver email (/etc/postfix/transport):
+
+test@groups.example.com organic_groups:
+
+5) The transport command
+------------------------
+
+Finally, in /etc/postfix/master.cf, you want to define the 'organic_groups' transport...
+
+  flags=FR user=www-data directory=/path/to/drupal/public_html \
+    argv=sites/all/modules/og_mailinglist/postfix_og_mailinglist/debug.sh \
+    ${domain}
-- 
1.7.1

