summaryrefslogtreecommitdiff
path: root/appl/lib/pop3.b
diff options
context:
space:
mode:
Diffstat (limited to 'appl/lib/pop3.b')
-rw-r--r--appl/lib/pop3.b10
1 files changed, 8 insertions, 2 deletions
diff --git a/appl/lib/pop3.b b/appl/lib/pop3.b
index 4081b279..ce297004 100644
--- a/appl/lib/pop3.b
+++ b/appl/lib/pop3.b
@@ -5,6 +5,8 @@ include "sys.m";
include "draw.m";
include "bufio.m";
bufio : Bufio;
+include "dial.m";
+ dial: Dial;
include "pop3.m";
FD, Connection: import sys;
@@ -26,14 +28,17 @@ open(user, password, server : string): (int, string)
if (!inited) {
sys = load Sys Sys->PATH;
bufio = load Bufio Bufio->PATH;
+ dial = load Dial Dial->PATH;
inited = 1;
}
if (conn)
return (-1, "connection is already open");
if (server == nil)
server = "$pop3";
- (ok, c) := sys->dial ("net!" + server + "!110", nil);
- if (ok < 0)
+ else
+ server = dial->netmkaddr(server, "net", "110");
+ c := dial->dial(server, nil);
+ if (c == nil)
return (-1, "dialup failed");
ibuf = bufio->fopen(c.dfd, Bufio->OREAD);
obuf = bufio->fopen(c.dfd, Bufio->OWRITE);
@@ -42,6 +47,7 @@ open(user, password, server : string): (int, string)
cread = chan of (int, string);
spawn mreader(cread);
(rpid, nil) = <- cread;
+ ok: int;
(ok, s) = mread();
if (ok < 0)
return (-1, s);