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

Home » FUDforum » FUDforum Installation Issues » can't get attachments to work when piping from mail
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
can't get attachments to work when piping from mail [message #12866] Mon, 15 September 2003 06:35 Go to next message
mhucka is currently offline  mhucka   United States
Messages: 8
Registered: September 2003
Location: Pasadena, CA, USA
Karma: 0
Junior Member
First, let me say that FUDforum is incredible. I've just spent 2 days trying out a number of email-aware forum systems and FUDforum is by far the best.

I'm still learning how to use it, so the following is probably a problem due to my ignorance. I'm trying to populate a forum using a saved mbox of messages to a mailing list. As far as I understand it, I should be able to pipe an individual email message to the maillist.php script, as follows:

cat msg | /var/www/html/sbml/FUDforums/scripts/maillist.php 1

(Here 'msg' is a saved message in standard unix mailbox format.) Everything *almost* works, except for one thing: attachments in the messages don't show up at all on the web page. You can see an example here:

http://www.sbml.org/forums/index.php?t=msg&th=7&start=0&rid=2

You can find the original message text file here:

ftp://ftp.cds.caltech.edu/pub/mhucka/msg

I've tested posting and attaching messages via the web interface, and sure enough, attachments *do* show up fine, as you can see from the following example:

http://www.sbml.org/forums/index.php?t=msg&th=6&start=0&rid=2

So it appears the forum configuration is good, and attachments are working -- just not when I use maillist.php. Yet looking in the code in maillist.php and the scripts it invokes, it does look like there's code to parse attachments in there. So after several hours of configuring, reconfiguring, testing and thinking, I have to give up and call on a higher authority Smile.

Please let me know your suggestions about what might be going wrong, and sorry to waste your time if I'm just doing something really stupid. You can tell me to RTFM, but please tell me which M to R, and where in it I should look.

In case it's useful, here are some stats on the installation:
System Configuration

PHP built On: Linux daffy.perf.redhat.com 2.4.20-2.48smp #1 SMP Thu Feb 13 11:44:55 EST 2003 i686 i686 i386 GNU/Linux
Database Version: 3.23.56
PHP Version: 4.2.2
Web Server: Apache
WebServer to PHP interface: apache2filter
Forum Version: 2.5.2
Relavent PHP Settings:
Safe Mode: OFF
Open basedir: none
Display Errors: ON
File Uploads: ON
Magic Quotes: ON
Register Globals: ON
Output Buffering: OFF
Disabled Functions: none
PSpell Support: Yes



Re: can't get attachments to work when piping from mail [message #12911 is a reply to message #12866] Thu, 18 September 2003 14:31 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
The 1st and most basic questions is:
1) Did you allow the forum to import file attachments from e-mail messages? (check the import rules)
2) Does the forum you are importing messages to allow file attachments?

If you've answered YES to both questions and still having a problem, please attach 1 or 2 sample messages that you have difficulty importing and I'll look into solving this problem.


FUDforum Core Developer
Re: can't get attachments to work when piping from mail [message #13084 is a reply to message #12911] Mon, 22 September 2003 08:49 Go to previous messageGo to next message
mhucka is currently offline  mhucka   United States
Messages: 8
Registered: September 2003
Location: Pasadena, CA, USA
Karma: 0
Junior Member
Hi,

Thank you for taking the time to reply. Regarding your questions:

> The 1st and most basic questions is:
> 1) Did you allow the forum to import file attachments from e-mail messages? (check the import rules)

I assume this is referring to the settings for the forum in the "Category & Forum Management" area? In that page for the forum, the Max Number of File Attachments is set to 10. You can see a screenshot of this form at http://www.cds.caltech.edu/~mhucka/forum-setting.gif

> 2) Does the forum you are importing messages to allow file attachments?

Yes, the "Allow Mailing List Attachments" flag is "yes".

As another view of the settings, you can see the group manager screenshot at http://www.cds.caltech.edu/~mhucka/group-manager.gif

Are these the right places to look for the settings you asked about? I had tried to make sure everything is set to allow attachments, but it wouldn't be surprising if I still got it wrong somewhere.

Attached is an example message that isn't getting imported properly.

Thanks for your help.

Mike
  • Attachment: msg.txt
    (Size: 327.58KB, Downloaded 11428 times)
Re: can't get attachments to work when piping from mail [message #13089 is a reply to message #12866] Mon, 22 September 2003 14:10 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 just tried the message in question and it imported fine into my test forum.
The result was a text message with a 240.17KB arrays.pdf attachment. I was able to open the attachment and see that it's a valid PDF file my acrobar reader has no problems reading.


FUDforum Core Developer
Re: can't get attachments to work when piping from mail [message #13119 is a reply to message #13089] Mon, 22 September 2003 19:27 Go to previous messageGo to next message
mhucka is currently offline  mhucka   United States
Messages: 8
Registered: September 2003
Location: Pasadena, CA, USA
Karma: 0
Junior Member
Thank you for your help. It's good news that the message imports into a forum for you. Perhaps the problem is my command-line invocation? I've been testing it using the following:

cat ~/msg | /var/www/html/sbml/FUDforums/scripts/maillist.php 1

I did this based on the example code for using procmail (which is what I'll ultimately have to use to link our mailing list into the forum). The above runs without errors, and enters the message into the forum, but without the attachments.

If the command above looks ok too, then I can only imagine the difference is in a configuration parameter somewhere. Is there some way I could dump out all the configuration information and send it to you, and have you look at it and make sure there's not some flag set incorrectly? I've attached GLOBALS.php here, but I don't know if it provides all the info you need. If there's some other file that provides other necessary information, please let me know where to find it and I'll send it along too.
  • Attachment: globals.php
    (Size: 5.59KB, Downloaded 776 times)
Re: can't get attachments to work when piping from mail [message #13120 is a reply to message #13119] Mon, 22 September 2003 19:33 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
You have another control panel, which controls the settings of the actual import rules "Mailing List Manager". In that control panel you have an option called: " Allow Mailing List Attachments" I am betting it is set to NO.

No settings inside GLOBALS.php would affect the file attachments inside message imported by maillist.php.


FUDforum Core Developer
Re: can't get attachments to work when piping from mail [message #13123 is a reply to message #13120] Mon, 22 September 2003 19:57 Go to previous messageGo to next message
mhucka is currently offline  mhucka   United States
Messages: 8
Registered: September 2003
Location: Pasadena, CA, USA
Karma: 0
Junior Member
Quote:

You have another control panel, which controls the settings of the actual import rules "Mailing List Manager". In that control panel you have an option called: " Allow Mailing List Attachments" I am betting it is set to NO.



No, unfortunately, that's not it; the setting for the forum itself is "yes". You can see a screenshot here: http://www.cds.caltech.edu/~mhucka/mail-list.gif

Those are the settings for rule 1. Note that when I first open the mailing list manager page, it's set to off, but that appears to be because when you first go to that page, you're faced with a blank form, ready for a new definition, and not an existing rule. I have to go to the bottom, find the rule for the sbml-discuss forum (it's the only one), and click on "Edit", and then I get the screen that you see in the screenshot.

MH
Re: can't get attachments to work when piping from mail [message #13124 is a reply to message #13123] Mon, 22 September 2003 19:58 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
Is the files/ directory writeable by the user you are trying to import messages as?

FUDforum Core Developer
Re: can't get attachments to work when piping from mail [message #13126 is a reply to message #13124] Mon, 22 September 2003 20:25 Go to previous messageGo to next message
mhucka is currently offline  mhucka   United States
Messages: 8
Registered: September 2003
Location: Pasadena, CA, USA
Karma: 0
Junior Member
Quote:

Is the files/ directory writeable by the user you are trying to import messages as?


I've been running the test command as root, and yes, I did check that the directory is writable to root. (It's actually owned by the http process owner, and writing attachments in other situations works.)

MH

[Updated on: Mon, 22 September 2003 20:33]

Report message to a moderator

Re: can't get attachments to work when piping from mail [message #13130 is a reply to message #13126] Mon, 22 September 2003 23:26 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
Right below the "// Handle File Attachments" line in maillist.php
try adding:
var_dump(array_keys($emsg->attachments));


FUDforum Core Developer
Re: can't get attachments to work when piping from mail [message #13135 is a reply to message #13130] Tue, 23 September 2003 02:10 Go to previous messageGo to next message
mhucka is currently offline  mhucka   United States
Messages: 8
Registered: September 2003
Location: Pasadena, CA, USA
Karma: 0
Junior Member
OK, did that, and here's the output:

69 erato2 [sbml/FUDforums/scripts]# cat ~/msg | /var/www/html/sbml/FUDforums/scripts/maillist.php 1
<br />
<b>Warning</b>: First argument to array_keys() should be an array in <b>/var/www/html/sbml/FUDforums/scripts/maillist.php</b> on line <b>435</b><br />
NULL

I don't know any PHP, but this sounds like the variable may emsg->attachments may not have a value.

Is there some way to make PHP print everything it does, line by line, like the -X flag to csh? It might be useful to see everything it's trying to do.

MH
Re: can't get attachments to work when piping from mail [message #13136 is a reply to message #13135] Tue, 23 September 2003 02:13 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Looks like on your system it is failing to parse the files out of the message... very strange...

There is no -X like flag, but you can sprinkle the code with your own debug statments (just be sure to make a backup of the original file).

Put some debug code inside decode_body() method.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Installation Problem : Fatal Error - Please Help
Next Topic: Upgrade question
Goto Forum:
  

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

Current Time: Thu Nov 28 03:06:57 GMT 2024

Total time taken to generate the page: 0.02382 seconds