Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Catch a wave and you're sitting on top of the world." -- The Beach Boys


devel / comp.lang.ada / Re: Attempt to send email using AWS results in Socket closed by peer

SubjectAuthor
* Attempt to send email using AWS results in Socket closed by peerJuan Rayas
+* Re: Attempt to send email using AWS results in Socket closed by peerDmitry A. Kazakov
|`* Re: Attempt to send email using AWS results in Socket closed by peerRandy Brukardt
| `* Re: Attempt to send email using AWS results in Socket closed by peerDmitry A. Kazakov
|  `* Re: Attempt to send email using AWS results in Socket closed by peerDoctor Who
|   `* Re: Attempt to send email using AWS results in Socket closed by peerJuan Rayas
|    +- Re: Attempt to send email using AWS results in Socket closed by peerDmitry A. Kazakov
|    `* Re: Attempt to send email using AWS results in Socket closed by peerDoctor Who
|     `- Re: Attempt to send email using AWS results in Socket closed by peerJuan Rayas
+- Re: Attempt to send email using AWS results in Socket closed by peerDennis Lee Bieber
+- Re: Attempt to send email using AWS results in Socket closed by peerRichard Iswara
+* Re: Attempt to send email using AWS results in Socket closed by peerDoctor Who
|`- Re: Attempt to send email using AWS results in Socket closed by peerRandy Brukardt
`* Re: Attempt to send email using AWS results in Socket closed by peerSimon Wright
 `- Re: Attempt to send email using AWS results in Socket closed by peerDmitry A. Kazakov

1
Attempt to send email using AWS results in Socket closed by peer

<57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5776&group=comp.lang.ada#5776

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ad4:5247:: with SMTP id s7mr1301830qvq.58.1630522728011;
Wed, 01 Sep 2021 11:58:48 -0700 (PDT)
X-Received: by 2002:a25:5444:: with SMTP id i65mr1338606ybb.277.1630522727751;
Wed, 01 Sep 2021 11:58:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 1 Sep 2021 11:58:47 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=76.168.7.137; posting-account=d3k5YgoAAABkSw3WsP6aBXVx_QbzbTl9
NNTP-Posting-Host: 76.168.7.137
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
Subject: Attempt to send email using AWS results in Socket closed by peer
From: juan.m.r...@gmail.com (Juan Rayas)
Injection-Date: Wed, 01 Sep 2021 18:58:48 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 42
 by: Juan Rayas - Wed, 1 Sep 2021 18:58 UTC

Hi,

I am teaching myself Ada and tried to create a simple program that sends an email if today's date equals my birthday :).

I am using Gnat Studio 2021, Community edition, Ubuntu 20.0.4. I downloaded, built and installed AWS. I am sending the email as follows:

procedure SendMail is
Status : AWS.SMTP.Status;
Auth : aliased constant SMTP.Authentication.Plain.Credential :=
SMTP.Authentication.Plain.Initialize
("myAccount", "myPassword");
Isp : SMTP.Receiver;

begin
New_Line;
Isp :=
SMTP.Client.Initialize
("smtp.gmail.com", Port => 465,
Credential => Auth'Unchecked_Access);

SMTP.Client.Send
(Isp, From => SMTP.E_Mail ("Me", "myAccount"),
To => SMTP.E_Mail ("Me", "myAccount"),
Subject => "AWS test",
Message => "This is a test",
Status => Status);

if not SMTP.Is_Ok (Status) then
Text_IO.Put_Line
("Can't send message :" & SMTP.Status_Message (Status));
end if;
end SendMail;

myAccount and myPassword are removed for the purposes of this post.

When I run my program, the SendEmail procedure fails with the following message:

raised AWS.SMTP.SERVER_ERROR : raised AWS.NET.SOCKET_ERROR : Receive : Socket closed by peer

Does anyone know how to fix this when using the gmail server? Or perhaps I am using AWS incorrectly?

Thanks,
Juan

Re: Attempt to send email using AWS results in Socket closed by peer

<sgol48$r20$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5777&group=comp.lang.ada#5777

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Wed, 1 Sep 2021 21:43:06 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgol48$r20$1@gioia.aioe.org>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="27712"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Wed, 1 Sep 2021 19:43 UTC

On 2021-09-01 20:58, Juan Rayas wrote:

> Does anyone know how to fix this when using the gmail server?

No, but I guess that you must configure the SMTP client for TLS or else
opportunistic TLS (StartTLS). Most mail servers do not accept
unencrypted connections. I do not use AWS and its SMTP, maybe somebody
who does might help you with it.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Attempt to send email using AWS results in Socket closed by peer

<uqmvigluancror50qfojonvlbip52siebg@4ax.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5778&group=comp.lang.ada#5778

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 01 Sep 2021 15:02:08 -0500
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Wed, 01 Sep 2021 16:02:10 -0400
Organization: IISS Elusive Unicorn
Message-ID: <uqmvigluancror50qfojonvlbip52siebg@4ax.com>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 21
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-UYJXn4pBZfx70Uzr2M4EEZALA3ocy7/kQ96MaQMZs5sr0qGDmZP0ycJp61odOL6caFLLLC7fLF8tBWi!JvKTluoMhjoKwGvGKEi6VJlRDsDtR9uFTAT/g+ytd6TF1yHOY5o78fjCiAb+wyHjZQS+hW/m
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1919
 by: Dennis Lee Bieber - Wed, 1 Sep 2021 20:02 UTC

On Wed, 1 Sep 2021 11:58:47 -0700 (PDT), Juan Rayas
<juan.m.rayas@gmail.com> declaimed the following:

>Does anyone know how to fix this when using the gmail server? Or perhaps I am using AWS incorrectly?
>
My first suggestion would be: don't use the gmail server!

If you must use it, you'll likely need to configure gmail for "less
secure apps" (basically anything that isn't a Google product <G>).
Google/Gmail wants OAUTH2 or something like that, along with TLS/SSL. "Less
secure" means bypassing the OAUTH2 scheme.

I wouldn't be surprised if they want you to set up a password for each
device used to connect...

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: Attempt to send email using AWS results in Socket closed by peer

<sgpgeu$1ogj$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5781&group=comp.lang.ada#5781

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!mRBVMlGoFUnDsRgMYRJiSw.user.46.165.242.75.POSTED!not-for-mail
From: haujekch...@gmail.com (Richard Iswara)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Thu, 2 Sep 2021 10:29:32 +0700
Organization: Aioe.org NNTP Server
Message-ID: <sgpgeu$1ogj$1@gioia.aioe.org>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="57875"; posting-host="mRBVMlGoFUnDsRgMYRJiSw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Richard Iswara - Thu, 2 Sep 2021 03:29 UTC

On 02/09/2021 01.58, Juan Rayas wrote:
> Hi,
>
> I am teaching myself Ada and tried to create a simple program that sends an email if today's date equals my birthday :).
>
> I am using Gnat Studio 2021, Community edition, Ubuntu 20.0.4. I downloaded, built and installed AWS. I am sending the email as follows:
>
> procedure SendMail is
> Status : AWS.SMTP.Status;
> Auth : aliased constant SMTP.Authentication.Plain.Credential :=
> SMTP.Authentication.Plain.Initialize
> ("myAccount", "myPassword");
> Isp : SMTP.Receiver;
>
> begin
> New_Line;
> Isp :=
> SMTP.Client.Initialize
> ("smtp.gmail.com", Port => 465,
> Credential => Auth'Unchecked_Access);
>
> SMTP.Client.Send
> (Isp, From => SMTP.E_Mail ("Me", "myAccount"),
> To => SMTP.E_Mail ("Me", "myAccount"),
> Subject => "AWS test",
> Message => "This is a test",
> Status => Status);
>
> if not SMTP.Is_Ok (Status) then
> Text_IO.Put_Line
> ("Can't send message :" & SMTP.Status_Message (Status));
> end if;
> end SendMail;
>
> myAccount and myPassword are removed for the purposes of this post.
>
> When I run my program, the SendEmail procedure fails with the following message:
>
> raised AWS.SMTP.SERVER_ERROR : raised AWS.NET.SOCKET_ERROR : Receive : Socket closed by peer
>
> Does anyone know how to fix this when using the gmail server? Or perhaps I am using AWS incorrectly?
>
> Thanks,
> Juan
>

Use a public email test server for testing program. Places like these:
https://www.bing.com/search?form=MOZLBR&pc=MOZI&q=email+test+servers. It
will show what's the received and sent responses.
The Gmail server marked your message as spam or worse and simply ignored
your message.

Re: Attempt to send email using AWS results in Socket closed by peer

<57j0jgd920r1al3ehsbilbs39041c3eeqd@4ax.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5782&group=comp.lang.ada#5782

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: doc...@tardis.org (Doctor Who)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Thu, 02 Sep 2021 06:03:11 +0200
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <57j0jgd920r1al3ehsbilbs39041c3eeqd@4ax.com>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="86bf2b29533c1d63229530be85c0816f";
logging-data="23610"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qQcp3XVbwqeof4tfiOwP2"
User-Agent: ForteAgent/8.00.32.1272
Cancel-Lock: sha1:mAgzjwDOoaXzTkGkFEy/cFinOnM=
 by: Doctor Who - Thu, 2 Sep 2021 04:03 UTC

On Wed, 1 Sep 2021 11:58:47 -0700 (PDT), Juan Rayas
<juan.m.rayas@gmail.com> wrote:

>Hi,
>
> I am teaching myself Ada and tried to create a simple program that sends an email if today's date equals my birthday :).
>
> I am using Gnat Studio 2021, Community edition, Ubuntu 20.0.4. I downloaded, built and installed AWS. I am sending the email as follows:
>
>procedure SendMail is
> Status : AWS.SMTP.Status;
> Auth : aliased constant SMTP.Authentication.Plain.Credential :=
> SMTP.Authentication.Plain.Initialize
> ("myAccount", "myPassword");
> Isp : SMTP.Receiver;
>
> begin
> New_Line;
> Isp :=
> SMTP.Client.Initialize
> ("smtp.gmail.com", Port => 465,
> Credential => Auth'Unchecked_Access);
>
> SMTP.Client.Send
> (Isp, From => SMTP.E_Mail ("Me", "myAccount"),
> To => SMTP.E_Mail ("Me", "myAccount"),
> Subject => "AWS test",
> Message => "This is a test",
> Status => Status);
>
> if not SMTP.Is_Ok (Status) then
> Text_IO.Put_Line
> ("Can't send message :" & SMTP.Status_Message (Status));
> end if;
> end SendMail;
>
>myAccount and myPassword are removed for the purposes of this post.
>
>When I run my program, the SendEmail procedure fails with the following message:
>
>raised AWS.SMTP.SERVER_ERROR : raised AWS.NET.SOCKET_ERROR : Receive : Socket closed by peer
>
>Does anyone know how to fix this when using the gmail server? Or perhaps I am using AWS incorrectly?
>
>Thanks,
>Juan

port 465 wants a TLS connection.

Re: Attempt to send email using AWS results in Socket closed by peer

<sgrimf$km9$1@franka.jacob-sparre.dk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5790&group=comp.lang.ada#5790

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Thu, 2 Sep 2021 17:19:58 -0500
Organization: JSA Research & Innovation
Lines: 13
Message-ID: <sgrimf$km9$1@franka.jacob-sparre.dk>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com> <sgol48$r20$1@gioia.aioe.org>
Injection-Date: Thu, 2 Sep 2021 22:20:00 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="21193"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Thu, 2 Sep 2021 22:19 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:sgol48$r20$1@gioia.aioe.org...
....
> Most mail servers do not accept unencrypted connections.

That's news to me, as my mail server (you know, the one that runs
Ada-Comment and the other ARG lists) doesn't support encrypted connections.
I don't have any problem sending to GMail (I send copies of most of my
personal mail there). Something else must be wrong.

Randy.

Re: Attempt to send email using AWS results in Socket closed by peer

<sgriru$dfj$1@franka.jacob-sparre.dk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5791&group=comp.lang.ada#5791

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Thu, 2 Sep 2021 17:22:53 -0500
Organization: JSA Research & Innovation
Lines: 14
Message-ID: <sgriru$dfj$1@franka.jacob-sparre.dk>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com> <57j0jgd920r1al3ehsbilbs39041c3eeqd@4ax.com>
Injection-Date: Thu, 2 Sep 2021 22:22:54 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="13811"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Thu, 2 Sep 2021 22:22 UTC

"Doctor Who" <doc@tardis.org> wrote in message
news:57j0jgd920r1al3ehsbilbs39041c3eeqd@4ax.com...
....
> port 465 wants a TLS connection.

Good point. One uses port 25 for ordinary e-mail. One does not need to
authenticate to most public e-mail servers (of course, if you don't, you'll
be subjected to increased spam checks, but that usually isn't a problem if
you aren't sending spam).

Randy.

Re: Attempt to send email using AWS results in Socket closed by peer

<sgsj2b$1it7$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5794&group=comp.lang.ada#5794

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Fri, 3 Sep 2021 09:32:27 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgsj2b$1it7$1@gioia.aioe.org>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
<sgol48$r20$1@gioia.aioe.org> <sgrimf$km9$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="52135"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Fri, 3 Sep 2021 07:32 UTC

On 2021-09-03 00:19, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:sgol48$r20$1@gioia.aioe.org...
> ...
>> Most mail servers do not accept unencrypted connections.
>
> That's news to me, as my mail server (you know, the one that runs
> Ada-Comment and the other ARG lists) doesn't support encrypted connections.
> I don't have any problem sending to GMail (I send copies of most of my
> personal mail there). Something else must be wrong.

The question is with what settings. There are hundreds of combinations
of Port x unencrypted|StartTLS|TLS x authentication method.

The port 465 was intended for TLS, then it was depreciated. Then they
introduced other ports. Legacy mail servers pissed that all on etc.

From experience, getting a SMTP client working is real pain.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Attempt to send email using AWS results in Socket closed by peer

<5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5795&group=comp.lang.ada#5795

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: doc...@tardis.org (Doctor Who)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Fri, 03 Sep 2021 10:59:31 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com> <sgol48$r20$1@gioia.aioe.org> <sgrimf$km9$1@franka.jacob-sparre.dk> <sgsj2b$1it7$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="eeb2cdb77a5db2d9d4ea4d851d19a53a";
logging-data="29498"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1832hleOamVEL2N0dqyI6LR"
User-Agent: ForteAgent/8.00.32.1272
Cancel-Lock: sha1:atu9HK5HxOnb8jRfXlHgNRcBwBs=
 by: Doctor Who - Fri, 3 Sep 2021 08:59 UTC

On Fri, 3 Sep 2021 09:32:27 +0200, "Dmitry A. Kazakov"
<mailbox@dmitry-kazakov.de> wrote:

>On 2021-09-03 00:19, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:sgol48$r20$1@gioia.aioe.org...
>> ...
>>> Most mail servers do not accept unencrypted connections.
>>
>> That's news to me, as my mail server (you know, the one that runs
>> Ada-Comment and the other ARG lists) doesn't support encrypted connections.
>> I don't have any problem sending to GMail (I send copies of most of my
>> personal mail there). Something else must be wrong.
>
>The question is with what settings. There are hundreds of combinations
>of Port x unencrypted|StartTLS|TLS x authentication method.
>
>The port 465 was intended for TLS, then it was depreciated. Then they
>introduced other ports. Legacy mail servers pissed that all on etc.
>
> From experience, getting a SMTP client working is real pain.

he is better off using his own provider's mail server on port 25, it
will accept username/password as authentication.

Re: Attempt to send email using AWS results in Socket closed by peer

<1194b579-9dc3-4e2e-b6ac-48755a7b2f10n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5799&group=comp.lang.ada#5799

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:7d88:: with SMTP id c8mr247120qtd.208.1630692702412;
Fri, 03 Sep 2021 11:11:42 -0700 (PDT)
X-Received: by 2002:a25:4441:: with SMTP id r62mr453348yba.166.1630692702181;
Fri, 03 Sep 2021 11:11:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 3 Sep 2021 11:11:41 -0700 (PDT)
In-Reply-To: <5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com>
Injection-Info: google-groups.googlegroups.com; posting-host=76.168.7.137; posting-account=d3k5YgoAAABkSw3WsP6aBXVx_QbzbTl9
NNTP-Posting-Host: 76.168.7.137
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
<sgol48$r20$1@gioia.aioe.org> <sgrimf$km9$1@franka.jacob-sparre.dk>
<sgsj2b$1it7$1@gioia.aioe.org> <5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1194b579-9dc3-4e2e-b6ac-48755a7b2f10n@googlegroups.com>
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
From: juan.m.r...@gmail.com (Juan Rayas)
Injection-Date: Fri, 03 Sep 2021 18:11:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 51
 by: Juan Rayas - Fri, 3 Sep 2021 18:11 UTC

On Friday, September 3, 2021 at 1:59:33 AM UTC-7, Doctor Who wrote:
> On Fri, 3 Sep 2021 09:32:27 +0200, "Dmitry A. Kazakov"
> <mai...@dmitry-kazakov.de> wrote:
>
> >On 2021-09-03 00:19, Randy Brukardt wrote:
> >> "Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> wrote in message
> >> news:sgol48$r20$1...@gioia.aioe.org...
> >> ...
> >>> Most mail servers do not accept unencrypted connections.
> >>
> >> That's news to me, as my mail server (you know, the one that runs
> >> Ada-Comment and the other ARG lists) doesn't support encrypted connections.
> >> I don't have any problem sending to GMail (I send copies of most of my
> >> personal mail there). Something else must be wrong.
> >
> >The question is with what settings. There are hundreds of combinations
> >of Port x unencrypted|StartTLS|TLS x authentication method.
> >
> >The port 465 was intended for TLS, then it was depreciated. Then they
> >introduced other ports. Legacy mail servers pissed that all on etc.
> >
> > From experience, getting a SMTP client working is real pain.
> he is better off using his own provider's mail server on port 25, it
> will accept username/password as authentication.
Hi all,

thank you for your comments and responses.

I tried changing the port number to 25, using the default port number in the SMTP.Client.Initialize procedure, and using other port numbers such as 587. I even tried just initializing the SMT server and sending the email (without authentication) as indicated in https://docs.adacore.com/aws-docs/aws/working_with_mails.html.

In all cases, I get the following error:

Can't send message :530 5.7.0 Must issue a STARTTLS command first. u7sm5705829pju.13 - gsmtp

The problem is I don't know how to send the STARTTLS command with AWS. Anyone know how?

My past experience was mostly with real-time embedded systems, so I don't have a lot of experience with email servers. I didn't expect this to be so difficult. Since this was mostly a toy to learn Ada, I may move on to other aspects of Ada for now.

Thanks for all your comments.
--Juan

Re: Attempt to send email using AWS results in Socket closed by peer

<sgtpl8$8vs$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5800&group=comp.lang.ada#5800

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Fri, 3 Sep 2021 20:31:06 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgtpl8$8vs$1@gioia.aioe.org>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
<sgol48$r20$1@gioia.aioe.org> <sgrimf$km9$1@franka.jacob-sparre.dk>
<sgsj2b$1it7$1@gioia.aioe.org> <5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com>
<1194b579-9dc3-4e2e-b6ac-48755a7b2f10n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="9212"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Fri, 3 Sep 2021 18:31 UTC

On 2021-09-03 20:11, Juan Rayas wrote:

> In all cases, I get the following error:
>
> Can't send message :530 5.7.0 Must issue a STARTTLS command first. u7sm5705829pju.13 - gsmtp
>
> The problem is I don't know how to send the STARTTLS command with AWS. Anyone know how?

There should be some settings parameter instructing the client to send
StartTLS right after it connects to the server. At least in my SMTP
implementation it is so.

But again, either port 587 or StartTLS, both require TLS, e.g. over
GNUTLS or else OpenSSL.

You need to tell AWS that you are going to use one them, specify the
certificates, the keys etc. You must really read the AWS documentation
regarding secure connections.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Attempt to send email using AWS results in Socket closed by peer

<h2u4jg1otr2tmsui20qbif5hmg4r5bi65m@4ax.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5801&group=comp.lang.ada#5801

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: doc...@tardis.org (Doctor Who)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Fri, 03 Sep 2021 21:33:15 +0200
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <h2u4jg1otr2tmsui20qbif5hmg4r5bi65m@4ax.com>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com> <sgol48$r20$1@gioia.aioe.org> <sgrimf$km9$1@franka.jacob-sparre.dk> <sgsj2b$1it7$1@gioia.aioe.org> <5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com> <1194b579-9dc3-4e2e-b6ac-48755a7b2f10n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="eeb2cdb77a5db2d9d4ea4d851d19a53a";
logging-data="8724"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196XaVaDYlm/EWw2xLaKYKA"
User-Agent: ForteAgent/8.00.32.1272
Cancel-Lock: sha1:DSprS4CTHK16q9aFq6B5HPp6fl8=
 by: Doctor Who - Fri, 3 Sep 2021 19:33 UTC

On Fri, 3 Sep 2021 11:11:41 -0700 (PDT), Juan Rayas
<juan.m.rayas@gmail.com> wrote:

>On Friday, September 3, 2021 at 1:59:33 AM UTC-7, Doctor Who wrote:
>> On Fri, 3 Sep 2021 09:32:27 +0200, "Dmitry A. Kazakov"
>> <mai...@dmitry-kazakov.de> wrote:
>>
>> >On 2021-09-03 00:19, Randy Brukardt wrote:
>> >> "Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> wrote in message
>> >> news:sgol48$r20$1...@gioia.aioe.org...
>> >> ...
>> >>> Most mail servers do not accept unencrypted connections.
>> >>
>> >> That's news to me, as my mail server (you know, the one that runs
>> >> Ada-Comment and the other ARG lists) doesn't support encrypted connections.
>> >> I don't have any problem sending to GMail (I send copies of most of my
>> >> personal mail there). Something else must be wrong.
>> >
>> >The question is with what settings. There are hundreds of combinations
>> >of Port x unencrypted|StartTLS|TLS x authentication method.
>> >
>> >The port 465 was intended for TLS, then it was depreciated. Then they
>> >introduced other ports. Legacy mail servers pissed that all on etc.
>> >
>> > From experience, getting a SMTP client working is real pain.
>> he is better off using his own provider's mail server on port 25, it
>> will accept username/password as authentication.
>Hi all,
>
> thank you for your comments and responses.
>
>I tried changing the port number to 25, using the default port number in the SMTP.Client.Initialize procedure, and using other port numbers such as 587. I even tried just initializing the SMT server and sending the email (without authentication) as indicated in https://docs.adacore.com/aws-docs/aws/working_with_mails.html.
>
>In all cases, I get the following error:
>
>Can't send message :530 5.7.0 Must issue a STARTTLS command first. u7sm5705829pju.13 - gsmtp
>
>The problem is I don't know how to send the STARTTLS command with AWS. Anyone know how?
>
>My past experience was mostly with real-time embedded systems, so I don't have a lot of experience with email servers. I didn't expect this to be so difficult. Since this was mostly a toy to learn Ada, I may move on to other aspects of Ada for now.
>
>Thanks for all your comments.
>--Juan

you have to change mail server:

Isp :=
SMTP.Client.Initialize
("smtp.gmail.com", Port => 465,
Credential => Auth'Unchecked_Access);

don't use gmail, use your provider mail server ...

Re: Attempt to send email using AWS results in Socket closed by peer

<907453a1-bee6-49b7-a181-04698d1d01adn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5803&group=comp.lang.ada#5803

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:7a98:: with SMTP id x24mr759200qtr.265.1630700987652;
Fri, 03 Sep 2021 13:29:47 -0700 (PDT)
X-Received: by 2002:a5b:58e:: with SMTP id l14mr1079914ybp.143.1630700987389;
Fri, 03 Sep 2021 13:29:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 3 Sep 2021 13:29:47 -0700 (PDT)
In-Reply-To: <h2u4jg1otr2tmsui20qbif5hmg4r5bi65m@4ax.com>
Injection-Info: google-groups.googlegroups.com; posting-host=76.168.7.137; posting-account=d3k5YgoAAABkSw3WsP6aBXVx_QbzbTl9
NNTP-Posting-Host: 76.168.7.137
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
<sgol48$r20$1@gioia.aioe.org> <sgrimf$km9$1@franka.jacob-sparre.dk>
<sgsj2b$1it7$1@gioia.aioe.org> <5to3jglkdgcm307ngd1ek8vjaqb7ofjk6e@4ax.com>
<1194b579-9dc3-4e2e-b6ac-48755a7b2f10n@googlegroups.com> <h2u4jg1otr2tmsui20qbif5hmg4r5bi65m@4ax.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <907453a1-bee6-49b7-a181-04698d1d01adn@googlegroups.com>
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
From: juan.m.r...@gmail.com (Juan Rayas)
Injection-Date: Fri, 03 Sep 2021 20:29:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Juan Rayas - Fri, 3 Sep 2021 20:29 UTC

On Friday, September 3, 2021 at 12:33:19 PM UTC-7, Doctor Who wrote:
> On Fri, 3 Sep 2021 11:11:41 -0700 (PDT), Juan Rayas
> <juan.m...@gmail.com> wrote:
>
> >On Friday, September 3, 2021 at 1:59:33 AM UTC-7, Doctor Who wrote:
> >> On Fri, 3 Sep 2021 09:32:27 +0200, "Dmitry A. Kazakov"
> >> <mai...@dmitry-kazakov.de> wrote:
> >>
> >> >On 2021-09-03 00:19, Randy Brukardt wrote:
> >> >> "Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> wrote in message
> >> >> news:sgol48$r20$1...@gioia.aioe.org...
> >> >> ...
> >> >>> Most mail servers do not accept unencrypted connections.
> >> >>
> >> >> That's news to me, as my mail server (you know, the one that runs
> >> >> Ada-Comment and the other ARG lists) doesn't support encrypted connections.
> >> >> I don't have any problem sending to GMail (I send copies of most of my
> >> >> personal mail there). Something else must be wrong.
> >> >
> >> >The question is with what settings. There are hundreds of combinations
> >> >of Port x unencrypted|StartTLS|TLS x authentication method.
> >> >
> >> >The port 465 was intended for TLS, then it was depreciated. Then they
> >> >introduced other ports. Legacy mail servers pissed that all on etc.
> >> >
> >> > From experience, getting a SMTP client working is real pain.
> >> he is better off using his own provider's mail server on port 25, it
> >> will accept username/password as authentication.
> >Hi all,
> >
> > thank you for your comments and responses.
> >
> >I tried changing the port number to 25, using the default port number in the SMTP.Client.Initialize procedure, and using other port numbers such as 587. I even tried just initializing the SMT server and sending the email (without authentication) as indicated in https://docs.adacore.com/aws-docs/aws/working_with_mails.html.
> >
> >In all cases, I get the following error:
> >
> >Can't send message :530 5.7.0 Must issue a STARTTLS command first. u7sm5705829pju.13 - gsmtp
> >
> >The problem is I don't know how to send the STARTTLS command with AWS. Anyone know how?
> >
> >My past experience was mostly with real-time embedded systems, so I don't have a lot of experience with email servers. I didn't expect this to be so difficult. Since this was mostly a toy to learn Ada, I may move on to other aspects of Ada for now.
> >
> >Thanks for all your comments.
> >--Juan
> you have to change mail server:
> Isp :=
> SMTP.Client.Initialize
> ("smtp.gmail.com", Port => 465,
> Credential => Auth'Unchecked_Access);
> don't use gmail, use your provider mail server ...
Hi all,

I changed the SMTP server to my ISP server (instead of Gmail), and changed the port back to 25. This worked!!

Thanks for your help and suggestions. Now on to learning other aspects of Ada.

--Juan

Re: Attempt to send email using AWS results in Socket closed by peer

<lywnnxcs8w.fsf@pushface.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5804&group=comp.lang.ada#5804

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Fri, 03 Sep 2021 21:35:11 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lywnnxcs8w.fsf@pushface.org>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="58418"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:iiMERVq9LZAFTEDNk9yK9Mog9+s=
 by: Simon Wright - Fri, 3 Sep 2021 20:35 UTC

Juan Rayas <juan.m.rayas@gmail.com> writes:

> Isp :=
> SMTP.Client.Initialize
> ("smtp.gmail.com", Port => 465,
> Credential => Auth'Unchecked_Access);

I succeed sending mail via gmail.com using port 587.

No useful further details on encryption - this was for the membership
d/b for a small club, and it's in Python/sqlite.

self.server = smtplib.SMTP(host=self.server_details['host'],
port=self.server_details['port'])
self.server.ehlo()
self.server.starttls()
self.server.ehlo()
self.server.login\
(user=server_details['user'],
password=keyring.get_password\
('u3a-email', server_details['user']))

Re: Attempt to send email using AWS results in Socket closed by peer

<sgu362$q1d$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5805&group=comp.lang.ada#5805

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Attempt to send email using AWS results in Socket closed by peer
Date: Fri, 3 Sep 2021 23:13:38 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgu362$q1d$1@gioia.aioe.org>
References: <57c7ca69-cc99-45ae-b494-580536a99ef4n@googlegroups.com>
<lywnnxcs8w.fsf@pushface.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="26669"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Fri, 3 Sep 2021 21:13 UTC

On 2021-09-03 22:35, Simon Wright wrote:
> Juan Rayas <juan.m.rayas@gmail.com> writes:
>
>> Isp :=
>> SMTP.Client.Initialize
>> ("smtp.gmail.com", Port => 465,
>> Credential => Auth'Unchecked_Access);
>
> I succeed sending mail via gmail.com using port 587.
>
> No useful further details on encryption - this was for the membership
> d/b for a small club, and it's in Python/sqlite.

GNUTLS and OpenSSL have ways to tell to use the system certificates.
E.g. if your Python application uses GNUTLS it would call

gnutls_certificate_set_x509_system_trust

and that should be enough to make successful handshaking afterwards.

> self.server = smtplib.SMTP(host=self.server_details['host'],
> port=self.server_details['port'])
> self.server.ehlo()
> self.server.starttls()

Here it switches transport to GNUTLS or OpenSSL and these perform TLS
handshaking. The following commands run over encrypted channel.

But with the port 587 you should actually begin with TLS straight away.
StartTLS is for servers which allow both secure and insecure
connections. This is usually the port 465. If you are OK with no
encryption you greet with HELO and then proceed with login. If you want
a secure connection you greet with EHLO and then send StartTLS.

> self.server.ehlo()
> self.server.login\
> (user=server_details['user'],
> password=keyring.get_password\
> ('u3a-email', server_details['user']))

This is very low-level. AWS design is far better, IMO.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor