My /var/log/maillog was getting pretty big because of lots of testing and re-configuring I've been doing lately with both Dovecot and Postfix. I figured just remove /var/log/maillog and it would be re-created. It wasn't--not by Dovecot, not by Postfix. I had to manually create a new one, put one character in it, save it, properly secure it with chmod, and then Dovecot (and postfix) messages got written to it. This can't possibly be the proper procedure to clear maillog messages ... can it?
Look into logrotate, and turn off your debugging stuff. On 13 Jun 2015 15:02, "Steve Matzura" <number6 at noisynotes.com> wrote:> My /var/log/maillog was getting pretty big because of lots of testing > and re-configuring I've been doing lately with both Dovecot and > Postfix. I figured just remove /var/log/maillog and it would be > re-created. It wasn't--not by Dovecot, not by Postfix. I had to > manually create a new one, put one character in it, save it, properly > secure it with chmod, and then Dovecot (and postfix) messages got > written to it. This can't possibly be the proper procedure to clear > maillog messages ... can it? >
On 2015-06-13 14:00, Steve Matzura wrote:> My /var/log/maillog was getting pretty big because of lots of testing > and re-configuring I've been doing lately with both Dovecot and > Postfix.Logrotate is your friend for this task.> I figured just remove /var/log/maillog and it would be > re-created. It wasn't--not by Dovecot, not by Postfix. I had to > manually create a new one, put one character in it, save it, properly > secure it with chmod, and then Dovecot (and postfix) messages got > written to it. This can't possibly be the proper procedure to clear > maillog messages ... can it?touch $logfile and chmod would have been enough, i think. The other way would be to restart your syslog daemon to let it recreate the missing logfile, thats what my logrotate does after rotating the logfile. - christian
On Sat, 13 Jun 2015 15:15:07 +0300, you wrote:>Look into logrotate, and turn off your debugging stuff.I actually did look at logrotate, but since I'm nobody's big understander of what's in there, I didn't change anything until I learn more about what's in logrotate.d/syslog and other things.>On 13 Jun 2015 15:02, "Steve Matzura" <number6 at noisynotes.com> wrote: > >> My /var/log/maillog was getting pretty big because of lots of testing >> and re-configuring I've been doing lately with both Dovecot and >> Postfix. I figured just remove /var/log/maillog and it would be >> re-created. It wasn't--not by Dovecot, not by Postfix. I had to >> manually create a new one, put one character in it, save it, properly >> secure it with chmod, and then Dovecot (and postfix) messages got >> written to it. This can't possibly be the proper procedure to clear >> maillog messages ... can it? >>