postcat: invalid size record

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

postcat: invalid size record

Martin Mareš
Hello!

Sometimes, I run into postcat failing with error message

        invalid size record: ...

on genuine queue files saved with "dont_remove = 1". I think that
the failures correlate with e-mails rejected by smtpd milter.

postcat produces this error during processing a size record:

      if (sscanf(STR(buffer), "%ld %ld", &data_size, &data_offset) != 2
          || data_offset <= 0 || data_size <= 0)
          msg_fatal("invalid size record: %.100s", STR(buffer));

The problematic queue files have both data_size and data_offset equal
to zero. When I change both "<= 0" to "< 0", queue file contents are
printed correctly.

Are these queue files malformed, or is postcat overzealous with its
consistency checks?

                                Have a nice fortnight
--
Martin `MJ' Mareš                        <[hidden email]>   http://mj.ucw.cz/
United Computer Wizards, Prague, Czech Republic, Europe, Earth, Universe
Q: How many mathematicians does it take to screw in a lightbulb? A: 0.999999...
Reply | Threaded
Open this post in threaded view
|

Re: postcat: invalid size record

Wietse Venema
Martin Mare?:
> Hello!
>
> Sometimes, I run into postcat failing with error message
>
> invalid size record: ...
>
> on genuine queue files saved with "dont_remove = 1". I think that
> the failures correlate with e-mails rejected by smtpd milter.

don't_remove is not a production feature; among other things
it will prevent Postfix from deleting incomplete files.

> postcat produces this error during processing a size record:
>
>       if (sscanf(STR(buffer), "%ld %ld", &data_size, &data_offset) != 2
>           || data_offset <= 0 || data_size <= 0)
>           msg_fatal("invalid size record: %.100s", STR(buffer));
>
> The problematic queue files have both data_size and data_offset equal
> to zero. When I change both "<= 0" to "< 0", queue file contents are
> printed correctly.
>
> Are these queue files malformed, or is postcat overzealous with its
> consistency checks?

Inspecting incomplete files is NOT SUPPORTED. As far as I am concerned
postcan may go into a loop Xdepending on how incomplete the file is.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postcat: invalid size record

Martin Mareš
Hello!

> Inspecting incomplete files is NOT SUPPORTED. As far as I am concerned
> postcan may go into a loop Xdepending on how incomplete the file is.

OK, thanks for the explanation.

                                Have a nice fortnight
--
Martin `MJ' Mareš                        <[hidden email]>   http://mj.ucw.cz/
United Computer Wizards, Prague, Czech Republic, Europe, Earth, Universe
Maintenance-free:  When it breaks, it can't be fixed...