Minor logrotate bug (was Re: logrotate script for Postfix)

2020-05-14 Thread Larry Stone
I posted the note below Saturday but having seen no acknowledgement from 
Wietse, wanted to make sure it wasn’t overlooked although it’s very minor.

To summarize what’s below, the default value of maillog_file_rotate_suffix is 
%Y%M%d-%H%M%S which puts minutes where you expect month. It should be 
%Y%m%d-%H%M%S.

And as I said, it’s technically not a bug because it works as documented but as 
documented and as works is not what one would reasonably expect.

I’m running Postfix 3.5.1.

-- 
Larry Stone
lston...@stonejongleux.com





> On May 9, 2020, at 10:31 AM, Larry Stone  wrote:
> 
>> 
>> On May 9, 2020, at 9:45 AM, Wietse Venema  wrote:
>> 
>> 
>> If the log is written by Postfix you must use "postfix logrotate".
>> This ensures that Postfix stops writing to a file before it is
>> compressed.
>> 
>>  Wietse
> 
> I hate to even suggest I found a bug with Postfix, but I think I found a very 
> minor bug.
> 
> First, despite having gone to Postfix logging over a year ago (thanks to 
> MacOS’s weird logging system), this is the first I heard there was a Postfix 
> logrotate command. Testing it, I did not get the rotated file name I would 
> have expected. The bug is the default name for the rotated file which is from 
> the parameter maillog_file_rotate_suffix:
> # postconf -d maillog_file_rotate_suffix
> maillog_file_rotate_suffix = %Y%M%d-%H%M%S
> 
> This is putting minutes where month should be. And it’s documented that way 
> at http://www.postfix.org/MAILLOG_README.html (so technically not a bug since 
> it works as documented but not as one would expect).
> 
> Easy fix with an override in main.cf
> 
> -- 
> Larry Stone
> lston...@stonejongleux.com



Re: Minor logrotate bug (was Re: logrotate script for Postfix)

2020-05-14 Thread Wietse Venema
Larry Stone:
> I posted the note below Saturday but having seen no acknowledgement from 
> Wietse, wanted to make sure it wasn?t overlooked although it?s very minor.
> 
> To summarize what?s below, the default value of maillog_file_rotate_suffix is 
> %Y%M%d-%H%M%S which puts minutes where you expect month. It should be 
> %Y%m%d-%H%M%S.
> 
> And as I said, it?s technically not a bug because it works as documented but 
> as documented and as works is not what one would reasonably expect.
> 
> I?m running Postfix 3.5.1.

I fixed this in the pending stable release updates, and it's
been available the on-line manpages and unstable releases.

Wietse