[comp.mail.misc] 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

lindberg@cs.chalmers.se (Gunnar Lindberg) (04/24/89)

In article <3074@ursa-major.SPDCC.COM> eli@ursa-major.SPDCC.COM
(Steve Elias) writes:
>if anyone has any idea as to what i could do to fix the above error, 

As cfe+@andrew.cmu.edu (Craig F. Everhart) replies, the "bad file
number" message is rather misleading, but look at the other message,
"remote protocol error". It could be that the machine tries to talk
"sendmail-smtp", using only <LF> (or <NL> in UNIX terms) instead of
the RFC821-required <CR><LF> as line terminator. We've had this
problem when talking to DEC20/TOPS20 machines, e.g. SRI-NIC.ARPA.

Fix in sendmail.cf:

    Mether, P=[IPC], E=\r\n, F=mDFMuCX, S=11, R=21, A=IPC $h
		     ^^^^^^

	Gunnar Lindberg

murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) (04/25/89)

In article <3075@fnatte.cs.chalmers.se> lindberg@cs.chalmers.se (Gunnar Lindberg) writes:
>In article <3074@ursa-major.SPDCC.COM> eli@ursa-major.SPDCC.COM
>(Steve Elias) writes:
>>if anyone has any idea as to what i could do to fix the above error, 
>
>As cfe+@andrew.cmu.edu (Craig F. Everhart) replies, the "bad file
>number" message is rather misleading, but look at the other message,
>"remote protocol error". It could be that the machine tries to talk
>"sendmail-smtp", using only <LF> (or <NL> in UNIX terms) instead of
>the RFC821-required <CR><LF> as line terminator. We've had this
>problem when talking to DEC20/TOPS20 machines, e.g. SRI-NIC.ARPA.
>

Actually, sendmail always prints the error message for the current
value of errno when it prints any error.  The "bad file number" was
probably the errno value sitting around when the "protocol error"
occured.

If you are surprised, then re-check the intro message to your UNIX C
Library.  "errno" is not garunteed to be zero when an error hasn't
occured...


... Erik
---

-- 
Erik Murrey
Lehigh University
murrey@csee.Lehigh.EDU
erik@mpx.com

eli@spdcc.COM (Steve Elias) (04/25/89)

lindberg@cs.chalmers.se (Gunnar Lindberg) writes:
!In article <3074@ursa-major.SPDCC.COM! eli@ursa-major.SPDCC.COM
!!if anyone has any idea as to what i could do to fix the above error, 
!
!As cfe+@andrew.cmu.edu (Craig F. Everhart) replies, the "bad file
!number" message is rather misleading, but look at the other message,
!"remote protocol error". It could be that the machine tries to talk
!"sendmail-smtp", using only <LF! (or <NL! in UNIX terms) instead of
!the RFC821-required <CR!<LF! as line terminator. We've had this
!problem when talking to DEC20/TOPS20 machines, e.g. SRI-NIC.ARPA.
!
!Fix in sendmail.cf:
!
!    Mether, P=[IPC], E=\r\n, F=mDFMuCX, S=11, R=21, A=IPC $h
!		     ^^^^^^

	Steve Dyer (root@spdcc.com) tells me that his sendmail.cf
	already says "E=rn"...  are the backslashes important???
	(silly question -- every character in sendmail.cf is important!)
	...  the problem continues  ... 

-- 
   Steve Elias (eli@spdcc.com);(6172399406)
     "Space is small.  The planets are big." -- Heinlein