bogofilter closing stdin prematurely in passthrough mode
Tomaž Šolc
tomaz.solc at tablix.org
Sun Sep 21 13:03:50 CEST 2025
Hi
I have a bogofilter setup where procmail pipes messages through
bogofilter for sorting. I've been looking into a problem where a certain
email causes procmail to error out ("error while writing to bogofilter")
and repeatedly defer the delivery.
It appears that the reason is that bogofilter prematurely closes stdin
and exits while procmail still has bytes to write. Indeed, if I just cat
the offending email through "bogofilter -p" the email printed on stdout
is truncated somewhere in the middle.
Otherwise bogofilter appears to work normally. It doesn't return an
error code. There's no segfault. The only weird thing I see is that if I
do a strace it attempts to do an invalid seek on fd=0 before it exits,
but this might be benign.
I think the email is hitting somekind of a token or input buffer limit.
It has a few very long sequences of U+3164 "HANGUL FILLER" characters.
I've been able to reproduce the problem by creating an email with such a
sequence. Bogofilter cuts it off after 3640 characters (but, for
example, it will not cut off an identical email with an ascii "a"
instead of U+3164).
This is with bogofilter 1.2.5 as packaged in Debian Bookworm.
I'll check if the same issue appears with 1.3.0 once I get it running.
Best regards
Tomaž
More information about the bogofilter
mailing list