The collecting half, on TsmCustomTLSClient, and the same shape as
StreamSec.Mail.SMTPClient: Open brings the session to TRANSACTION state -
connect, greeting, CAPA, STLS and a SECOND CAPA on the upgrade path,
authentication when UserName is set - and everything after that is a command.
THE SECOND CAPA IS NOT TIDINESS. The capability list read in cleartext was
chosen by whoever controlled the cleartext connection, which on the upgrade
path is exactly the attacker STLS exists to remove. Learn it again inside TLS
or the client is deciding what to do next from data the attacker wrote.
IT WILL NOT SEND A PASSWORD IN THE CLEAR, whatever the consumer configured.
USER/PASS is the password itself; SASL PLAIN and LOGIN are the password under
base64. All three are refused on a cleartext connection unconditionally -
stricter than RequireTLS, and the same posture TsmCustomSMTPClient takes.
APOP is not implemented: it is the one mechanism that does NOT send the
password, but it requires the SERVER to hold something equivalent to it, and
this library's own server keeps an Argon2id verifier precisely so it cannot.
READING A MULTI-LINE RESPONSE IS DONE ON RAW OCTETS, not through the base's
ReadLine, and for two independent reasons:
- ReadLine accepts a BARE LF as a terminator. On input this client
recognises the end of a response ONLY at CRLF '.' CRLF, so an embedded
bare newline in somebody's mail cannot truncate a retrieval and leave the
remainder to be parsed as protocol. That is the strict half of the
asymmetry whose lenient half is in the server's stuffer.
- ReadLine returns a string. A retrieved message is OCTETS - it may be
8-bit, it may be a signature's exact input - and reassembling it through
a string loses precisely what S/MIME and DKIM verify over.Feature notes: Mail subsystem notes (SMTP / POP3 / IMAP)
inherits from eTLSClientError
constructor CreateFail(const aCommand, aText: string);
property Command: string read fCommand;
inherits from TsmCustomTLSClient
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Open;
procedure Close;
procedure Stat(out aCount: Integer; out aOctets: Int64);
procedure List(aDest: TStrings);
function ListOne(aIndex: Integer): Int64;
procedure Uidl(aDest: TStrings);
function UidlOne(aIndex: Integer): string;
function Retrieve(aIndex: Integer): tBytes; overload;
procedure Retrieve(aIndex: Integer; aDest: TStream); overload;
procedure Retrieve(aIndex: Integer; aMessage: TsmEmail); overload;
function Top(aIndex, aLines: Integer): tBytes;
procedure Delete(aIndex: Integer);
procedure Reset;
procedure Noop;
procedure SetPassword(const aValue: string);
property Password: iSecretKey read fPassword write fPassword;
property Capabilities: TStrings read GetCapabilities;
function SupportsCapability(const aName: string): Boolean;
function CapabilityParams(const aName: string): string;
property LastReplyText: string read fLastReplyText;
property Authenticated: Boolean read fAuthenticated;
property SessionOpen: Boolean read fSessionOpen;
property UserName: string read fUserName write fUserName;
property AuthMechanism: tPOP3AuthMechanism read fAuthMechanism write fAuthMechanism default pamAuto;
property ReplyTimeout: Cardinal read fReplyTimeout write fReplyTimeout default cPOP3DefaultReplyTimeout;
property DataTimeout: Cardinal read fDataTimeout write fDataTimeout default cPOP3DefaultDataTimeout;
property MaxResponse: Integer read fMaxResponse write fMaxResponse default cPOP3DefaultMaxResponse;
inherits from TsmCustomPOP3Client
The self-contained tier: creates and owns its TLS engine, so a client dropped on a form works with no other component wired up. Reach into TLSServer for trust anchors (LoadRootCertsFromFile).
property TLSServer: TsmSimpleTLSInternalServer read GetTLSServer write SetOwnTLSServer;
inherits from TsmCustomPOP3Client
The tier that takes an EXTERNAL engine, so several clients share one set of trust anchors; nil falls back to GlobalServer.
property TLSServer;
pamAuto prefers SASL PLAIN when the server advertises it and falls back to USER/PASS, which every server has. The explicit members force one.