On Fri, Apr 05, 2024 at 01:01:52AM +0200, Magnus Stenman wrote:

Hi,
sorry for the delay, I just started to briefly look into the issue.

> Pflogsumm reports zero mails on day 1-9 of every month
> 
> Stock debian postfix version
> 
> Patch:
> --- /usr/sbin/pflogsumm.orig    2024-04-05 00:45:38.214914066 +0200
> +++ /usr/sbin/pflogsumm 2024-04-05 00:45:44.710952673 +0200
> @@ -1518,7 +1518,7 @@
>      }
>      my ($t_mday, $t_mon, $t_year) = (localtime($time))[3,4,5];
> 
> -    return sprintf("%s %2d", $monthNames[$t_mon], $t_mday), 
> sprintf("%04d-%02d-%02d", $t_year+1900, $t_mon+1, $t_mday);
> +    return sprintf("%s %02d", $monthNames[$t_mon], $t_mday), 
> sprintf("%04d-%02d-%02d", $t_year+1900, $t_mon+1, $t_mday);
>  }

It's been a while I looked into pflogsumm and for me it still works,
but I do not rely for a long time on the traditional BSD syslog format.
Also Debian doesn't do that by default for some time, so I'm wondering
what exactly your logs look like. If possible please provide a sample.
Also how did you invoke pflogsumm, any flags in use?

According to RFC3164 section 4.1.2 there isn't zero padding but space
padding in the traditional timestamp. Likely there is a bug
somewhere, maybe even in one of the other patches I carry in the
package, but I believe the format returned here, without zero
padding on the day of the month is correct.

Sven

Reply via email to