Ver Fonte

2868 [Bug] Missing logrotate config file for Roundcube logs (#2904)

* #2868 Create logrotate config for roundcube

* Add info message

* Clean up session when mail-wrapper.php runs
Jaap Marcus há 3 anos atrás
pai
commit
5a0a002197

+ 7 - 0
install/deb/logrotate/roundcube

@@ -0,0 +1,7 @@
+/var/log/roundcube/*.log {
+    rotate 12
+    monthly
+    missingok
+    notifempty
+    create 644 www-data www-data
+}

+ 7 - 0
install/rpm/logrotate/roundcube

@@ -0,0 +1,7 @@
+/var/log/roundcube/*.log {
+    rotate 12
+    monthly
+    missingok
+    notifempty
+    create 644 www-data www-data
+}

+ 8 - 1
install/upgrade/versions/1.6.8.sh

@@ -36,4 +36,11 @@ for version in $($HESTIA/bin/v-list-sys-php plain); do
     sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /etc/php/$version/fpm/php.ini
     sed -i "s/post_max_size = 8M/post_max_size = 100M/g" /etc/php/$version/fpm/php.ini
     sed -i "s/max_execution_time = 30$/max_execution_time = 60/g" /etc/php/$version/fpm/php.ini    
-done
+done
+
+if [ -d /etc/roundcube ]; then 
+    if [ ! -f /etc/logrotate.d/roundcube ]; then
+        echo "[ * ] Create config roundcube logrotate file"
+        cp -f $HESTIA_INSTALL_DIR/logrotate/roundcube /etc/logrotate.d/
+    fi
+fi

+ 2 - 0
web/inc/mail-wrapper.php

@@ -39,3 +39,5 @@ $mailtext = file_get_contents("php://stdin");
 if ((!empty($to)) && (!empty($subject))) {
     send_email($to,$subject,$mailtext,$from, $from_name);
 }
+
+session_destroy();