Re: error writing to filter (bogofilter)

Sam Varshavchik <[email protected]>
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
Christian Ebert writes:

> Hi,
>
> After an upgrade to Mac OS 10.8.4 (64bit) from 10.5.8 (32bit) I
> get the following error for _some_ messages:
>
> temporary failure.
> Command output: maildrop: error writing to filter.
> /usr/local/bin/maildrop: Unable to filter message.
>
> The offending rule is rather bog standard:
> xfilter "/usr/local/bin/bogofilter -u -e -p"
>
> Trying the bogofilter suspect on an offending message however
> seems to cause no problems:
>
> $ bogofilter -u -e -p < testbogomsg 1>/dev/null
> $ echo $?
> 0
>
> Of course I recompiled all involved programs, like maildrop,
> bogofilter, tokyocabinet.
>
> What could be the problem?

bogofilter does not read the entire contents of the message from its  
standard input. It terminates before it is read in its entirety. xfilter  
pipes the message to the external filter program that it runs. If xfilter  
detects that the pipe is broken, before it's finished writing the entire  
message to the pipe, it concludes that the external filter has crashed.

Given the buffering involved with pipes, you get non-predictable behavior  
that, sometimes, maildrop succesfully finishes writing the end of the  
message, which gets buffered in the pipe before the external command  
terminates without reading in its entirety. There's no way to detect that,  
so, depending on random factors, sometimes an error gets detected, sometimes  
not; and this depends in part on the underlying operating system platform  
and implementation. It's not surprising that different behavior is observed  
after upgrading.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

_______________________________________________
Courier-maildrop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)

iEYEABECAAYFAlG5tbUACgkQx9p3GYHlUOKtUACdG6fP5TzKQjxFwZ0fZgd+tyM7
nyQAniNT9ekCeKcGAWMXY0kf5tn+GsaO
=nUaB
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.