Weird behavur with DSN ENVID parameter...
Weird behavur with DSN ENVID parameter...
am 30.11.2007 20:46:20 von gtaylor
I'm having a very weird behavior with the ENVID parameter of the MAIL
verb with Sendmail 8.13.8.
I'm trying to have a script communicate SMTP with Sendmail and getting
the following weird error when I have some ENVID parameters.
220 rti02.co-lo.riverviewtech.net ESMTP Sendmail 8.13.8/8.13.8; Fri, 30
Nov 2007 13:29:54 -0600
EHLO rti02.co-lo.riverviewtech.net
250-rti02.co-lo.riverviewtech.net Hello rti02.co-lo.riverviewtech.net
[206.152.114.68], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE 15000000
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN DIGEST-MD5
250-DELIVERBY
250 HELP
MAIL FROM: RET=HDRS
ENVID=Z3RheWxvcit1c2VuZXRAcml2ZXJ2aWV3dGVjaC5uZXQ
250 2.1.0 ... Sender ok
RCPT TO: NOTIFY=FAILURE
ORCPT=rfc822;gtaylor+usenet@riverviewtech.net
500 5.5.1 Command unrecognized: ""
RSET
501 5.5.4 Syntax error in ORCPT parameter value
250 2.0.0 Reset state
QUIT
221 2.0.0 rti02.co-lo.riverviewtech.net closing connection
I have found that there is a trailing from the way I'm
generating my ENVID. I can remove that with out a problem, but what is
perplexing me is why I'm getting a '500 5.5.1 Command unrecognized: ""'
after the RCPT to command.
Did I just stumble on to a bug? Or is this considered a non-issue?
Grant. . . .
Re: Weird behavur with DSN ENVID parameter...
am 01.12.2007 00:25:25 von per
In article
Grant Taylor writes:
>I'm having a very weird behavior with the ENVID parameter of the MAIL
>verb with Sendmail 8.13.8.
>
>I'm trying to have a script communicate SMTP with Sendmail and getting
>the following weird error when I have some ENVID parameters.
>
>220 rti02.co-lo.riverviewtech.net ESMTP Sendmail 8.13.8/8.13.8; Fri, 30
>Nov 2007 13:29:54 -0600
>EHLO rti02.co-lo.riverviewtech.net
>250-rti02.co-lo.riverviewtech.net Hello rti02.co-lo.riverviewtech.net
>[206.152.114.68], pleased to meet you
>250-ENHANCEDSTATUSCODES
>250-PIPELINING
>250-EXPN
>250-VERB
>250-8BITMIME
>250-SIZE 15000000
>250-DSN
>250-ETRN
>250-AUTH LOGIN PLAIN DIGEST-MD5
>250-DELIVERBY
>250 HELP
>MAIL FROM: RET=HDRS
>ENVID=Z3RheWxvcit1c2VuZXRAcml2ZXJ2aWV3dGVjaC5uZXQ
>
>250 2.1.0 ... Sender ok
>RCPT TO: NOTIFY=FAILURE
>ORCPT=rfc822;gtaylor+usenet@riverviewtech.net
>500 5.5.1 Command unrecognized: ""
>RSET
>501 5.5.4 Syntax error in ORCPT parameter value
>250 2.0.0 Reset state
>QUIT
>221 2.0.0 rti02.co-lo.riverviewtech.net closing connection
>
>I have found that there is a trailing from the way I'm
>generating my ENVID. I can remove that with out a problem, but what is
>perplexing me is why I'm getting a '500 5.5.1 Command unrecognized: ""'
>after the RCPT to command.
You mean it's perplexing that you are getting after RCPT and not earlier?
PIPELINING may have an effect there, but in any case your "embedded"
throws sendmail out of sync in the SMTP dialogue: It sent MAIL
and got the 250 response, so it will send RCPT - but it also
"unknowingly" sent a "null" command between MAIL and RCPT, so the 500 in
response to the "null" command will by necessity be received before the
501 to RCPT, but not looked at/for until RCPT is sent. I.e. it goes like
this
C S
1. MAIL ->
2. <- 250
3. CRLF ->
4. <- 500
5. RCPT ->
6. <- 501
except that 5 may actually happen before, or simultaneously with, 4.
>Did I just stumble on to a bug? Or is this considered a non-issue?
One could argue that sendmail should "sanitize" what you give it via -V,
or perhaps better refuse to run if its something clearly invalid - but I
think the proper answer is "don't do that".
--Per Hedeland
per@hedeland.org
Re: Weird behavur with DSN ENVID parameter...
am 03.12.2007 00:54:50 von bonomi
In article ,
Grant Taylor wrote:
>I'm having a very weird behavior with the ENVID parameter of the MAIL
>verb with Sendmail 8.13.8.
>
>I'm trying to have a script communicate SMTP with Sendmail and getting
>the following weird error when I have some ENVID parameters.
>
>220 rti02.co-lo.riverviewtech.net ESMTP Sendmail 8.13.8/8.13.8; Fri, 30
>Nov 2007 13:29:54 -0600
>EHLO rti02.co-lo.riverviewtech.net
>250-rti02.co-lo.riverviewtech.net Hello rti02.co-lo.riverviewtech.net
>[206.152.114.68], pleased to meet you
>250-ENHANCEDSTATUSCODES
>250-PIPELINING
>250-EXPN
>250-VERB
>250-8BITMIME
>250-SIZE 15000000
>250-DSN
>250-ETRN
>250-AUTH LOGIN PLAIN DIGEST-MD5
>250-DELIVERBY
>250 HELP
>MAIL FROM: RET=HDRS
>ENVID=Z3RheWxvcit1c2VuZXRAcml2ZXJ2aWV3dGVjaC5uZXQ
>
>250 2.1.0 ... Sender ok
>RCPT TO: NOTIFY=FAILURE
>ORCPT=rfc822;gtaylor+usenet@riverviewtech.net
>500 5.5.1 Command unrecognized: ""
>RSET
>501 5.5.4 Syntax error in ORCPT parameter value
>250 2.0.0 Reset state
>QUIT
>221 2.0.0 rti02.co-lo.riverviewtech.net closing connection
>
>I have found that there is a trailing from the way I'm
>generating my ENVID. I can remove that with out a problem, but what is
>perplexing me is why I'm getting a '500 5.5.1 Command unrecognized: ""'
>after the RCPT to command.
>
>Did I just stumble on to a bug? Or is this considered a non-issue?
The 'bug', such as it is, is in *your* software.
you send some text,
and read -one- response.
lather, rinse, repeat.
when you send one block of text that is taken as _two_ commands (the second
one being an empty line), it generates =two= responses. But you only read the
first one.
So, when you send the next text, and read what you -think- is the response
for -that-, you actually get the 'stale' response from the blank-line command.
It is considered a non-issue, since the server is doing everything exactly
correctly, base on what _it_ sees.
*YOU* didn't do what 'you thought you were doing', and, thus, reality did
not match your expectations. The fix for this is revising your expectations.
*grin*
"doing it right" also helps. That trailing CRLF -is- the cause of the
problems.
Re: Weird behavur with DSN ENVID parameter...
am 03.12.2007 06:47:02 von gtaylor
On 11/30/2007 1:46 PM, Taylor, Grant wrote:
> I'm having a very weird behavior with the ENVID parameter of the MAIL
> verb with Sendmail 8.13.8.
>
> I'm trying to have a script communicate SMTP with Sendmail and getting
> the following weird error when I have some ENVID parameters.
> I have found that there is a trailing from the way I'm
> generating my ENVID. I can remove that with out a problem, but what is
> perplexing me is why I'm getting a '500 5.5.1 Command unrecognized: ""'
> after the RCPT to command.
I agree that the extra is a problem in my code, one which has
been resolved. Below is the new output still exhibiting what I believe
to be erroneous output.
Below is a new output from SMTP transaction.
220 rti02.co-lo.riverviewtech.net ESMTP Sendmail 8.13.8/8.13.8; Sun, 2
Dec 2007 23:34:43 -0600
EHLO rti02.co-lo.riverviewtech.net
250-rti02.co-lo.riverviewtech.net Hello rti02.co-lo.riverviewtech.net
[206.152.114.68], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE 15000000
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN DIGEST-MD5
250-DELIVERBY
250 HELP
MAIL FROM: RET=HDRS
ENVID=Z3RheWxvcit1c2VuZXRAcml2ZXJ2aWV3dGVjaC5uZXQ
250 2.1.0 ... Sender ok
RCPT TO: NOTIFY=FAILURE
ORCPT=rfc822;gtaylor+usenet@riverviewtech.net
501 5.5.4 Syntax error in ORCPT parameter value
RSET
250 2.0.0 Reset state
QUIT
221 2.0.0 rti02.co-lo.riverviewtech.net closing connection
The above output is verbatim of what is happening. I have not
implemented any form of PIPELINING.
The erroneous came from the function that was base 64 encoding
the data to generate the ENVID. I have since added code that will
ensure that there is no extra trailing after the ENVID.
As you can see the unexpected '500 5.5.1 Command unrecognized: ""' do to
the extra has been resolved. However now there is apparently a
problem with the ORCPT parameter, which I do not believe there is. If I
replace "usenet" with "detail" things work just fine. Thus I still
believe there is a problem with DSN handling, I just don't know where.
> Did I just stumble on to a bug? Or is this considered a non-issue?
I was just curious as to what may be generating the strange output.
Grant. . . .
Re: Weird behavur with DSN ENVID parameter...
am 03.12.2007 06:52:23 von gtaylor
On 11/30/2007 5:25 PM, Per Hedeland wrote:
> You mean it's perplexing that you are getting after RCPT and not earlier?
> PIPELINING may have an effect there, but in any case your "embedded"
> throws sendmail out of sync in the SMTP dialogue: It sent MAIL
> and got the 250 response, so it will send RCPT - but it also
> "unknowingly" sent a "null" command between MAIL and RCPT, so the 500 in
> response to the "null" command will by necessity be received before the
> 501 to RCPT, but not looked at/for until RCPT is sent. I.e. it goes like
> this
Ok, thank you for helping me understand where the error came from and
that it is possible that it is coming out of order. For the record, no
PIPELINING was not in use.
> One could argue that sendmail should "sanitize" what you give it via -V,
> or perhaps better refuse to run if its something clearly invalid - but I
> think the proper answer is "don't do that".
Understood and agreed. I believe this falls under the old phrase "Be
liberal in what you accept and conservative in what you send."
suggestion for SMTP. I have corrected the extra problem in my
code and am now experiencing a different error. Please see my other
post for more details.
Grant. . . .
Re: Weird behavur with DSN ENVID parameter...
am 03.12.2007 07:09:07 von ca+sendmail(-no-copies-please)
Grant Taylor wrote:
> been resolved. Below is the new output still exhibiting what I believe
> to be erroneous output.
> RCPT TO: NOTIFY=FAILURE
> ORCPT=rfc822;gtaylor+usenet@riverviewtech.net
> 501 5.5.4 Syntax error in ORCPT parameter value
It always helps to read the RFCs before trying to implement things that
are defined by them... (or you could read the source code...)
RFC 1891
[[...]] Because the ENVID
and ORCPT parameters may need to convey values outside this range,
the esmtp-values for these parameters are encoded as "xtext".
"xtext" is formally defined as follows:
xtext = *( xchar / hexchar )
xchar = any ASCII CHAR between "!" (33) and "~" (126) inclusive,
except for "+" and "=".
; "hexchar"s are intended to encode octets that cannot appear
; as ASCII characters within an esmtp-value.
hexchar = ASCII "+" immediately followed by two upper case
hexadecimal digits
Re: Weird behavur with DSN ENVID parameter...
am 03.12.2007 17:19:19 von gtaylor
On 12/03/07 00:09, Claus Aßmann wrote:
> It always helps to read the RFCs before trying to implement things that
> are defined by them... (or you could read the source code...)
I had read the RFC long ago. I had just forgotten about the prohibited
characters. Now that I have added code to ""encode the characters
things are working fine.
Thank you Per and Claus for your help.
Grant. . . .
Re: Weird behavur with DSN ENVID parameter...
am 03.12.2007 23:40:31 von per
In article
Grant Taylor writes:
>
>> One could argue that sendmail should "sanitize" what you give it via -V,
>> or perhaps better refuse to run if its something clearly invalid - but I
>> think the proper answer is "don't do that".
>
>Understood and agreed. I believe this falls under the old phrase "Be
>liberal in what you accept and conservative in what you send."
>suggestion for SMTP.
Uh, I actually misread your original message, getting the impression
that you were using sendmail as a client and passing it the ENVID via -V
- but as it was your client code that was misbehaving, there was
absolutely nothing sendmail could do about it, it just had to respond
the way it did per the protocol spec.
--Per Hedeland
per@hedeland.org