aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg/network/mailpopclient.awk
blob: 041c56296c29b537a8bcefed6195c16da89e04cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
}