Redirect roundcube logs to syslog

This commit is contained in:
Myve 2024-08-19 02:08:47 +00:00
commit 41e5941d01
3 changed files with 10 additions and 21 deletions

View file

@ -22,7 +22,7 @@ ${reset}"
}
# Reset logs
echo | tee /var/log/maillog /usr/share/webapps/roundcube/logs/errors.log >/dev/null
echo | tee /var/log/maillog /var/log/maillog.debug >/dev/null
syslogd -O /var/log/maillog
# Run all scripts in init folder
@ -37,4 +37,4 @@ postfix reload &&
echo -e "\n\e[1;32mMail service is ready\e[0m\n"
# Monitor log
tail -f /var/log/maillog /usr/share/webapps/roundcube/logs/errors.log
tail -f /var/log/maillog

View file

@ -15,6 +15,10 @@ echo "<?php
\$config['create_default_folders'] = true;
\$config['support_url'] = '';
# Logging
\$config['log_driver'] = 'syslog';
\$config['syslog_facility'] = \LOG_MAIL;
\$config['des_key'] = '$(cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 24 | head -n 1)';
\$config['plugins'] = [$(printf "'%s', " $(ls /usr/share/webapps/roundcube/plugins | grep -v 'enigma\|database_attachments\|managesieve\|redundant_attachments') | sed "s/\(.*\), /\1/")];" | tee /usr/share/webapps/roundcube/config/config.inc.php >/dev/null
@ -37,21 +41,3 @@ chmod 0600 /usr/share/webapps/roundcube/plugins/password/config.inc.php
# Start services
/usr/sbin/php-fpm* -D
nginx
# <<- ##appendix
# \$config['imap_conn_options'] = array(
# 'ssl' => array(
# 'verify_peer' => true,
# 'verify_peer_name' => true,
# 'allow_self_signed' => true,
# ),
# );
#
# \$config['smtp_conn_options'] = array(
# 'ssl' => array(
# 'verify_peer' => true,
# 'verify_peer_name' => true,
# 'allow_self_signed' => true,
# ),
# );
# ##appendix

View file

@ -486,4 +486,7 @@ cp /usr/local/bin/postwhite/postwhite.conf /etc
#// Syslog
#//
###############
echo 'mail.* /var/log/maillog' >/etc/syslog.conf
cat >/etc/syslog.conf <<- 'syslog.conf'
mail.info /var/log/maillog
mail.* /var/log/maillog.debug
syslog.conf