[REBOL] Re: Send & mail-server problem
From: gscottjones:mchsi at: 7-Aug-2002 6:27
> On Behalf Of G. Scott Jones
> > Looking at the error and the smtp scheme,
> > I think that the most likely problem is that
> > the mail server is sending a nonstandard
> > sign-off sequence. Normally, after the body
> > of the email is sent, REBOL sends a "QUIT"
> > command. In response, then it expects to see
> > "221" followed by any brief message.
From: "Robert M. Muench"
> Hi, ok I have made a trace of the communication
> process. Here is what I got:
<snipped early trace stuff>
> Net-log: [none "250"]
> Net-log: "250 Mail accepted"
> Net-log: ["QUIT" "221"]
> ** User Error: Server error: tcp 250 Bye
> ** Near: close smtp-port
> I think Allens tip concerning the line-breaks
> might be solution I play around with this idea
> and let you know. IMO the QUIT is done
> correctly, right? Robert
Thanks for sending back the trace. The trace shows that REBOL correctly
wants to send "QUIT" and expects to receive "221 Bye" but instead receives
. This suggests that eXtremail (I was obviously mis-spelling it
before :-) is sending the incorrect numeric code for sign-off. This point
*could* (if you wish) be verified by using a telnet session. From a Windows
command-line prompt (*nix may be a little different ... I can't remember) (C
means "Client-You Type" and S means "Server Sends"):
telnet smtp.mydomain.dom 25
... then at telnet prompt ...
S> 220 localdomain eXtremail V1.5 release 4 rev1 ESMTP server
S> ready ...
S> 250 smtprelay.mydomain.dom
C> MAIL FROM: <[myname--mydomain--dom]>
S> 250 Sender <[myname--mydomain--dom]> Ok
C> RCPT TO: <[myname--mydomain--dom]>
S> 250 Recipient <[myname--mydomain--dom]> Ok
S> 354 Ok Send data ending with <CRLF>.<CRLF>
C> A Message
C> A Silly Message
C> My last line in a silly message
S> 250 Message received:
S> 221 smtprelay.mydomain.dom ESMTP server closing connection
My guess is that eXtremail will send an errant last line looking something
Another quick way to check this issue is to make a quick hack on REBOL to
make it temporarily compliant with what I *think* is going on. In the smtp
scheme, the close-check sequence can be altered as follows the prompt in a
fresh REBOL session:
== ["QUIT" "221"]
>> system/schemes/smtp/handler/close-check: ["QUIT" "250"]
== ["QUIT" "250"]
This changes the scheme to now look for a "250" in response to the "QUIT"
command. Then send yourself a quick email through REBOL.
send [myname--mydomain--dom] "Hello, self"
If REBOL does not complain, then this suggests that eXtremail is not sending
the correct sequence. Please note that this hacked smtp scheme will now
*not work* correctly with a compliant server. If a program will need to
connect to multiple smtp servers, some compliant and some not, then one
REBOL work-around would be to create newly named smtp scheme and send
commands for use with eXtremail only. Alternatively, the scheme could be
made a little smarter and look for errant servers and then check the
alternative closing sequence.
Finally, if eXtremail is sending an incorrect sequence, I would suggest
sending a correction suggestion to the source maintainer to be fixed in a
future release. Just a thought, but obviously very few clients have
complained thus far, or the (possible) error would already have been fixed!
Hope this hels a bit more. As always, I am very interested in hearing what