File attachment upload fails (1.4.23 SVN)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

File attachment upload fails (1.4.23 SVN)

Timothy D Legg
Hello,

When I attach and add a file, I get an error message:

Could not move/copy file. File not attached

and each time I try, a new entry in /var/log/apache2/error.log is generated:

[Mon Jul 03 16:03:01.455914 2017] [:error] [pid 7204] [client
184.156.x.y:57053] PHP Warning:  file_exists(): open_basedir restriction
in effect.
File(/var/spool/squirrelmail/attach/nEXi661psD7IGoliHjmvpH82lZi52Wb8) is
not within the allowed path(s):
(/usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/etc/hostname:/etc/mailname)
in /usr/share/squirrelmail/src/compose.php on line 1470, referer:
https://www.sellfam.com/squirrelmail/src/compose.php?passed_id=9340&mailbox=INBOX&startMessage=1&passed_ent_id=0&smaction=reply

Before checking the logs, I relaxed the permissions on
/var/spool/squirrelmail/attach/ down to 777 for diagnostics.  I now
suspect that this is a bad interaction with PHP instead.  Lacking seeing
any recent postings on this topic, I suspect it's fair to raise it again
as a lot has probably evolved over the years.

I looked in /etc/php5/apache2/php.ini and found that open_basedir is not
set and holds no value.  So, I'm not certain what the restriction is that
Squirrelmail is finding.

Any ideas?

Raspbian Jessie (ARM)
PHP 5.6.30-0+deb8u1
Apache/2.4.10 (Raspbian)
SquirrelMail version 1.4.23 [SVN]

Thanks,

Timothy D Legg.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [hidden email]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: File attachment upload fails (1.4.23 SVN)

Paul Lesniewski


On 2017年07月03日 07:29, Timothy D Legg wrote:

> Hello,
>
> When I attach and add a file, I get an error message:
>
> Could not move/copy file. File not attached
>
> and each time I try, a new entry in /var/log/apache2/error.log is generated:
>
> [Mon Jul 03 16:03:01.455914 2017] [:error] [pid 7204] [client
> 184.156.x.y:57053] PHP Warning:  file_exists(): open_basedir restriction
> in effect.
> File(/var/spool/squirrelmail/attach/nEXi661psD7IGoliHjmvpH82lZi52Wb8) is
> not within the allowed path(s):
> (/usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/etc/hostname:/etc/mailname)
> in /usr/share/squirrelmail/src/compose.php on line 1470, referer:
> https://www.sellfam.com/squirrelmail/src/compose.php?passed_id=9340&mailbox=INBOX&startMessage=1&passed_ent_id=0&smaction=reply
>
> Before checking the logs, I relaxed the permissions on
> /var/spool/squirrelmail/attach/ down to 777 for diagnostics.  I now
> suspect that this is a bad interaction with PHP instead.  Lacking seeing
> any recent postings on this topic, I suspect it's fair to raise it again
> as a lot has probably evolved over the years.
>
> I looked in /etc/php5/apache2/php.ini and found that open_basedir is not
> set and holds no value.  So, I'm not certain what the restriction is that
> Squirrelmail is finding.

SquirrelMail is not finding anything; this is a PHP warning message and
thus a problem with your particular system configuration.  As far as I
know, there should be nothing different than the solutions already given
over the years on this mailing list, the SquirrelMail website and the
Internet in general.  If you don't find that setting enabled in your PHP
configuration file, you likely are not looking at the right
configuration file.

--
Paul Lesniewski
SquirrelMail Team
Please support Open Source Software by donating to SquirrelMail!
http://squirrelmail.org/donate_paul_lesniewski.php

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [hidden email]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: File attachment upload fails (1.4.23 SVN)

Timothy D Legg
>

Okay, I found something strange.  I suspected that it was a permission
problem and remembered assigning a very generous 777 permission onto
/var/spool/squirrelmail/attach/  and still had it fail.  That path was
what was expected by squirrelmail.

So when I humored you and followed the steps on:

https://www.howtoforge.com/community/threads/squirrelmail-could-not-move-copy-file-file-not-attached-when-trying-to-attach-a-fi.55043/

1) create directory in /usr/share/squirrelmail/ for example attach -
/usr/share/squirrelmail/attach
2) chmod 733 -R /usr/share/squirrelmail/attach
2) squirrelmail-configure
3) choose 4(General Options) and press Enter
4) choose 2(Attachment Directory) and past /usr/share/squirrelmail/attach

I got it to work, which was quite maddening because the steps were
equivalent, and these are more restrictive permissions, than what I had
done.

I verified the permission of the old attach folder in
/var/spool/squirrelmail/attach and saw that it was owned by root:www-data
and was assigned to permissions 730.  That tells me two things.  First of
all, the permissions I remembered applying didn't stick and apparently
whatever is editing the folder contents is not root nor in the www-data
group neither.  It also tells me that my generous 777 permissions aren't
there.

(I pattern searched for drwxrwxrwx from ls -Ral / and could not find that
I ever assigned permission 777 on any directory.  The chmod command wasn't
in .bash_history of my root or user account, so l can only guess I typed
it,  missed the enter key, and closed the term window)

Thanks for the affirmation that I was on the right track.

Timothy D Legg

>
> On 2017年07月03日 07:29, Timothy D Legg wrote:
>> Hello,
>>
>> When I attach and add a file, I get an error message:
>>
>> Could not move/copy file. File not attached
>>
>> and each time I try, a new entry in /var/log/apache2/error.log is
>> generated:
>>
>> [Mon Jul 03 16:03:01.455914 2017] [:error] [pid 7204] [client
>> 184.156.x.y:57053] PHP Warning:  file_exists(): open_basedir restriction
>> in effect.
>> File(/var/spool/squirrelmail/attach/nEXi661psD7IGoliHjmvpH82lZi52Wb8) is
>> not within the allowed path(s):
>> (/usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/etc/hostname:/etc/mailname)
>> in /usr/share/squirrelmail/src/compose.php on line 1470, referer:
>> https://www.sellfam.com/squirrelmail/src/compose.php?passed_id=9340&mailbox=INBOX&startMessage=1&passed_ent_id=0&smaction=reply
>>
>> Before checking the logs, I relaxed the permissions on
>> /var/spool/squirrelmail/attach/ down to 777 for diagnostics.  I now
>> suspect that this is a bad interaction with PHP instead.  Lacking seeing
>> any recent postings on this topic, I suspect it's fair to raise it again
>> as a lot has probably evolved over the years.
>>
>> I looked in /etc/php5/apache2/php.ini and found that open_basedir is not
>> set and holds no value.  So, I'm not certain what the restriction is
>> that
>> Squirrelmail is finding.
>
> SquirrelMail is not finding anything; this is a PHP warning message and
> thus a problem with your particular system configuration.  As far as I
> know, there should be nothing different than the solutions already given
> over the years on this mailing list, the SquirrelMail website and the
> Internet in general.  If you don't find that setting enabled in your PHP
> configuration file, you likely are not looking at the right
> configuration file.
>
> --
> Paul Lesniewski
> SquirrelMail Team
> Please support Open Source Software by donating to SquirrelMail!
> http://squirrelmail.org/donate_paul_lesniewski.php
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> -----
> squirrelmail-users mailing list
> Posting guidelines: http://squirrelmail.org/postingguidelines
> List address: [hidden email]
> List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
> List info (subscribe/unsubscribe/change options):
> https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [hidden email]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
Loading...