diff options
Diffstat (limited to 'awklib')
-rw-r--r-- | awklib/eg/network/mailpopclient.awk | 16 |
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) +} |