File Manager - EMAIL BUG

davidd1

Verified User
Joined
Jan 31, 2013
Messages
104
hello and sorry for my English.

I have DA version 1.44 & custombuild 2 (last version) with this:

php1_release=5.3
php2_release=no
php1_mode=mod_php
php2_mode=php-fpm

apache_ver=2.4
mod_ruid2=yes

AND when i go to File Manager i see dir - ".php" in all domains
in this dir there are the files:
php-mail.log
php-mail.log.1
php-mail.log.2
php-mail.log.3
and more....

but all the files are empty becuase i need to Reset Owner
UID = user name
GID = apache
Perm. = 660

any help ?
 
There should be a button in file manager to reset the ownership of files.
 
hello,

I know the button but i have 1000 useres in my server i cant go to each user and do this.
i think it's bug in directadmin. no?
 
I konw this help, but it's not help me because 2 think:

1. When i open new domain it will be

2. in the ".php" dir the system create new files every week like
php-mail.log
php-mail.log.1
php-mail.log.2
php-mail.log.3
and all the new files need to set premission.
 
Hello,

Thanks for the report.

The php-mail.log.N files don't matter as much, they're already rotated out.
The main concern will be the single file php-mail.log

1) Which OS are you using?

2) When the permissions are incorrect, what are those permissions?

3) The tally will rotate the old files, and touch a new new one, and reset the permissions/ownership on it.
For more info, try running the tally for one sample User, debug level 2000, so we can try and see if anything else is going on.
Code:
cd /usr/local/directadmin
echo "action=tally&value=[B]username[/B]&type=user" >> data.task.queue && ./dataskq d2000
and paste us the output... of course, hide any sensitive info with XXXXX that you might not wish to share.

4) Check:
/var/log/directadmin/errortaskq.log
for any other clues during the tally.

John
 
hello

1. Linux 2.6.18-348.18.1.el5 #1 SMP Thu Sep 26 15:01:07 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
#cat /etc/*release: CentOS release 5.9 (Final)

2. UID = the user name
GID = apache

i think here is the bug because i have custombuild2 with mod_ruid2 so the GID can't be apache.

3. [root@server directadmin]# echo "action=tally&value=XXXXXXX&type=user" >> data.task.queue && ./dataskq d2000
Debug mode. Level 2000root priv set: uid:0 gid:0 euid:0 egid:0
pidfile written
staring queue
done queue

(Q: after i do this i need to do something ?? like to run it again without the debug level ?? help??)


4. empty file no ERRORS!

-------------------------------------

after i do all this the dir ".php" is still PREM. 770 AND UID=username AND GID=apache
 
I'm scratching my head..
Just tested on our CentOS 5 box, apache 2.4.6 mod_ruid2, php 5.5.5.. (no, we don't own es5.com, just an internal testing domain)

Get the following after sending a message:
Code:
[root@es5 .php]# ls -la
total 16
drwxrwx---  2 admin apache 4096 Nov 14 00:10 .
drwx--x--x 21 admin admin  4096 Nov  8 16:42 ..
-rw-rw----  1 admin apache  141 Nov 14 19:24 php-mail.log
-rw-rw----  1 admin apache    0 Nov 13 00:10 php-mail.log.1
-rw-rw----  1 admin apache    0 Nov 12 00:10 php-mail.log.2
-rw-rw----  1 admin apache    0 Nov 11 00:10 php-mail.log.3
-rw-rw----  1 admin apache    0 Nov 10 00:10 php-mail.log.4
[root@es5 .php]# cat php-mail.log
mail() on [/home/admin/domains/es5.com/public_html/mail.php:2]: To: [email protected] -- Headers: From: [email protected]  Return-path: [email protected]
[root@es5 .php]#

Apache is the intended group. The file can be written as the User or apache, it shouldn't matter.
This will handle php being in cli, without mod_ruid2, or any of the other combinations where php runs as the User.


To to confirm, your settings look identical, but your php-mail.log isn't able to fill up?
I'm still not on what you're changing your settings from and to... as "user:apache" is correct.

Note, I am using a change for the next release of DA which could affect this:
http://www.directadmin.com/features.php?id=1514

If you install the pre-release binaries, you'll be using the same templates that I am, to rule that out as a cause:
http://help.directadmin.com/item.php?id=408

John
 
BTW: I have this bug with 3 severs linux 64bit and 32bit all kind of centos.


If it's help here my options.conf:

#PHP settings.
#Default version of PHP is always php1_release. Possible values for php1/php2_release: 5.3, 5.4, 5.5, no. php1/php2_mode: mod_php, fastcgi, php-fpm or suphp)
php1_release=5.3
php2_release=no
php1_mode=mod_php
php2_mode=php-fpm
htscanner=yes
php_ini=no
php_timezone=IDT
#Possible values - production or development
php_ini_type=production
ioncube=no
zend=no
#HTTP server. Possible values: apache, nginx
webserver=apache

#Apache settings
#Possible value: 2.4
apache_ver=2.4
mod_ruid2=yes
secure_htaccess=no
harden-symlinks-patch=yes
use_hostname_for_alias=no
redirect_host=server.XXXXXX.XXXXX
redirect_host_https=no

#Possible values - 5.1, 5.5, 5.6
mysql=5.6
mysql_inst=yes
mysql_backup=yes
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups

#Web applications
phpmyadmin=yes
phpmyadmin_ver=4
squirrelmail=yes
roundcube=yes

AND MORE...

if you can plz help me with my q in part 3 (UP)
(Q: after i do this i need to do something ?? like to run it again without the debug level ?? help??)



i don't like to install the pre-release so i will wait to the final 1.441 and i will tell you if it's help.

thank you very very much !
 
Hello,

Tested with php 5.3 as well, but same difference.. mail() logs entries into the php-mail.log, with the permissions as described.

When the log is in a state where nothing is being added to it, please paste us the following output:
Code:
cd /home/[B]username[/B]/.php
ls -la
cd ..
ls -lad .
cd ..
ls -lad .

For question 3, sorry there was a typo. It should be:
Code:
cd /usr/local/directadminecho "action=tally&value=username&type=user" >> da[B]ta/ta[/B]sk.queue && ./dataskq d2000
John
 
[root@server .php]# ls -la
total 8
drwxrwx--- 2 XXXXX apache 4096 Nov 15 00:10 .
drwx--x--- 6 XXXXXaccess 4096 Sep 27 16:49 ..
-rw-rw---- 1 XXXXX apache 0 Nov 15 00:10 php-mail.log
-rw-rw---- 1 XXXXX apache 0 Nov 14 12:31 php-mail.log.1
-rw-rw---- 1 XXXXX apache 0 Nov 14 00:10 php-mail.log.2
-rw-rw---- 1 XXXXX apache 0 Nov 13 00:10 php-mail.log.3
-rw-rw---- 1 XXXXX apache 0 Nov 12 00:10 php-mail.log.4
[root@server .php]# cd ..
[root@server XXXXX]# ls -lad .
drwx--x--- 6 XXXXX access 4096 Sep 27 16:49 .
[root@server XXXXX]# cd ..
[root@server home]# ls -lad .
drwxr-xr-x 70 root root 4096 Sep 17 00:47 .
[root@server home]#




you want me to run this ?

cd /usr/local/directadmin
echo "action=tally&value=username&type=user" >> data/task.queue && ./dataskq d2000
 
Hello,

There is not point in running the tally, as those permissions are exactly what it's going for.

Have you confirmed your user httpd.conf files have the required settings?
http://www.directadmin.com/features.php?id=1498

eg:
Code:
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'
php_admin_value mail.log /home/admin/.php/php-mail.log
php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/
John
 
Thank you
the problem solved

there are no value "php_mail_log=1" in my directadmin.conf.

when directadmin is update why you don't add the new value into the file auto ?
 
Hello,

It's an internal default.
If you remove it from the directadmin.conf, it should still show up when you type:
Code:
cd /usr/local/directadmin
./directadmin c| grep php_mail_log
John
 
Back
Top