php_mail_log_dir=|HOME|/.php (TEMPLATES)

Version 1.61.0

Feature
Finished

New internal value: php_mail_log_dir=NULL which is unset and not in the directadmin.conf at all. To reset it to the NULL default, ensure the php_mail_log_dir line is fully removed from the conf/directadmin.conf. If you add any string, even an empty value like "php_mail_log_dir=" this will be used (don't add an empty value) This feature allows you to override the /home/user/.php folder to use some other location, in the event your clients have a habit of deleting their logs, eg: php_mail_log_dir=|HOME|/.php which would be the same as the default we already have now. ============ TOKENS Available tokens for this value: USERNAME and HOME So if you wanted to store them elsewhere, like: /var/log/php-mail-logs/fred/php-mail.log You could use: php_mail_log_dir=/var/log/php-mail-logs/|USERNAME| ============ PERMISSIONS Note that DirectAdmin assumes the directory has permission to be created while running as the User. As such, the parent folder must exist and be controllable by the User ahead of time. In the above example, this would not be true, so using a hook like: /usr/local/directadmin/scripts/custom/user_create_post/php_mail_log.sh #!/bin/sh D=/var/log/php-mail-logs/$username mkdir -p $D chown $username:apache $D chmod 770 $D exit 0; would be needed. Post-cleanup might be required too: /usr/local/directadmin/scripts/custom/user_destroy_post/php_mail_log.sh #!/bin/sh D=/var/log/php-mail-logs/$username rm -f $D exit 0; and chmod your scripts to 700. ============ ROTATION Similar to permissions, rotaton of the php-mail.log file will be done as the User, hence the importance of this directory being writable by the User. ============ TEMPLATES openlitespeed_vhost.conf php-cron.ini php-fpm.conf unit_application.json user_virtual_host.conf virtual_host2.conf virtual_host2_secure.conf virtual_host2_sub.conf virtual_host2_secure_sub.conf Replaces: `HOME`/.php/php-mail.log with: `PHP_MAIL_LOG_DIR`/php-mail.log ----- T25729

Try DirectAdmin with a 30-day money back guarantee!