Oct 24, 2013; 19:01
Lars A. Gundersen
There's something funky with the SMTP tags
I have made a ticket with this on Lasso's bug tracker, but I'm hoping to maybe get some help and tips here, since the SMTP tags actually are open source and available in the
<Lasso App folder>/Documentation/3- Language Guide/LassoApps/Startup foleder for all to see and mess with.
I'm using this with Lasso 8.6 on Mac OS X 10.8.5 and have used the SMTP tags for quite a while now, seemingly with success. Nothing fancy, and basically you just do
local: 'SMTP' = (Email_SMTP);
#SMTP->(Open: -Host=#domain,-port=25, -timeout=40);
#hassent = #SMTP->(Send: -Message=#messagepart->data, -From='myemail@mydomain.com', -Recipients=#messagepart->recipients);
Something like that. pluss error checking and what not, it's not important here. My users use this to send emails, and the webapp that does it logs error messages that the SMTP tags report, when the sending fails.
I noticed not long ago that all the emails to a large University here failed, and the error message was the for me unusual
[Email_SMTP] Server Error: 550 5.5.1 Protocol error
I contacted them and got a this reply:
"Your SMTP client does not follow protocol and starts the SMTP-dialogue before having recieved an 'ok' signal back. Specifically, after a 'connect' the client should wait for a '220 ...' back before issuing any more commands. You don't, your first command ('EHLO...') comes immediately, you dont wait for an answer. http://tools.ietf.org/html/rfc5321#section-4.3.1 "
I thought, 'huh', and started digging. The obvious place to look is the aforementioned SMTP tag, the file smtp.inc in that folder.
I am not quite good enough to grok everything that's going on with the self references and things like that, but it seems to me that this has to be the result of things that happen from line 121 and onwards, inside the smtp->Open tag.
The SMTP code uses the net tags, and on line 121 you have the net->connect command followed by a smtp->command call that simply waits for the 220 back, AFAICT. Then if it gets that within the timeout limit, it will send the 'EHLO' command.
The SMTP->Command tag is defined from line 262 onwards. When you do a command without any other argument, you just wait for a signal back (line 301) then you read it (line 308) into the local variable #result.
This you test for the expected return code. In the case of a connect, that would be a 220 followed by some welcome message by the mail server. If you don't see it, you set the current error message to '[Email_SMTP] Server Error: ' #result
The net tags are supposed to be blocking, i.e. they wait for a result before proceeding, unless you state non_blocking, which I don't see. Given that, it looks ok to me, I don't see how the SMTP Open tag can just continue straight from a connect to sending EHLO without waiting. But I trust the mail guys at this Uni, it's a well respected technical one.
Also, with this in mind, I went back to our databases to check if I could find cases where the SMTP Open tag reported an error, but where the recipient still obvioulsy got the email anyway, and I found many cases. Most where logged with the error message from line 304, "timed out waiting for read". I can't really parse the exact reason, but it too suggests that there's something funky with the timing inside the SMTP code, it doesn't seem to do it quite correctly.
If anyone can shed some light on this issue somehow, it would be great.
Lars
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Oct 24, 2013; 18:40
Ke Carlton
Re: There's something funky with the SMTP tags
Oct 24, 2013; 21:17
Lars A. Gundersen
Re: There's something funky with the SMTP tags
Oct 25, 2013; 06:36
Seth Ganahl
Re: There's something funky with the SMTP tags
Oct 28, 2013; 12:24
Steve Upton
Re: There's something funky with the SMTP tags
Oct 28, 2013; 13:13
Fletcher Sandbeck
Re: There's something funky with the SMTP tags
Oct 28, 2013; 21:24
Lars A. Gundersen
Re: There's something funky with the SMTP tags
Oct 28, 2013; 21:43
Lars A. Gundersen
Re: There's something funky with the SMTP tags
Oct 28, 2013; 14:13
Steve Upton
Re: There's something funky with the SMTP tags