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

Home » FUDforum » How To » problems with maillist.php (mailing list 2 forum)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
problems with maillist.php (mailing list 2 forum) [message #16866] Wed, 25 February 2004 00:36 Go to next message
oblomov is currently offline  oblomov   Italy
Messages: 12
Registered: February 2004
Karma: 0
Junior Member
Hi,


I'm trying to set up a (FUD)Forum as an archive for my mailing list but having some problems (should specify that I'm using fudforum that comes with egroupware but this shoudn't be a problem).

1) The admin panel is giving me the execute:
<mydir>/<writable_dir>/<crc(mydomain)>/scripts/maillist.php 1
but there was no scripts directory there (!)

ok, non problem, I cerated manually the scripts directory and installed maillist.php there but


2) mail kept bouncing back with php stderr saying it couldn't find file GLOBALS.php (included in maillist.php with a require)

ok, fine, I copied there GLOBALS.php but


3) I was getting a lot of "permission denied" for other requires in maillist (and/or GLOBALS.php) code: the fact is that <mydir>/<writable_dir>/<crc(mydomain)>/include directory and all installed files are installed with http user as owner and 0700 permission but when setting up a pipe/alias (<address>: |"/<pathtomaillist>/maillist.php <forum_id>" the script is usually not executed as the web server user so all other requires could not be read

so, using fudforum file manager a changed all permissions of included files to be read-all (0744) but


4) I was still getting an error because script could not write to log file in subdir errors so I changed errors/.mlist permissions to be 0777

now I'm just getting this error in the error file log:

(<myhome>/write_directory/fudforum/2945491008/include/theme/default/db.inc:106 <br />
<myhome>/write_directory/fudforum/2945491008/include/theme/default/db.inc:176 <br />
<myhome>/write_directory/fudforum/2945491008/scripts/maillist.php:366<br />
) : <br />
Query: SELECT * FROM phpgw_fud_mlist WHERE id=1<br />
Server Version: <br />


actually the reported query executes fine when done "by hand" in the sql server, I'm stuck again and this time really don't know how to proceed....


If anybody incurred in my same problems I'll be grateful for any help


Thanks





Re: problems with maillist.php (mailing list 2 forum) [message #16868 is a reply to message #16866] Wed, 25 February 2004 01:06 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
Never tried using NNTP or Mailing List import functionality with eGW, hence the problems you are having :/

Before we proceed one thing to keep in mind, you should disable user creation, since in eGW schema FUDforum does not have the ability to autonomously create users like the standalone version can.

Now on with the show Smile

1) GLOBALS.php should be a symlink not a copy of the GLOBALS.php inside the appropriate fudforum/[crc32]/include/ directory.

2) To ensure things work you should *unlock* the forum's files either by hand (not recommended) or by using the File Unlock admin control panel.

The error you are experiencing is due to missing inclusion of the eGW's SQL layer on top of which FUD's SQL functions are built in FUDforum/eGW.

To fix this try adding the following code to maillist.php after GLOBALS.php inclusion.
<?php
require_once('/path/to/egw/header.inc.php');
   if (!empty(
$GLOBALS['phpgw_info']['server']['use_adodb'])) {
           
// open your own connection, as ADOdb does not export the use Link_ID
           
switch ($GLOBALS['phpgw_info']['server']['db_type']) {
                   case
'mysql':
                           
$func = $GLOBALS['phpgw_info']['server']['db_persistent'] ? 'mysql_pconnect' : 'mysql_connect';
                           
define('fud_sql_lnk',$func($GLOBALS['phpgw']->db->Host,
                                   
$GLOBALS['phpgw']->db->User, $GLOBALS['phpgw']->db->Password));
                           
mysql_select_db($GLOBALS['phpgw']->db->Database,fud_sql_lnk);
                           break;

                   case
'pgsql':
                           
$func = $GLOBALS['phpgw_info']['server']['db_persistent'] ? 'pg_pconnect' : 'pg_connect';
                           
define('fud_sql_lnk',$func('dbname='.$GLOBALS['phpgw']->db->Database.
                                   
' host='.$GLOBALS['phpgw']->db->Host.
                                   
' user='.$GLOBALS['phpgw']->db->User.
                                   
' password='.$GLOBALS['phpgw']->db->Password));
                           break;

                   default:
                           die(
'FUDforum only supports mysql or pgsql !!!');
           }
           unset(
$func);
   } else {
           
define('fud_sql_lnk', $GLOBALS['phpgw']->db->Link_ID);
   }
?>


FUDforum Core Developer
Re: problems with maillist.php (mailing list 2 forum) [message #16869 is a reply to message #16868] Wed, 25 February 2004 07:02 Go to previous messageGo to next message
oblomov is currently offline  oblomov   Italy
Messages: 12
Registered: February 2004
Karma: 0
Junior Member
Ilia wrote on Tue, 24 February 2004 20:06


Before we proceed one thing to keep in mind, you should disable user creation, since in eGW schema FUDforum does not have the ability to autonomously create users like the standalone version can.



ok, I don't need that and it's not active.

Quote:


Now on with the show Smile



Smile

Quote:


1) GLOBALS.php should be a symlink not a copy of the GLOBALS.php inside the appropriate fudforum/[crc32]/include/ directory.



Oh yeah I knew that but I have no shell access to the server and at the moment (while testing) resulted easier to do a simple copy, I'll do a symlink and arrange better all permissions when I'll understand things can work Smile


Quote:


2) To ensure things work you should *unlock* the forum's files either by hand (not recommended) or by using the File Unlock admin control panel.



I did it but nothing seemed to change, it always says "unlocked" (whether I lock or unlock it) with no error messages. I tried it with egw administrator password. Anyway that is not a prbolem anymore because I did it by hand (apparently correctly).

Quote:


The error you are experiencing is due to missing inclusion of the eGW's SQL layer on top of which FUD's SQL functions are built in FUDforum/eGW.



so it is actually a EGW problem and not a fudforum problem right?
It was hard suspecting EGW wants his SQL layer be used for fudforum anyway...

Quote:


To fix this try adding the following code to maillist.php after GLOBALS.php inclusion.

[...]




Ok, I did: that was definitively another step ahed!
Smile


After this I still had bounces with this message:

MDA bounce unset flag output error report


!!! YOU DO NOT HAVE YOUR $GLOBALS['phpgw_info']['flags']['currentapp'] SET !!!<br>!!! PLEASE CORRECT THIS SITUATION !!!



That was pretty clear (even though I think it's useless to have that flag set in this situation) so I added a simple

<?php
$GLOBALS
['phpgw_info']['flags']['currentapp'] = 'fudforum';
?>


before your code: 'fudforum' is the name you find for fudforum in the phpgw_applications egw table for fudforum (sorry to write all these details but I really hope this will be useful to other persons that might experience the same problem). That corrected the problem.

Now I'm just getting bounces with empty error messages (I mean: just empty lines), I mean:

MDA bounce output error report


The following text was generated during the delivery attempt:

------ pipe to |/<pathtomaillist>/maillist.php 1
generated by <myaddress> ------




------ This is a copy of the message, including all the headers. ------




That's a problem I've already had with MDA piped scripts as teh MDA think it's an error if they are generating even blank lines I think.

The problem is that mailllist by itself seems generating none (no space after ?> and before <?php) so there might be some other include generating blank lines... anybody knows how a workaround this problem? (there might be a simple one I'm missing I'm sure...)

Thank you very much for your help until now anyway!!!!




[Updated on: Wed, 25 February 2004 07:11]

Report message to a moderator

Re: problems with maillist.php (mailing list 2 forum) [message #16870 is a reply to message #16869] Wed, 25 February 2004 14:50 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
Are the messages getting imported into the forum though? Or are they failing and the only output you get are blank lines?

FUDforum Core Developer
Re: problems with maillist.php (mailing list 2 forum) [message #16872 is a reply to message #16866] Wed, 25 February 2004 15:45 Go to previous messageGo to next message
oblomov is currently offline  oblomov   Italy
Messages: 12
Registered: February 2004
Karma: 0
Junior Member
no, the message aren't imported into the forum.
The MTA is exim and I added an

<?php
exit(0);
?>


at the end of the script because that's the code for success for exim (as it is for sendmail I think).

Re: problems with maillist.php (mailing list 2 forum) [message #16873 is a reply to message #16872] Wed, 25 February 2004 15:51 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
Hmm you need to check your forum's error log and/or possibly add verbose debug messages to maillist.php

It should've complained (loudly) if something had failed.


FUDforum Core Developer
Re: problems with maillist.php (mailing list 2 forum) [message #16891 is a reply to message #16873] Thu, 26 February 2004 18:38 Go to previous messageGo to next message
oblomov is currently offline  oblomov   Italy
Messages: 12
Registered: February 2004
Karma: 0
Junior Member
nothing in mlist error_log, nothing in sql_error_log, I tried set error_reporting(E_ALL) and this is what I get (I checked some of the phpgwapi codes and just seems if checks made without "isset" function).

MDA bounce message with error_reporting(E_ALL)


<br />
<b>Notice</b>: Undefined index: asyncservice in <b>/public_html/egroupware/phpgwapi/inc/class.common.inc.php</b> on line <b>336</b><br />
<br />
<b>Notice</b>: Undefined index: asyncservice in <b>/public_html/egroupware/phpgwapi/inc/common_functions.inc.php</b> on line <b>775</b><br />
<br />
<b>Notice</b>: Undefined variable: exits in <b>/public_html/egroupware/phpgwapi/inc/class.asyncservice.inc.php</b> on line <b>386</b><br />
<br />
<b>Notice</b>: Undefined index: account_id in <b>/public_html/egroupware/phpgwapi/inc/class.asyncservice.inc.php</b> on line <b>514</b><br />
<br />
<b>Notice</b>: Undefined variable: exits in <b>/public_html/egroupware/phpgwapi/inc/class.asyncservice.inc.php</b> on line <b>386</b><br />



I strongly suspect that my MTA (exim) is bouncing the message as soon as it receives something (even blank lines) from the pipe "msg_from" from the MDA (usually when an MTA delivers to MDA it opens to pipe "msg_to" and "msg_from" to communicate with the process).

I think those blank lines are added by some of the includes.

Does anyone knows how to redirect/suppress stdout/stderr from a php scipt? (or how to suppress blank lines emitted even with -q options?)

I tried to redirect by simple shell redirecting, by calling the script with > and 2> but did not work.

Or maybe I'm just confused... Wink

Thanks anyway
Re: problems with maillist.php (mailing list 2 forum) [message #16893 is a reply to message #16891] Thu, 26 February 2004 19:45 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
I am not sure where the blank lines are comming from, I doubt very much they are from one of the forum's includes.

you can use output buffering to supress stdout messages and make PHP not print errors to screen (log to a file) to supress stderr.


FUDforum Core Developer
Re: problems with maillist.php (mailing list 2 forum) [message #16948 is a reply to message #16893] Fri, 05 March 2004 12:08 Go to previous message
oblomov is currently offline  oblomov   Italy
Messages: 12
Registered: February 2004
Karma: 0
Junior Member
in fact I'm sure they are from egroupware includes I couldn't understand exactly where though.

By the way by I was able to use the modified version of egroupware fudforum without including egroupware "header.inc.php" file (that is to "blame" for this problem.

I also had to add a
<?php
define
( 'forum_debug', 1);
?>

in my script because this way it is not called an init_user function added (or modified?) in users.inc by egroupware that uses informations in egroupware "header.inc.php" that are anyway useless for a mailing list to forum script.


I posted a message to egroupware mailing list either referencing this message if anybody will have my same problems.

Really hopes this can help somebody else Smile

Thanks
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Merging fro a listserv
Next Topic: undefined constant "s" (bug or my bad understanding?)
Goto Forum:
  

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

Current Time: Fri Nov 22 14:26:53 GMT 2024

Total time taken to generate the page: 0.04379 seconds