I'm trying to write an efficient C interface to feed messages with large
recipient lists (500k+ subs) to qmail.
I've set up a pipe to qmail-queue in the style of qmail.c and ezmlm, except
I'm not using the substdio library.
The pipe works fine for small distribution lists, but I'm getting consistent
blocking after writing about 10KB of addresses (around 400 recipients) to the
pipe. qmail-queue is blocked in read() and my returns EAGAIN indefinitely on
write(), or blocks indefinitely without O_NONBLOCK set.
Obvious stuff:
1. set O_NONBLOCK on the fds to which I'm writing
2. double-checked validity of data written to pipe: null-terminated,
no address exceeding 1003 bytes, all recipient addresses preceded
w/ 'T'
3. Checking return value of write() and writing in multiple passes,
as necessary
Am I missing something? Anyone else successfully written a C interface to
qmail-queue they'd be willing to share?
Thanks,
-Jeff