[comp.protocols.tcp-ip] smtp problem: remote protocol error: bad file number

cfe+@andrew.cmu.edu (Craig F. Everhart) (04/21/89)

You're seeing a misleading error message.  ``bad file number'' is a
representation of what was left in errno (EBADF) after an SMTP connection went
south; the connection is closed, but sendmail doesn't know it, so it does a
``close()'' anyway, leaving bad stuff in the global variable ``errno''.  An
ostensible fix for this was posted to comp.mail.sendmail about a month ago,
involving saving and restoring the errno value across a pair of close()
operations.

Unfortunately, that errno-clobber is masking the original errno value, which is
doubtless something like ETIMEDOUT or ECONNREFUSED.  Too bad your error-handler
is interpreting the EBADF as a permanent/persistent error rather than a
transient one.

Once you find out what the network problem is, you'll have to deal with your
network/gateway support to find out why you can't get to some hosts.

                Craig