Do not run the CI workflow on pull requests.
[mailpopbox.git] / pop3 / server.go
1 // mailpopbox
2 // Copyright 2020 Blue Static <https://www.bluestatic.org>
3 // This program is free software licensed under the GNU General Public License,
4 // version 3.0. The full text of the license can be found in LICENSE.txt.
5 // SPDX-License-Identifier: GPL-3.0-only
6
7 package pop3
8
9 import (
10 "io"
11 )
12
13 type Message interface {
14 UniqueID() string
15 ID() int
16 Size() int
17 Deleted() bool
18 }
19
20 type Mailbox interface {
21 ListMessages() ([]Message, error)
22 GetMessage(int) Message
23 Retrieve(Message) (io.ReadCloser, error)
24 Delete(Message) error
25 Close() error
26 Reset()
27 }
28
29 type PostOffice interface {
30 Name() string
31 OpenMailbox(user, pass string) (Mailbox, error)
32 }