Index: ossp-pkg/lmtp2nntp/INSTALL RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/INSTALL,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/INSTALL,v' 2>/dev/null --- INSTALL 2001/10/11 09:35:39 1.9 +++ INSTALL 2001/10/13 13:45:11 1.10 @@ -9,6 +9,7 @@ OSSP lmtp2nntp - Mail to News Gateway INSTALLATION + ============ To install OSSP lmtp2nntp into /path/to/lmtp2nntp/{bin,man}/ perform the following steps in your shell: @@ -19,14 +20,17 @@ $ make install CONFIGURATION + ============= In order to use OSSP lmtp2nntp, the program has to be integrated into a Mail Transfer Agent (MTA) which speaks Local Mail Transfer Protocol - (LMTP). OSSP lmtp2nntp was developed with Sendmail 8.11, but should - also work with other MTAs who provide an LMTP interface. The detailed - integration into Sendmail 8.11 is shown below. + (LMTP). OSSP lmtp2nntp was developed with Sendmail 8.11 and tested + with Sendmail 8.11 and Postfix 20010228, but should also work with + other MTAs who provide an LMTP interface. The detailed integration + into Sendmail 8.11 and Postfix 20010228 is shown below. Sendmail Integration + -------------------- 1. Create a "cf/mailer/lmtp2nntp.m4" macro file with the following contents: @@ -70,6 +74,8 @@ 2. Add to your Sendmail M4 configuration (file "sendmail.m4" or "sendmail.mc" according to your installation) the following entry: + sendmail.m4: + | dnl # Mailer: LMTP2NNTP (mail to news gateway) | define(`LMTP2NNTP_MAILER_PATH', `/path/to/lmtp2nntp/bin/lmtp2nntp') | MAILER(lmtp2nntp) @@ -81,7 +87,16 @@ lmtp2nntp(1) manual page for more details about the commmand line parameters. - 3. Add the following entries to both your virtual user table (file + 3. Activate in your Sendmail M4 configuration (file "sendmail.m4" or + "sendmail.mc" according to your installation) the virtual user + and mailer table: + + sendmail.m4: + + | FEATURE(mailertable, `hash -o /path/to/mailertable') + | FEATURE(virtusertable, `hash -o /path/to/virtusertable') + + 4. Add the following entries to both your virtual user table (file "virtusertable") and your mailer table (file "mailertable") in order to finally activate the mail to news gateway: @@ -118,3 +133,85 @@ Notice that there are more delivery modes supported by OSSP lmtp2nntp. Refer to the lmtp2nntp(1) manual page for more details. + Postfix Integration + ------------------- + + 1. Make sure that Postfix was built with PCRE map support + (see README.PCRE in the original Postfix source distribution). + It basically means building and installing PCRE from + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ and + configuring Postfix with at least: + + | make makefiles \ + | CCARGS="-I/path/to/pcre/include -DHAS_PCRE" + | AUXLIBS="-L/path/to/pcre/lib -lpcre" + + 2. In the Postfix main configuration file (main.cf) you have + enable the virtual user and transport mapping tables: + + main.cf: + + | virtual_maps = pcre:/path/to/virtual + | transport_maps = hash:/path/to/transport + + 3. Add the following entry to the Postfix virtual user mapping table: + + /path/to/virtual: + + | /^posting\+(.*)@gateway\.example\.com$/ $1@lmtp2nntp.invalid + + 4. Add the following entry to the Postfix transport mapping table: + + /path/to/transport: + + | lmtp2nntp.invalid lmtp:unix:/path/to/lmtp2nntp.news.example.com + + Additionally convert the transport mapping table into the hash + table format Postfix reads (not required for the virtual user + mapping table above, because it is PCRE based). + + $ postmap /path/to/transport + + 5. Start lmtp2nntp as a stand-alone daemon for delivering to + news.example.com. This is required because in contrast to Sendmail, + Postfix can speak LMTP only via Unix Domain and Internet Domain + sockets (but not via a Unix pipe). Use the following script: + + lmtp2nntpd: + + | #!/bin/sh + | LMTP2NNTP_PATH='/usr/local/bin/lmtp2nntp' + | LMTP2NNTP_ARGS='' + | LMTP2NNTP_CLIENTBIND='/path/to/lmtp2nntp.news.example.com' + | LMTP2NNTP_GROUPMODE='envelope' + | LMTP2NNTP_LOGLEVEL='notice:/var/log/lmtp2nntp' + | LMTP2NNTP_MAILFROM='^.+@(?:[^.]+\.)+[^.]+$' + | LMTP2NNTP_NODENAME=`hostname` + | LMTP2NNTP_OPERATIONMODE='post' + | LMTP2NNTP_SIZE='800000' + | LMTP2NNTP_TIMEOUT='nntp:connect=60' + | LMTP2NNTP_NEWSGROUP='*' + | case $1 in + | start ) + | $LMTP2NNTP_PATH -D -P "/path/to/lmtp2nntp.pid" \ + | -c "$LMTP2NNTP_CLIENTBIND" \ + | -d "news.example.com" \ + | -g "$LMTP2NNTP_GROUPMODE" \ + | -l "$LMTP2NNTP_LOGLEVEL" \ + | -m "$LMTP2NNTP_MAILFROM" \ + | -n "$LMTP2NNTP_NODENAME" \ + | -o "$LMTP2NNTP_OPERATIONMODE" \ + | -s "$LMTP2NNTP_SIZE" \ + | -t "$LMTP2NNTP_TIMEOUT" \ + | "$LMTP2NNTP_NEWSGROUP" + | ;; + | stop ) + | $LMTP2NNTP_PATH -K -P "/path/to/lmtp2nntp.pid" + | ;; + | esac + + 5. start lmtp2nntp daemon and reload Postfix to activate the new setup: + + $ lmtp2nntpd start + $ postfix reload +