aboutsummaryrefslogtreecommitdiffstats
path: root/awklib
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-12-28 18:07:45 +0200
committerArnold D. Robbins <arnold@skeeve.com>2020-12-28 18:07:45 +0200
commit7c95bf2e5e112f1acdf2e058daaac3cdb2b0bb12 (patch)
tree4081ccf5e573da276658e18be275132d78a16a33 /awklib
parent7920288ae1ac5fcf167421223517e338eca68897 (diff)
parentf113836a8fc282b7c7642eff82a4cf73d8e346fa (diff)
downloadegawk-7c95bf2e5e112f1acdf2e058daaac3cdb2b0bb12.tar.gz
egawk-7c95bf2e5e112f1acdf2e058daaac3cdb2b0bb12.tar.bz2
egawk-7c95bf2e5e112f1acdf2e058daaac3cdb2b0bb12.zip
Merge branch 'gawk-5.1-stable'
Diffstat (limited to 'awklib')
-rw-r--r--awklib/eg/network/mailpopclient.awk16
1 files changed, 16 insertions, 0 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)
+}