As I understand postfix in MIAB using rsyslog and it’s rotate mechanism.
Dovecot in other hand write logs directly to /var/log/mail.log (log_path=/var/log/mail.log) and if logs rotate, will continue writing logs to /var/log/mail.log.1 until reloaded or SIGHUP.
Anyway, in my case (v73), dovecot logs appear in /var/log/mail.log.1 and this is not as intended I think. Found posts in this forum about the same problem from year 2018 and apparently nothing has changed since …
Dovecot should log via rsyslog like postfix.
Indeed, you need to edit /etc/logrotate.d/rsyslog and add “/usr/bin/doveadm log reopen” to the postrotate section to get dovecot to write to the new mail.log file after rotation.
I understand this is only a problem if you don’t use mailinabox’s built-in backup functionality because otherwise it reloads dovecot every night anyway.
This is like dealing with the consequences.
Better way would be to force dovecot to log via syslog like postfix.
by replacing
log_path=/var/log/mail.log
with
log_path = syslog
syslog_facility = mail
in dovecot conf
I did that and logs still appear in mail.log, but rotating should be handled automatically by the syslog. Unfortunately, I don’t know how to insert that to MIAB install script to fix future releases…
Currently running by removing that line from the config. This would default to the syslog and seems to run fine.
1 Like
I don’t quite understand.
Did you remove that line manually and it works (what it probably does) or MIAB install should have removed/commented that line at the install automatically?
Point of my first post was not to find a solution, but reporting a bug, so it can be fixed in next release.
I still think that adding these syslog config directives would be better, because default behavior may change in the future. But that’s up to you…
Apologies for the confusion.
I found the definition of the log_path directive and made a manual change to my system, to see how it behaves. If satisfactory, a code change can be proposed. Main concern is if there is impact on the fail2ban log analyzer.
I prefer removing the line, as I think that would mean the least deviation from the default Ubuntu installation.
1 Like
Thank you.
One thing less to worry about …