[tsNet] tsNetSmtpSync

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
Hi all,

I've worked hard with tsNetSmtpSync() these last days,
on macOS Sierra with the latest LC 8.1.6
and have 2 questions which bothers me:

- from time to time (no recipe yet), I've got an error when executing it.
Executing it again (same code and context) and all is fine then.



- about the ResponseHeaders out parameter:

Sometimes I get:

220-xxx.yyyy.net ESMTP Exim 4.89 #1 Thu, 14 Sep 2017 14:17:38 +0200
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
250-xxx.yyyy.net Hello zzzzz [99.33.77.88]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
220 TLS go ahead
250-xxx.yyyy.net Hello pommeDesFouets [99.33.77.88]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250 HELP
334 VXNlfg5hbWU6
334 UGFzc3sdfcmQ6
235 Authentication succeeded
250 OK
250 Accepted
250 Accepted
354 Enter message, ending with "." on a line by itself
250 OK id=1dsT5O-002hrt-TA

or this:

250 OK
250 Accepted
250 Accepted
354 Enter message, ending with "." on a line by itself
250 OK id=1dsSmD-003WQr-2l

In both cases, the email is sent and received correctly.

Thanks for some hints.

Thierry


--
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
Hi Thierry,

On 15/09/2017 6:31 PM, Thierry Douez via use-livecode wrote:
> Hi all,
>
> I've worked hard with tsNetSmtpSync() these last days,
> on macOS Sierra with the latest LC 8.1.6
> and have 2 questions which bothers me:
>
> - from time to time (no recipe yet), I've got an error when executing it.
> Executing it again (same code and context) and all is fine then.

What is the error message that you get?

> - about the ResponseHeaders out parameter:
tsNet will try re-use an existing connection if there is one available,
so this first example:

> Sometimes I get:
>
> 220-xxx.yyyy.net ESMTP Exim 4.89 #1 Thu, 14 Sep 2017 14:17:38 +0200
> 220-We do not authorize the use of this system to transport unsolicited,
> 220 and/or bulk e-mail.
> 250-xxx.yyyy.net Hello zzzzz [99.33.77.88]
> 250-SIZE 52428800
> 250-8BITMIME
> 250-PIPELINING
> 250-AUTH PLAIN LOGIN
> 250-STARTTLS
> 250 HELP
> 220 TLS go ahead
> 250-xxx.yyyy.net Hello pommeDesFouets [99.33.77.88]
> 250-SIZE 52428800
> 250-8BITMIME
> 250-PIPELINING
> 250-AUTH PLAIN LOGIN
> 250 HELP
> 334 VXNlfg5hbWU6
> 334 UGFzc3sdfcmQ6
> 235 Authentication succeeded
> 250 OK
> 250 Accepted
> 250 Accepted
> 354 Enter message, ending with "." on a line by itself
> 250 OK id=1dsT5O-002hrt-TA
Indicates that there was no existing SMTP connection to the server, so
it needed to establish a new connection.

Where in the following example:
> or this:
>
> 250 OK
> 250 Accepted
> 250 Accepted
> 354 Enter message, ending with "." on a line by itself
> 250 OK id=1dsSmD-003WQr-2l
This indicates that tsNet found an existing SMTP connection to the
server you are connecting to, so could just send the message across the
already open connection.

You can add the "no_reuse" element with a value of true to the settings
array (last parameter to tsNetSmtpSync) if you want to establish a fresh
connection for each e-mail that is sent rather than allowing tsNet to
reuse an existing connection.

Hope that helps,

Regards,

Charles


> In both cases, the email is sent and received correctly.
>
> Thanks for some hints.
>
> Thierry
>
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
2017-09-15 10:57 GMT+02:00 Charles Warwick

Hi Thierry,

>
> On 15/09/2017 6:31 PM, Thierry Douez:
>
>> Hi all,
>>
>> I've worked hard with tsNetSmtpSync() these last days,
>> on macOS Sierra with the latest LC 8.1.6
>> and have 2 questions which bothers me:
>>
>> - from time to time (no recipe yet), I've got an error when executing it.
>> Executing it again (same code and context) and all is fine then.
>>
>
> What is the error message that you get?




​Mmm, of course,  I should have read the error number :)
Will post back with other tests a bit later...


>
>
> - about the ResponseHeaders out parameter:
>>
> tsNet will try re-use an existing connection if there is one available, so
> this first example:
>
> Sometimes I get:
>>
>> 220-xxx.yyyy.net ESMTP Exim 4.89 #1 Thu, 14 Sep 2017 14:17:38 +0200
>> 220-We do not authorize the use of this system to transport unsolicited,
>> 220
>> ​........
>>
>> 250 OK id=1dsT5O-002hrt-TA
>>
>

> Indicates that there was no existing SMTP connection to the server, so it
> needed to establish a new connection.
>
> Where in the following example:
>>
>> 250 OK
>> 250 Accepted
>> 250 Accepted
>> 354 Enter message, ending with "." on a line by itself
>> 250 OK id=1dsSmD-003WQr-2l
>>
>

> This indicates that tsNet found an existing SMTP connection to the server
> you are connecting to, so could just send the message across the already
> open connection. ​

You can add the "no_reuse" element with a value of true to the settings
> array (last parameter to tsNetSmtpSync) if you want to establish a fresh
> connection for each e-mail that is sent rather than allowing tsNet to reuse
> an existing connection.
>

​I guess both methods are safe?
or is there some advantages with one or the other?

I'm using it within a Livecode Mail Composer.
Based on an export of my server DB, I'm scanning some address,
build dynamically the html-email and send one by one all emails.


>
> Hope that helps,
>


​Thanks Charles for your  explanations, much appreciated.


Regards,

Thierry



> In both cases, the email is sent and received correctly.
>>
>> Thanks for some hints.
>>
>> Thierry
>>
>>
--
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
Hi Theirry,


On 15/09/2017 7:08 PM, Thierry Douez via use-livecode wrote:
> ​I guess both methods are safe?
> or is there some advantages with one or the other?
>
> I'm using it within a Livecode Mail Composer.
> Based on an export of my server DB, I'm scanning some address,
> build dynamically the html-email and send one by one all emails.
> ​

Both are safe.  Generally, if you are going to be making multiple
connections to the same server (in this case, sending a number of
e-mails) fairly quickly, then allowing tsNet to reuse an existing
SSL/TLS connection to the server will be quicker (it doesn't have to
establish the SSL connection each time).

Regards,

Charles


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
2017-09-15 11:19 GMT+02:00 Charles Warwick :

> Hi Theirry,
>
> On 15/09/2017 7:08 PM, Thierry Douez wrote:
>
>> ​I guess both methods are safe?
>> or is there some advantages with one or the other?
>>
>> I'm using it within a Livecode Mail Composer.
>> Based on an export of my server DB, I'm scanning some address,
>> build dynamically the html-email and send one by one all emails.
>> ​
>>
>
> Both are safe.  Generally, if you are going to be making multiple
> connections to the same server (in this case, sending a number of e-mails)
> fairly quickly, then allowing tsNet to reuse an existing SSL/TLS connection
> to the server will be quicker (it doesn't have to establish the SSL
> connection each time).
>
>
​Good to know what's behind the scene,
thanks again.

your SMTP external is a great feature !

Thierry


--
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
BTW you should mask the 334 entries as these are only base64 encoded user and password. I could look it up and tell you what they are right now.

Bob S


> On Sep 15, 2017, at 01:57 , Charles Warwick via use-livecode <[hidden email]> wrote:
>
> tsNet will try re-use an existing connection if there is one available, so this first example:
>> Sometimes I get:
>>
>> 220-xxx.yyyy.net ESMTP Exim 4.89 #1 Thu, 14 Sep 2017 14:17:38 +0200
>> 220-We do not authorize the use of this system to transport unsolicited,
>> 220 and/or bulk e-mail.
>> 250-xxx.yyyy.net Hello zzzzz [99.33.77.88]
>> 250-SIZE 52428800
>> 250-8BITMIME
>> 250-PIPELINING
>> 250-AUTH PLAIN LOGIN
>> 250-STARTTLS
>> 250 HELP
>> 220 TLS go ahead
>> 250-xxx.yyyy.net Hello pommeDesFouets [99.33.77.88]
>> 250-SIZE 52428800
>> 250-8BITMIME
>> 250-PIPELINING
>> 250-AUTH PLAIN LOGIN
>> 250 HELP
>> 334 VXNlfg5hbWU6
>> 334 UGFzc3sdfcmQ6
>> 235 Authentication succeeded
>> 250 OK
>> 250 Accepted
>> 250 Accepted
>> 354 Enter message, ending with "." on a line by itself
>> 250 OK id=1dsT5O-002hrt-TA
> Indicates that there was no existing SMTP connection to the server, so it needed to establish a new connection.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
2017-09-15 16:40 GMT+02:00 Bob Sneidar via use-livecode <
[hidden email]>:

> BTW you should mask the 334 entries as these are only base64 encoded user
> and password. I could look it up and tell you what they are right now.
>
> Bob S


​Oops, thanks​.

Did change everything on the server !

Thanks again :)

Thierry


------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
Spoke too soon those are the actual WORDS username and password, base64 encoded, but some of the chars are not plain ascii not sure why.

Bob S


> On Sep 15, 2017, at 08:05 , Thierry Douez via use-livecode <[hidden email]> wrote:
>
>> BTW you should mask the 334 entries as these are only base64 encoded user
>> and password. I could look it up and tell you what they are right now.
>>
>> Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
2017-09-15 17:29 GMT+02:00 Bob Sneidar via use-livecode <
[hidden email]>:

> Spoke too soon those are the actual WORDS username and password, base64
> encoded, but some of the chars are not plain ascii not sure why.
>
> Bob S
>

​:)

Because​ I've typed silly character in these datas before posting :)

Your email scarred me first so I forgot I did this :)

Anyway, thanks again as I'm not familiar with this protocol.

Regards,

Thierry



>
> > On Sep 15, 2017, at 08:05 , Thierry Douez via use-livecode <
> [hidden email]> wrote:
> >
> >> BTW you should mask the 334 entries as these are only base64 encoded
> user
> >> and password. I could look it up and tell you what they are right now.
> >>
> >> Bob S
>
--
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
2017-09-15 17:35 GMT+02:00 Thierry Douez <[hidden email]>:

>
>
> 2017-09-15 17:29 GMT+02:00 Bob Sneidar :
>
>> Spoke too soon those are the actual WORDS username and password, base64
>> encoded, but some of the chars are not plain ascii not sure why.
>>
>> Bob S
>>
>
> ​:)
>

​Ok, I've done a quick test with the right datas:

put base64De​code( "the334value")
and I can see the plain text username  and password,
nothing more.

So, I'm safe and breathing again :)


> Because​ I've typed silly character in these datas before posting :)
>
> Your email scarred me first so I forgot I did this :)
>
> Anyway, thanks again as I'm not familiar with this protocol.
>
> Regards,
>
> Thierry
>

--
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [tsNet] tsNetSmtpSync

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
2017-09-15 10:57 GMT+02:00 Charles Warwick

:

Hi Thierry,

>
> On 15/09/2017 6:31 PM, Thierry Douez:
>
>> Hi all,
>>
>> I've worked hard with tsNetSmtpSync() these last days,
>> on macOS Sierra with the latest LC 8.1.6
>> and have 2 questions which bothers me:
>>
>> - from time to time (no recipe yet), I've got an error when executing it.
>> Executing it again (same code and context) and all is fine then.
>>
>
> What is the error message that you get?
>
>

​Charles,


​Finally, after a couple of hundred  positive tests,
 the error came back:​

Error tsneterr: (56) SSLRead() return error -9806

​Sending  again the same mail a second later in same context works​.

Kind regards,

Thierry

--
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode