I'm trying to write a sendmail proxy in PHP: people would connect to my proxy running on port 25 (via xinetd), and the proxy would connect to sendmail (tweaked to run on port 26). Currently, the proxy is 100% transparent, but I plan to tweak it to intercept sendmail's replies and substitute its own. My ultimate goal is to implement sender-recipient-based greylisting (not IP-based greylisting, which can be done without a proxy). My problem: the proxy works fine when I test it, but seems to cutoff some clients. I send the clients a "message accepted for delivery" message and close the connection, but the client thinks it's been cutoff and tries to deliver the mail again a little later (ironically, this is the behavior I'll want when I start greylisting, but not now!). This happens w/ legitimate ISP SMTP clients, not just spammers. I suspect I'm doing something wrong with buffering or flushing. I made both STDIN and the socket connection (to port 26, where sendmail's running for real) nonblocking, since it's hardish to tell which one's going to "speak" next. Is there any generic proxy code I could use? An existing PHP sendmail proxy would be even better. Note: I realize that using a proxy means that *all* sendmail connections appear to come from localhost, which is dangerous. Once in production, my proxy will handle this situation by using xinetd's REMOTE_HOST environment variable. -- We're just a Bunch Of Regular Guys, a collective group that's trying to understand and assimilate technology. We feel that resistance to new ideas and technology is unwise and ultimately futile. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php