Karl O. Pinc: > When there's more than one subscriber the same thing > happens for mail sent to the first subscriber, but > then the same message is sent to the second subscriber. > Again, smtp sends a DATA command, gets back a 354, > sends the message, ends with a period, and gets > a 250 reply back. At that point things have changed > because the smtp side does not send a QUIT, instead it > closes it's side of the TCP connection with a FIN, ACK. > I presume that at this point spawn sends awk an EOF on stdin > because the process tree then looks like this:
Nope, spawn does not close connections. Nor does it inform the external command that a connection goes away. It's up to the external command to handle an EOF condition appropriately. The spawn daemon just waits until the external command decides to terminate. In your case awk detects EOF on input and terminates, but apparently netcat doesn't. To handle mail with SMTP, use software that understands the SMTP protocol. Wietse