aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg/network/mailpopclient.awk
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 /awklib/eg/network/mailpopclient.awk
parentce2fcf704aac494b44c78a34c714732685dfc1ad (diff)
downloadegawk-f113836a8fc282b7c7642eff82a4cf73d8e346fa.tar.gz
egawk-f113836a8fc282b7c7642eff82a4cf73d8e346fa.tar.bz2
egawk-f113836a8fc282b7c7642eff82a4cf73d8e346fa.zip
Additional update in gawkinet.texi.
Diffstat (limited to 'awklib/eg/network/mailpopclient.awk')
-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)
+}