PopClient class

Client to access POP3 compliant servers. Compare https://tools.ietf.org/html/rfc1939 for details.

Constructors

PopClient({bool isLogEnabled = false, String? logName, bool onBadCertificate(X509Certificate)?})
Creates a new PopClient

Properties

connectionInfo ↔ ConnectionInfo
Information about the connection
getter/setter pairinherited
eventStream → Stream<PopEvent>
Allows listening to events fired by this PopClient.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isConnected → bool
Ist the client currently connected?
no setterinherited
isLogEnabled ↔ bool
true when the log is enabled
getter/setter pairinherited
isLoggedIn ↔ bool
true after the user has authenticated
getter/setter pairinherited
isSocketClosingExpected ↔ bool
true when it is expected that the socket is closed
getter/setter pairinherited
logName ↔ String?
The name shown in log entries to differentiate this server
getter/setter pairinherited
onBadCertificate → bool Function(X509Certificate)?
Handles unverifiable certificates.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securityContext → SecurityContext?
Optional SecurityContext for mTLS (mutual TLS).
finalinherited
serverInfo ↔ PopServerInfo
Information about the remote POP server
getter/setter pair

Methods

connect(Socket socket, {ConnectionInfo? connectionInformation}) → void
Starts to listen on the given socket.
inherited
connectToServer(String host, int port, {bool isSecure = true, Duration timeout = const Duration(seconds: 20)}) → Future<ConnectionInfo>
Connects to the specified server.
inherited
createClientError(String message) → Object
Subclasses need to be able to create client specific exceptions
delete(int messageId) → Future<void>
Marks the message with the specified messageId as deleted
disconnect() → Future<void>
Disconnects from the service
inherited
list([int? messageId]) → Future<List<MessageListing>>
Checks the ID and size of all messages or of the message with the specified messageId
log(dynamic logObject, {bool isClient = true, String? initial}) → void
Logs the data
inherited
logApp(dynamic logObject) → void
Logs the data from the app-side
inherited
logClient(dynamic logObject) → void
Logs the data from the client-side
inherited
login(String name, String password) → Future<void>
Logs the user in with the default USER and PASS commands.
loginWithApop(String name, String password) → Future<void>
Logs the user in with the APOP command.
logServer(dynamic logObject) → void
Logs the data from the server-side
inherited
noop() → Future<void>
Keeps the connection alive
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onConnectionDone() → void
Informs about a closed connection
inherited
onConnectionError(dynamic error) → void
Is called when the connection encountered an error
onConnectionEstablished(ConnectionInfo connectionInfo, String serverGreeting) → FutureOr<void>
Is called after the initial connection has been established
onDataReceived(Uint8List data) → void
Is called when data is received
onServerResponse(List<String> responseTexts) → void
Processes server responses
quit() → Future<void>
Ends the POP session.
reset() → Future<void>
Keeps any messages that are marked as deleted
retrieve(int messageId) → Future<MimeMessage>
Downloads the message with the specified messageId
retrieveTopLines(int messageId, int numberOfLines) → Future<MimeMessage>
Downloads the first numberOfLines lines of the message with the given messageId
sendCommand<T>(PopCommand<T> command) → Future<T>
Sends the specified command to the remote POP server
startTls() → Future<void>
Upgrades the current insure connection to SSL.
status() → Future<PopStatus>
Checks the status ie the total number of messages and their size
toString() → String
A string representation of this object.
inherited
uidList([int? messageId]) → Future<List<MessageListing>>
Checks the ID and UID of all messages or of the message with the specified messageId
upgradeToSslSocket() → Future<void>
Upgrades the current connection to a secure socket
inherited
writeData(List<int> data, [dynamic logObject]) → Future
Writes the specified data.
inherited
writeText(String text, [dynamic logObject, Duration? timeout]) → Future
Writes the specified text.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited