Hello,
I'm having a strange problem with local_scan() that I can't explain or
fix. In short, local_scan() accepts messages, but they sometimes get
requeued instead of delivered.
My local_scan() function does some basic setup and whatnot, then calls a
filter program using child_open():
pid = child_open((uschar **)argv, NULL, 027, &tofd, &fromfd, TRUE);
The child process does its thing, and if the message passes the user's
tests, local_scan returns success:
return(LOCAL_SCAN_ACCEPT);
This morning my filter program (the exim child process) which uses
libspf2 to look up SPF records threw an error. The error is actually
generated by libspf2, written to stderr, and appears in the exim main
log, e.g.:
2006-05-08 13:59:06 1FdCon-0006aV-Nh spf_get_spf.c:102 Warning: No
TXT records returned from DNS lookup
In my software, this is a non-fatal error. Processing proceeded as
normal and local_scan() returned LOCAL_SCAN_ACCEPT. But exim requeued
the message, reattempted delivery, which threw another error, over and
over again until I manually removed the message from the queue.
After examining all my code for a hour or so and finding no clues as to
what's wrong, I tried an experiment: I commented out the contents of
SPF_warningx() from libspf2. Result: the message requeue problem seems
to be fixed.
WAG: when local_scan() or its child processes send output to stderr,
exim seems to ignore local_scan()'s return code. True? False? Maybe?
Pointers welcome, thanks!