On Tue, 9 Mar 2004, Jason Borkowsky wrote:
> > Run messages through a default spamc to a temp file, grab the spam
> > score, and do with that what you want. Double-scanning is not the
> > answer, especially if you've got a busy site.
>
> Actually, I tried exactly this, and then sent a "normal heavy" load through
> my SpamAssassin script to test it, and there were times when the temp file
> would be overwritten before the current spamc process was done with it. I
> found you have to keep the data flowing (such as sequential pipes) otherwise
> you have to start locking files.
Use "mktemp" (or "tmpfile", depending upon your context) to create a
temporary file with a unique name, then there's no danger of overwriting.
--
Dave Funk University of Iowa
<dbfunk (at) engineering.uiowa.edu> College of Engineering
319/335-5751 FAX: 319/384-0549 1256 Seamans Center
Sys_admin/Postmaster/cell_admin Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{