FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Mailman Integration!
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Mailman Integration! [message #32982] Mon, 07 August 2006 18:22 Go to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
add to buddy list
ignore all messages by this user
Apologies for the length of this please read through it to the end, I need professional help . . . Well that's what my work collegues keep telling me anyway Razz

After a relaxing time on the beaches of the Costa del sol, its back to work on this integration with a vengance.

Before leaving, I cleared my entire site from my host, and just left a simple SHTML page there for holding. When I came back I set up a Mailman mailing list, with pretty much default options, and subscribed to it. Sent a test email from my mail client to the mailing list, and received it back no problems. Onto stage two

Stage Two - Install FUDForum 2.7.5, no problems, Use the test Forum/Test Category and the Admin User to Post a Message - Works fine. Onto Stage 3

Stage Three - Configure the Bridge. Firstly Unlock The Forum Files (Fallen foul of this in the past Smile ) Files Unlocked, Chmod all the dataroot directories to 777 (as advised in another thread). Then Use Mailing List Manager to set up the bridge. Try a post in the TestCategory to send an email to the mailing list . . . Received . . Great! Smile . Onto Step 4

Step 4 Setup the procmail recipe to pipe messages from the mailing list to the forum. Now this is where I have been coming unstuck. So create a basic .procmailrc with the following
DEFAULT=$HOME/Maildir
SHELL=/bin/sh
PMDIR=$HOME/procmail
LOGFILE=$PMDIR/pmlog
LOG="
"
VERBOSE=yes
MAILDIR=$HOME/Maildir
##INCLUDERC=$PMDIR/rc.subscriptions


:0c
* ^TO_list(at)ukhomebrew(dot)info
| /usr/local/bin/php -q /home/.doodles/ukhomebrew/uk-homebrew.info/.forumdata/scripts/maillist.php 1

# VERBOSE=no

:0
$HOME/Maildir/
I'll move the recipe to the rc.subscriptions file when I've got it working. The line in the pipe is cut and pasted from Mailing list Manager so hopefully NO typo's. So test it by replying to the post sent in step three . . . Post received back frm the mailing list so check the forum . . . Nothing, Nada, Zilch Sad Ok check PMLOG file
procmail: [6822] Mon Aug  7 14:29:35 2006
procmail: Assigning "MAILDIR=/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir"
procmail: Match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)list(at)ukhomebrew(dot)info"
procmail: Assigning "LASTFOLDER=/usr/local/bin/php -q /home/.doodles/ukhomebrew/uk-homebrew.info/.forumdata/scripts/maillist.php 1"
procmail: Executing "/usr/local/bin/php,-q,/home/.doodles/ukhomebrew/uk-homebrew.info/.forumdata/scripts/maillist.php,1"
procmail: Assigning "LASTFOLDER=/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1154986175.6822_0.spunkymail-mx4"
procmail: Notified comsat: "ukhomebrew@0:/mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new/1154986175.6822_0.spunkymail-mx4"
From ukhomebrew-bounces(at)lists(dot)ukhomebrew(dot)info  Mon Aug  7 14:29:33 2006
 Subject: Test Messages Day Two
  Folder: /mnt/thresher/vol/boot/spunky/doodles/ukhomebrew/Maildir/new	   2983
Everythng looks fine, and looks as though it worked, but there is no message added to the database. So here I am more or less back at square one without a working Mailman to FUDForum interface.

One thought I have had is that when I upgrade the forum from 2.7.4 to 5 I took a datadump, uninstalled the old version(Uneccessary I know, but I had choosen the directory structure unwisely, this gave me the chance to do something about it) and created the new directories as
Dataroot - root/.forumdata
Forum Files - root/site/forum
What I'm thinking is that by hiding the dataroot directory I have somehow screwed up the integration. I guess its time to uninstall and reinstall using a non hidden forum dataroot.

Any other Ideas?




--
Aleman
Re: Mailman Integration! [message #32994 is a reply to message #32982] Tue, 08 August 2006 11:02 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
I highly doubt that the "hiding" of the data root is the culprit. If I had to debug this problem here is how I'd go about it.

Try to import message via cat message | php maillist.php [rule id]
If import ok, compare the user name the import normally runs as vs used username
check file permissions
If the import is not ok, then I'd make sure error reporting is enabled and error logging is logging to some file and re-run the script to see if any PHP errors happen.
If no errors and no message, then I'd check the thread & msg tables for the presence of the message. If it is there then I'd check if the apr field is set to 1 in the msg table and if it has a valid thread id.


FUDforum Core Developer
Re: Mailman Integration! [message #33046 is a reply to message #32994] Wed, 09 August 2006 12:16 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
add to buddy list
ignore all messages by this user
Thanks for the step by step guide to debuging the problem Iila.

Ok I added the following to the .procmailrc file
:0c
* ^TO_list(at)ukhomebrew(dot)info
$HOME/messages/msg0001

then I sent a message from my mail client to the mailing list. Checking my procmail log showed that it had been processed, and a msg0001 file was produced. Back to my ssh window, and type
[twizzler]$ cat $HOME/messages/msg0001 | /usr/local/bin/php /home//ukhomebrew/uk-homebrew.info/.forumdata/scripts/maillist.php 1
X-Powered-By: PHP/4.4.2
Content-type: text/html
So I guess that is working, especially when I check the forum and see the message there as If I had sent it direct. The user i am using with CAT is ukhomebrew, how can I find out what user the procmail recipe uses?

Ah Just checked with my host and they run PHP as PHP-CGI in which case the php runs as the user ukhomebrew as well. I have modified the permissions on the files in the forum data root to 777 using
chmod -R 777 * and tested it again. Still nothing in the forum, I guess its time to work out how to enable error reporting and logging


--
Aleman

[Updated on: Wed, 09 August 2006 12:42]

Report message to a moderator

Re: Mailman Integration! [message #33054 is a reply to message #33046] Wed, 09 August 2006 19:57 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Quote:


how can I find out what user the procmail recipe uses?



The procmail recipe is usually run under your e-mail account. However you can verify that by making the php script execute "whoami" command. Ex:
<?php
$user_name 
= `whoami`;
?>


FUDforum Core Developer
Re: Mailman Integration! [message #33067 is a reply to message #33054] Thu, 10 August 2006 13:36 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
add to buddy list
ignore all messages by this user
Executing a Procmail recipe that calls a script with the following in it
<?php
echo exec ( 'whoami > \home\ukhomebrew\whoami.txt' ) ;
?>
yields ukhomebrew in the text file, which is the user CAT works under from the command line as well.

as I called this script by sending an email to the mailing list I am now convinvced that the mailing list is working correctly, and my procmail recipies are correct.

I'll check the thread an messages tables, but I've done this before and the only records were the ones from the result of CAT.

Smile


--
Aleman

[Updated on: Thu, 10 August 2006 13:36]

Report message to a moderator

Re: Mailman Integration! [message #33071 is a reply to message #33067] Thu, 10 August 2006 16:16 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Have you enabled PHP error logging?

FUDforum Core Developer
Re: Mailman Integration! [message #33102 is a reply to message #33071] Sat, 12 August 2006 06:26 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
add to buddy list
ignore all messages by this user
Not as yet, I've been trying to work out how to do it on the host that I'm using, whoich is running PHP as a CGI and IIRC there are some problems with enabing some PHP options in that configuration.

I've emailed the host support asking for some advice on how to do this, and also outlined the whole problem to them in case its something they have switched on - or off.

To be honest I am getting really frustrated by this whole problem, and yet I am sure that it must be a trivial thing. What really frustrates me is my lack of knowledge around this whole unix PHP thing. If it was SQL Server I could crack it in moments.

I was considering throwing in the towel with FUDforum, and looking at other forum software, but none appear to have a mature solution WRT integrating with Mailing Lists, and I know that FUD does work, I have had it working, so it is going to be a simple case of working slowly and surely through the various solutions until we find the answer. I have decided that I will continue with the rest of the customisation and configuration, of FUD and the other components of the site In the knowledge that there will be a solution and it will be found.

Thank you for all your assistance so far Iila I really appreciate it.


--
Aleman
Re: Mailman Integration! [message #33105 is a reply to message #32982] Sat, 12 August 2006 09:39 Go to previous messageGo to next message
jeffrey is currently offline  jeffrey   United States
Messages: 36
Registered: June 2006
Location: Atlanta, GA
Karma: 0
Member
add to buddy list
ignore all messages by this user
You might consider using "tee tmpfile.txt | mailcmd " instead of "cat" and then you can see what text FUDforum is generating and then make sure and turn on debugging and then you can "cat tmpfile.txt | mailcmd" to recreate exactly what's going on.

I use sendmail/mimedefang combination and was having a user-id problem, so I created a little C program to switch-user to my sendmail user (MIMEDefang) and run the php mail script that way and it works fine now Cool
Re: Mailman Integration! [message #33108 is a reply to message #33105] Sat, 12 August 2006 10:53 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
add to buddy list
ignore all messages by this user
Thank You Jeffrey,

Yet something else to try and locate the problem. Here are the results from the command.
[twizzler]$ tee msg.txt | forumdata/scripts/maillist.php 1
X-Powered-By: PHP/4.4.2
Content-type: text/html

<br />
<b>Warning</b>:  main(forumdata/scripts/GLOBALS.php): failed to open stream: No such file or directory in <b>/home/.doodles/ukhomebrew/forumdata/scripts/maillist.php</b> on line <b>344</b><br />
<br />
<b>Warning</b>:  main(forumdata/scripts/GLOBALS.php): failed to open stream: No such file or directory in <b>/home/.doodles/ukhomebrew/forumdata/scripts/maillist.php</b> on line <b>344</b><br />
<br />
<b>Fatal error</b>:  main(): Failed opening required 'forumdata/scripts/GLOBALS.php' (include_path='.:/usr/local/lib/php') in <b>/home/.doodles/ukhomebrew/forumdata/scripts/maillist.php</b> on line <b>344</b><br />
Its obviously telling me that there is a problem with GLOBALS.PHP, although I can see that there is a symlink to Globals.php in the include directory, and can even pico that with no problem from the scripts directory.


--
Aleman
Re: Mailman Integration! [message #33114 is a reply to message #33108] Sat, 12 August 2006 12:12 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Its looking for GLOBALS.php inside the scripts/ directory, so you need to make a symlink to GLOBALS.php there.

FUDforum Core Developer
Re: Mailman Integration! [message #33127 is a reply to message #33114] Sat, 12 August 2006 13:07 Go to previous messageGo to next message
aleman   United Kingdom
Messages: 40
Registered: May 2006
Location: Blackpool UK
Karma: 0
Member
add to buddy list
ignore all messages by this user
If I open a ssh session and cd to the scripts directory.

file GLOBALS.php gives me
GLOBALS.php: symbolic link to `/home/.doodles/ukhomebrew/forumdata/include/GLOBALS.php'
so the symlink is there, and I have checked it by pico -w GLOBALS.php which has brought up the file in the pico editor.

I have thought about removing the symlink and actually copying the physical file. although as I understand symlinks this should make no difference whatsoever.

Still its nice to see that there could be some error underlying the whole thing now.


--
Aleman
Re: Mailman Integration! [message #33131 is a reply to message #33127] Sat, 12 August 2006 14:11 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Well its trying to open forumdata/scripts/GLOBALS.php

Try changing
<?php
if (strncmp($_SERVER['argv'][0], '.'1)) {
                require (
dirname($_SERVER['argv'][0]) . '/GLOBALS.php');
        } else {
                require (
getcwd() . '/GLOBALS.php');
        }
?>


inside maillist.php to simply require "path_to/GLOBALS.php";


FUDforum Core Developer
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Problem running getlists from cron
Next Topic: Moving to a new host
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Oct 24 02:00:24 EDT 2017

Total time taken to generate the page: 0.00828 seconds