Re: Trouble with attachment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 4, 2008 at 2:18 AM, Olivier MOULIN <olivier@xxxxxxxx> wrote:
>
>>>  I still my trouble with attachment.
>>
>> Still?  You may want to reference any previous threads about the issue.
>>
>>> When I attach a file that's working but when I remove the file I have
>>> the
>>> folling error :
>>>
>>> Warning: filesize(): Stat failed for
>>> /var/spool/squirrelmail/attach/GAWMNA7NwMTIbEq1y06EW63SS4SuojjN (errno=2
>>> -
>>> No such file or directory) in /var/www/squirrelmail/src/compose.php on
>>> line 1240
>>>
>>> The file is deleted in the directory but it's still appear in the list
>>> on
>>> the compose windows.
>>>
>>> I though this trouble will be solve with the squirrelmail last version
>>> but
>>> not...
>>
>> No one else has reported this issue, it works for the rest of us
>> apparently, so there is no reason to think that the code would
>> magically change just for you without you telling us what the problem
>> is.
>>
>>>From the sound of it, it's not a problem removing the file from disk,
>> but that SM seems to think it's still there - as if the unset() of the
>> attachment didn't work.  For starters, apply this patch to
>> src/compose.php and show the output it generates when you delete an
>> attachment.  You can apply the patch manually by finding the code
>> lines referenced here and adding the lines prefixed with the + sign
>> (two of them).
>
> Below the result :
>
> Array
> (
>    [0] => 0
> )
>
> message Object
> (
>    [rfc822_header] => rfc822header Object
>        (
>            [date] => -1
>            [date_unparsed] =>
>            [subject] =>
>            [from] => Array
>                (
>                )
>
>            [sender] =>
>            [reply_to] => Array
>                (
>                )
>
>            [mail_followup_to] => Array
>                (
>                )
>
>            [to] => Array
>                (
>                )
>
>            [cc] => Array
>                (
>                )
>
>            [bcc] => Array
>                (
>                )
>
>            [in_reply_to] =>
>            [message_id] =>
>            [references] =>
>            [mime] =>
>            [content_type] =>
>            [disposition] =>
>            [xmailer] =>
>            [priority] => 3
>            [dnt] =>
>            [encoding] =>
>            [mlist] => Array
>                (
>                )
>
>            [x_spam_status] => Array
>                (
>                )
>
>            [more_headers] => Array
>                (
>                )
>
>        )
>
>    [reply_rfc822_header] =>
>    [mime_header] =>
>    [flags] =>
>    [type0] =>
>    [type1] =>
>    [entities] => Array
>        (
>            [0] => message Object
>                (
>                    [rfc822_header] =>
>                    [reply_rfc822_header] =>
>                    [mime_header] => messageheader Object
>                        (
>                            [type0] => text
>                            [type1] => plain
>                            [parameters] => Array
>                                (
>                                    [name] => Nouveau Document texte.txt
>                                )
>
>                            [id] => 0
>                            [description] =>
>                            [encoding] =>
>                            [size] => 0
>                            [md5] =>
>                            [disposition] => disposition Object
>                                (
>                                    [name] => attachment
>                                    [properties] => Array
>                                        (
>                                            [filename] => Nouveau Document
> texte.txt
>                                        )
>
>                                )
>
>                            [language] =>
>                        )
>
>                    [flags] =>
>                    [type0] =>
>                    [type1] =>
>                    [entities] => Array
>                        (
>                        )
>
>                    [entity_id] =>
>                    [parent_ent] =>
>                    [entity] =>
>                    [parent] =>
>                    [decoded_body] =>
>                    [is_seen] => 0
>                    [is_answered] => 0
>                    [is_deleted] => 0
>                    [is_flagged] => 0
>                    [is_mdnsent] => 0
>                    [body_part] =>
>                    [offset] => 0
>                    [length] => 0
>                    [att_local_name] => 7EWq55thNK7uFCVUmtEhkKgBbNxsaG8p
>                )
>
>        )
>
>    [entity_id] =>
>    [parent_ent] =>
>    [entity] =>
>    [parent] =>
>    [decoded_body] =>
>    [is_seen] => 0
>    [is_answered] => 0
>    [is_deleted] => 0
>    [is_flagged] => 0
>    [is_mdnsent] => 0
>    [body_part] =>
>    [offset] => 0
>    [length] => 0
>    [att_local_name] =>
> )
>
>
> ==================================================================
> message Object
> (
>    [rfc822_header] => rfc822header Object
>        (
>            [date] => -1
>            [date_unparsed] =>
>            [subject] =>
>            [from] => Array
>                (
>                )
>
>            [sender] =>
>            [reply_to] => Array
>                (
>                )
>
>            [mail_followup_to] => Array
>                (
>                )
>
>            [to] => Array
>                (
>                )
>
>            [cc] => Array
>                (
>                )
>
>            [bcc] => Array
>                (
>                )
>
>            [in_reply_to] =>
>            [message_id] =>
>            [references] =>
>            [mime] =>
>            [content_type] =>
>            [disposition] =>
>            [xmailer] =>
>            [priority] => 3
>            [dnt] =>
>            [encoding] =>
>            [mlist] => Array
>                (
>                )
>
>            [x_spam_status] => Array
>                (
>                )
>
>            [more_headers] => Array
>                (
>                )
>
>        )
>
>    [reply_rfc822_header] =>
>    [mime_header] =>
>    [flags] =>
>    [type0] =>
>    [type1] =>
>    [entities] => Array
>        (
>            [0] => message Object
>                (
>                    [rfc822_header] =>
>                    [reply_rfc822_header] =>
>                    [mime_header] => messageheader Object
>                        (
>                            [type0] => text
>                            [type1] => plain
>                            [parameters] => Array
>                                (
>                                    [name] => Nouveau Document texte.txt
>                                )
>
>                            [id] => 0
>                            [description] =>
>                            [encoding] =>
>                            [size] => 0
>                            [md5] =>
>                            [disposition] => disposition Object
>                                (
>                                    [name] => attachment
>                                    [properties] => Array
>                                        (
>                                            [filename] => Nouveau Document
> texte.txt
>                                        )
>
>                                )
>
>                            [language] =>
>                        )
>
>                    [flags] =>
>                    [type0] =>
>                    [type1] =>
>                    [entities] => Array
>                        (
>                        )
>
>                    [entity_id] =>
>                    [parent_ent] =>
>                    [entity] =>
>                    [parent] =>
>                    [decoded_body] =>
>                    [is_seen] => 0
>                    [is_answered] => 0
>                    [is_deleted] => 0
>                    [is_flagged] => 0
>                    [is_mdnsent] => 0
>                    [body_part] =>
>                    [offset] => 0
>                    [length] => 0
>                    [att_local_name] => 7EWq55thNK7uFCVUmtEhkKgBbNxsaG8p
>                )
>
>        )
>
>    [entity_id] =>
>    [parent_ent] =>
>    [entity] =>
>    [parent] =>
>    [decoded_body] =>
>    [is_seen] => 0
>    [is_answered] => 0
>    [is_deleted] => 0
>    [is_flagged] => 0
>    [is_mdnsent] => 0
>    [body_part] =>
>    [offset] => 0
>    [length] => 0
>    [att_local_name] =>
> )

Thanks.  So, as you can see, the unset() call seems to do nothing.
Why don't you try copying the 2nd debug line and putting a copy of it
immediately after the unset call, a couple lines up and see what you
get (three debug lines should be in the code now).

AFTER you post back the results from that, put this line immediately
following the third debug line:

unset($composeMessage->entities[0]);

And see if that helps.

What I'm trying to play with is if there is some strange scope issue,
but really, there shouldn't be any scope problems, as this code is
straight forward.  The unset() just plain does not work on your system
is what it looks like to me, and that's not a SquirrelMail issue as
far as I can tell.  What PHP version are you running?  Did you compile
it yourself?  Does it have anything unusual about it?

>> Index: src/compose.php
>> ===================================================================
>> --- src/compose.php     (revision 13307)
>> +++ src/compose.php     (working copy)
>> @@ -585,12 +585,14 @@
>>      }
>>
>>      if (isset($delete) && is_array($delete)) {
>> +sm_print_r($delete, $composeMessage);
>>          foreach($delete as $index) {
>>              if (!empty($composeMessage->entities) &&
>> isset($composeMessage->entities[$index])) {
>>                  $composeMessage->entities[$index]->purgeAttachments();
>>                  unset ($composeMessage->entities[$index]);
>>              }
>>          }
>> +sm_print_r('==================================================================',
>> $composeMessage);
>>          $new_entities = array();
>>          foreach ($composeMessage->entities as $entity) {
>>              $new_entities[] = $entity;
>>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux