aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-12-28 18:07:18 +0200
committerArnold D. Robbins <arnold@skeeve.com>2020-12-28 18:07:18 +0200
commitf113836a8fc282b7c7642eff82a4cf73d8e346fa (patch)
treeb86631e738f84ba40d7244e8c3c9cf2ac627c25f
parentce2fcf704aac494b44c78a34c714732685dfc1ad (diff)
downloadegawk-f113836a8fc282b7c7642eff82a4cf73d8e346fa.tar.gz
egawk-f113836a8fc282b7c7642eff82a4cf73d8e346fa.tar.bz2
egawk-f113836a8fc282b7c7642eff82a4cf73d8e346fa.zip
Additional update in gawkinet.texi.
-rw-r--r--awklib/eg/network/mailpopclient.awk16
-rw-r--r--doc/ChangeLog4
-rw-r--r--doc/gawkinet.info76
-rw-r--r--doc/gawkinet.texi18
4 files changed, 83 insertions, 31 deletions
diff --git a/awklib/eg/network/mailpopclient.awk b/awklib/eg/network/mailpopclient.awk
new file mode 100644
index 00000000..041c5629
--- /dev/null
+++ b/awklib/eg/network/mailpopclient.awk
@@ -0,0 +1,16 @@
+BEGIN {
+ POPService = "/inet/tcp/0/var{emailhost}/pop3"
+ RS = ORS = "\r\n"
+ print "user var{name}" |& POPService
+ POPService |& getline
+ print "pass var{password}" |& POPService
+ POPService |& getline
+ print "retr 1" |& POPService
+ POPService |& getline
+ if ($1 != "+OK") exit
+ print "quit" |& POPService
+ RS = "\r\n\\.\r\n"
+ POPService |& getline
+ print $0
+ close(POPService)
+}
diff --git a/doc/ChangeLog b/doc/ChangeLog
index cdd1d56b..7326172d 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2020-12-28 Juergen Kahrs <Juergen.Kahrs@googlemail.com>
+
+ * gawkinet.texi: Update mailpopclient.
+
2020-12-27 Juergen Kahrs <Juergen.Kahrs@googlemail.com>
* gawkinet.texi: Update finger client, add catpipe
diff --git a/doc/gawkinet.info b/doc/gawkinet.info
index 4b41d6fa..527f469f 100644
--- a/doc/gawkinet.info
+++ b/doc/gawkinet.info
@@ -1027,7 +1027,7 @@ File: gawkinet.info, Node: Email, Next: Web page, Prev: Setting Up, Up: Usin
The distribution of email is usually done by dedicated email servers
that communicate with your machine using special protocols. In this
-node we show how simple the basic steps are.
+node we show how simple the basic steps are.(1)
To receive email, we use the Post Office Protocol (POP). Sending can
be done with the much older Simple Mail Transfer Protocol (SMTP).
@@ -1071,6 +1071,21 @@ finds this sequence in the mail message, it quits. You can invoke this
program as often as you like; it does not delete the message it reads,
but instead leaves it on the server.
+ ---------- Footnotes ----------
+
+ (1) No, things are _not_ that simple any more. Things _were_ that
+simple when email was young in the 20th century. These days,
+unencrypted plaintext authentication is usually disallowed on non-secure
+connections. Since encryption of network connections is not supported
+in 'gawk', you should not use 'gawk' to write such scripts. We left
+this node as it is because it demonstrates how application level
+protocols work in principle (a command being issued by the client
+followed by a reply coming back). Unfortunately, modern application
+level protocols are much more flexible in the sequence of actions. For
+example, modern POP3 servers may introduce themselves with an unprompted
+initial line that arrives before the initial command. Dealing with such
+variance is not worth the effort in 'gawk'.
+

File: gawkinet.info, Node: Web page, Next: Primitive Service, Prev: Email, Up: Using Networking
@@ -4444,35 +4459,36 @@ Ref: Troubleshooting-Footnote-136096
Node: Interacting37053
Node: Setting Up41411
Node: Email45960
-Node: Web page48343
-Ref: Web page-Footnote-151163
-Ref: Web page-Footnote-251361
-Node: Primitive Service51855
-Node: Interacting Service54589
-Ref: Interacting Service-Footnote-163744
-Node: CGI Lib63776
-Node: Simple Server70776
-Ref: Simple Server-Footnote-178578
-Node: Caveats78679
-Node: Challenges79822
-Ref: Challenges-Footnote-188564
-Node: Some Applications and Techniques88665
-Node: PANIC91126
-Node: GETURL92852
-Node: REMCONF95485
-Node: URLCHK100981
-Node: WEBGRAB104825
-Node: STATIST109289
-Ref: STATIST-Footnote-1122437
-Node: MAZE122880
-Node: MOBAGWHO129105
-Ref: MOBAGWHO-Footnote-1143007
-Node: STOXPRED143075
-Node: PROTBASE157367
-Ref: PROTBASE-Footnote-1170534
-Node: Links170649
-Node: GNU Free Documentation License173540
-Node: Index198660
+Ref: Email-Footnote-148382
+Node: Web page49190
+Ref: Web page-Footnote-152010
+Ref: Web page-Footnote-252208
+Node: Primitive Service52702
+Node: Interacting Service55436
+Ref: Interacting Service-Footnote-164591
+Node: CGI Lib64623
+Node: Simple Server71623
+Ref: Simple Server-Footnote-179425
+Node: Caveats79526
+Node: Challenges80669
+Ref: Challenges-Footnote-189411
+Node: Some Applications and Techniques89512
+Node: PANIC91973
+Node: GETURL93699
+Node: REMCONF96332
+Node: URLCHK101828
+Node: WEBGRAB105672
+Node: STATIST110136
+Ref: STATIST-Footnote-1123284
+Node: MAZE123727
+Node: MOBAGWHO129952
+Ref: MOBAGWHO-Footnote-1143854
+Node: STOXPRED143922
+Node: PROTBASE158214
+Ref: PROTBASE-Footnote-1171381
+Node: Links171496
+Node: GNU Free Documentation License174387
+Node: Index199507

End Tag Table
diff --git a/doc/gawkinet.texi b/doc/gawkinet.texi
index 47d9a957..342b067b 100644
--- a/doc/gawkinet.texi
+++ b/doc/gawkinet.texi
@@ -1270,7 +1270,21 @@ BEGIN @{
@cindex Simple Mail Transfer Protocol (SMTP)
The distribution of email is usually done by dedicated email servers that
communicate with your machine using special protocols.
-In this @value{SECTION} we show how simple the basic steps are.
+In this @value{SECTION} we show how simple the basic steps are.@footnote{No,
+things are @emph{not} that simple any more. Things @emph{were} that simple
+when email was young in the 20th century. These days, unencrypted plaintext
+authentication is usually disallowed on non-secure connections.
+Since encryption of network connections is not supported in @command{gawk},
+you should not use @command{gawk} to write such scripts.
+We left this @value{SECTION} as it is because it demonstrates how
+application level protocols work in principle (a command being issued
+by the client followed by a reply coming back). Unfortunately, modern
+application level protocols are much more flexible in the sequence of
+actions. For example, modern POP3 servers may introduce themselves
+with an unprompted initial line that arrives before the initial command.
+Dealing with such variance is not worth the effort in @command{gawk}.}
+@c FIXME: This would be the proper place to refer to Arnold's work on
+@c writing SMTP client and server.
To receive email, we use the Post Office Protocol (POP). Sending can
be done with the much older Simple Mail Transfer Protocol (SMTP).
@@ -1285,6 +1299,7 @@ name or password. Replace them in the program and it
shows you the first email the server has in store:
@example
+@c file eg/network/mailpopclient.awk
BEGIN @{
POPService = "/inet/tcp/0/@var{emailhost}/pop3"
RS = ORS = "\r\n"
@@ -1301,6 +1316,7 @@ BEGIN @{
print $0
close(POPService)
@}
+@c endfile
@end example
@cindex RFC 1939