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

Home » FUDforum » How To » Testing maillist.php to import mailing list message into forum
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Testing maillist.php to import mailing list message into forum [message #34648] Sat, 11 November 2006 20:46 Go to next message
Injaki is currently offline  Injaki   Spain
Messages: 3
Registered: November 2006
Location: Madrid (Spain)
Karma: 0
Junior Member
Hello,

I'm setting up a FUDforum system with Mailman mailing list integration.
On my way to understand why the mailing list messages are not being imported as expected, I've reach the phase to test the maillist.php script, so I did:

cat message |/home/retroacc/FUDforum/scripts/maillist.php 1

(also as cat message |php -q /home/retroacc/FUDforum/scripts/maillist.php 1)

and everything I obtain is the following output:

Quote:

Warning: preg_replace() [function.preg-replace]: Compilation failed: range out of order in character class at offset 13 in /home/retroacc/FUDforum/scripts/maillist.php on line 292
(/home/retroacc/FUDforum/include/theme/default/db.inc:73
/home/retroacc/FUDforum/include/theme/default/db.inc:177
/home/retroacc/FUDforum/include/theme/default/imsg_edt.inc:113
/home/retroacc/FUDforum/scripts/maillist.php:496
) 1048: Column 'subject' cannot be null
Query: INSERT INTO fud26_msg ( thread_id, poster_id, reply_to, ip_addr, host_name, post_stamp, subject, attach_cnt, poll_id, icon, msg_opt, file_id, foff, length, file_id_preview, offset_preview, length_preview, mlist_msg_id, poll_cache, flag_cc, flag_country ) VALUES( 0, 6, 0, '62.151.11.163', NULL, 1163273129, NULL, 0, 0, NULL, 3, 20000, 7048, 23, 0, 0, 0, '455623A9(dot)6060508(at)ya(dot)com', NULL, NULL, NULL )
_GET: array ( 1 => '', )
Server Version: 4.1.21-standard-log



The subject line of the message is never NULL, so I'm not sure why the script complains about that.

Any suggestion about what to look for next?

Thank you very much


Injaki

----------------------------------

PS: just in case it is important, this is the email message I'm using in the test (real email addresess stripped out)

Quote:

From sender(at)home(dot)com Sat Nov 11 12:25:33 2006
Return-path: <sender(at)home(dot)com>
Envelope-to: dest(at)lists(dot)domain(dot)org
Delivery-date: Sat, 11 Nov 2006 12:25:33 -0700
Received: from smtp06.ya.com ([62.151.11.163] helo=smtpauth.ya.com)
by box187.bluehost.com with esmtp (Exim 4.52)
id 1GiyTt-0006q9-4f
for dest(at)lists(dot)domain(dot)org; Sat, 11 Nov 2006 12:25:33 -0700
Received: from [84.76.84.120] (helo=[192.168.1.2])
by smtpauth.ya.com with asmtp id 1GiyTq-0002xO-00
for dest(at)lists(dot)domain(dot)org; Sat, 11 Nov 2006 20:25:30 +0100
Message-ID: <455623A9(dot)6060508(at)home(dot)com>
Date: Sat, 11 Nov 2006 20:25:29 +0100
From: sender(at)home(dot)com <sender(at)home(dot)com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: es-es, es
MIME-Version: 1.0
To: dest(at)lists(dot)domain(dot)org
Subject: just testing
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

test body





Re: Testing maillist.php to import mailing list message into forum [message #34656 is a reply to message #34648] Sun, 12 November 2006 16:18 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
Can you send me the complete text of one message that the forum claims to have an empty subject in as a text file please.

FUDforum Core Developer
Re: Testing maillist.php to import mailing list message into forum [message #34661 is a reply to message #34656] Mon, 13 November 2006 01:34 Go to previous messageGo to next message
Injaki is currently offline  Injaki   Spain
Messages: 3
Registered: November 2006
Location: Madrid (Spain)
Karma: 0
Junior Member
Hello Ilia,

Sure I can send it to you, as well as I can thank you for your interest Smile

I've sent it via this forum private messagin system.

Thank you very much
(for your help and for this excellent piece of software)


Injaki
Re: Testing maillist.php to import mailing list message into forum [message #34665 is a reply to message #34661] Mon, 13 November 2006 15:01 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've received your message text and have passed it to maillist script which was able to import the message successfully. Based on the structure of the message I see nothing there that would prevent the forum from accurately parsing out the subject.

Do you per-chance have a regex filtering rule setup in your maillist import rules that could be clearing out the subject?


FUDforum Core Developer
Re: Testing maillist.php to import mailing list message into forum [message #34670 is a reply to message #34665] Mon, 13 November 2006 20:57 Go to previous messageGo to next message
Injaki is currently offline  Injaki   Spain
Messages: 3
Registered: November 2006
Location: Madrid (Spain)
Karma: 0
Junior Member
After several re-installs and some test, I've discovered why the maillist.php script wasn't working for me, it was just a case of misunderstanding of regexps. I'm not a programmer, so I'm not sure to be right; anyway here is what I've found:

The shown warning refers to clean_up_data() function in the script ("range out of order" warning). This function replaces input subject with a given replacement when matching a regexp, using the php preg_replace() function.
The fact is that in my import rule the regexp was [Retroaccion-JD] (as with the given [PHP] example in Subject Mangling section in Mailing list Manager). But it seems to me that the [Retroaccion-JD] regexp matches everything, so the subject was always replaced with the replacement (NULL string in my case). That could be the reason for the script trying to insert a message with NULL subject regardless of the message being imported.
Just reading a bit about regexp I substituted [Retroaccion-JD] with \[Retroaccion-JD\] and everything was ok.

This shows also that for the maillist.php scritp to work, the subject of the message being imported has not to be NULL (also after applying the Subject Mangling function), as I've tested afterwards, because no 'NULL-subjected' message can be imported into the forum at all. So the users of the mailing list has to be adviced not to send messages with blank Subject, or at least be sure that the Subject Mangling function leaves always at least a short string in the subject line.


Btw, I'm running the script with Files locked, not as advertised in Mailing List Manager page, and it is working. Why is necessary to unlock the forum files to execute maillist.php?

Thank you very much

[Updated on: Tue, 14 November 2006 09:38]

Report message to a moderator

Re: Testing maillist.php to import mailing list message into forum [message #34675 is a reply to message #34670] Tue, 14 November 2006 14:35 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
If it works, you don't need to do anything. I suspect it works because you are running PHP as cgi/fastcgi, so the php scripts executed from the webserver run under your username rather then that of the web server.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How can I register Users Automatically from my other php applications?
Next Topic: Don't want maillist.php to create new users
Goto Forum:
  

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

Current Time: Fri Nov 22 05:14:08 GMT 2024

Total time taken to generate the page: 0.02942 seconds