can't get attachments to work when piping from mail [message #12866] |
Mon, 15 September 2003 06:35 |
mhucka
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 .
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 |
Ilia
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 #13089 is a reply to message #12866] |
Mon, 22 September 2003 14:10 |
Ilia
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 |
mhucka
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 774 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 |
Ilia
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 |
mhucka
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 #13126 is a reply to message #13124] |
Mon, 22 September 2003 20:25 |
mhucka
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 #13136 is a reply to message #13135] |
Tue, 23 September 2003 02:13 |
Ilia
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
|
|
|