Explorar o código

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 %!s(int64=3) %!d(string=hai) anos
pai
achega
1e2c9d2bc8

+ 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
+}

+ 7 - 0
install/upgrade/versions/1.6.8.sh

@@ -42,4 +42,11 @@ done
 if [ -f "$HESTIA/data/api/sync-dns-cluster" ]; then
     rm $HESTIA/data/api/sync-dns-cluster
     cp $HESTIA/install/deb/api/sync-dns-cluster $HESTIA/data/api/sync-dns-cluster
+fi
+
+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();