xref: /inferno-os/module/pop3.m (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
1# pop3 protocol independent access to an email server.
2
3Pop3: module
4{
5	PATH: con "/dis/lib/pop3.dis";
6
7	# all functions return status (-ve when error)
8
9         # open a connection with the pop3 server
10         # requires the email server's name or address or nil if a default server is to be used
11	# returns (status, errror string)
12         open: fn(user, password, server: string) : (int, string);
13
14	# stat the user's mailbox
15	# returns (status, error string, no. messages, total no. bytes)
16	stat: fn(): (int, string, int, int);
17
18	# list the user's mailbox
19	# returns (status, error string, list of (message no., bytes in message))
20	msglist: fn(): (int, string, list of (int, int));
21
22	# list as above but return (status, error string, list of message nos.)
23	msgnolist: fn(): (int, string, list of int);
24
25	# top of a message given it's no.
26	# returns (status, error string, message top)
27	top: fn(m: int) : (int, string, string);
28
29	# full text of a message given it's no.
30	# returns (status, error string, message)
31	get: fn(m: int) : (int, string, string);
32
33	# delete a message given it's no.
34	# returns (status, error string)
35	delete: fn(m: int) : (int, string);
36
37         # close the connection
38	# returns (status, error string)
39         close: fn(): (int, string);
40};
41