Testing maillist.php to import mailing list message into forum [message #34648] |
Sat, 11 November 2006 20:46 |
Injaki
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)
|
|
|
|
|
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 |
Ilia
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 |
Injaki
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
|
|
|
|