feat(fls): import the e-mail programs into the editor model
The e-mail client and server of every host come into the model (core: EmailClientConfiguration, EmailServerConfiguration, EmailMessage), from Java's view: - the server's accounts are those of /mailserver/konten.txt, as Java reads them at every simulation start; without the file those of the bean list, which Java would drop; - the client's account is that of /konten.txt; without it the first of an older file's kontoListe, which FILIUS 2.14 no longer reads; - messages are numbered per program in folder order, as Swift does; the sent folder's are sent; a date is taken only when the file gives one. Departures from Swift: accounts and messages stay where Swift drops what fails its checks; first and last name stay apart; a port that is no number is the default, with a warning. On the corpus the model matches Swift's on all 13 files; the one Swift error is named (it numbers a mailbox's messages as their received time and writes that into the konten.txt it rewrites). The Swift dump now carries the e-mail state, and the file system comparison leaves out only Swift's hidden state files (and the directories it makes for them) instead of all of /mail, /mailserver and /peer2peer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -201,6 +201,86 @@ export interface DnsServerConfiguration {
|
||||
readonly records: readonly DnsResourceRecord[];
|
||||
}
|
||||
|
||||
/**
|
||||
* An e-mail address as Java's AddressEntry holds it: a display name, an
|
||||
* address, or both (Swift's TopologyRuntimeEmailAddress wants the address).
|
||||
*/
|
||||
export interface EmailAddress {
|
||||
readonly name: string | null;
|
||||
readonly mailAddress: string | null;
|
||||
}
|
||||
|
||||
/** An e-mail (Swift's TopologyRuntimeEmailMessage without its run-time delivery identity). */
|
||||
export interface EmailMessage {
|
||||
/** Numbered from 1 per program, in folder order, as Swift numbers them. */
|
||||
readonly id: number;
|
||||
readonly from: EmailAddress;
|
||||
readonly to: readonly EmailAddress[];
|
||||
readonly cc: readonly EmailAddress[];
|
||||
readonly bcc: readonly EmailAddress[];
|
||||
readonly subject: string;
|
||||
readonly body: string;
|
||||
/** Only when the file gives one; Java never sets it. */
|
||||
readonly receivedAtMilliseconds?: number;
|
||||
readonly isNew: boolean;
|
||||
readonly isMarkedForDeletion: boolean;
|
||||
/** A message of the sent folder. */
|
||||
readonly isSent: boolean;
|
||||
}
|
||||
|
||||
/** The account an e-mail client uses. First and last name stay apart, as Java keeps them. */
|
||||
export interface EmailClientAccount {
|
||||
readonly pop3Host: string;
|
||||
readonly pop3Port: number;
|
||||
readonly smtpHost: string;
|
||||
readonly smtpPort: number;
|
||||
readonly username: string;
|
||||
readonly password: string;
|
||||
readonly firstName: string;
|
||||
readonly lastName: string;
|
||||
readonly email: string;
|
||||
}
|
||||
|
||||
/** Java's Kontakt: an address book entry. */
|
||||
export interface EmailContact {
|
||||
readonly name: string;
|
||||
readonly firstName: string;
|
||||
readonly street: string;
|
||||
readonly houseNumber: number;
|
||||
readonly postalCode: number;
|
||||
readonly city: string;
|
||||
readonly email: string;
|
||||
readonly phone: string;
|
||||
}
|
||||
|
||||
export interface EmailClientConfiguration {
|
||||
/** Null when the client has none (Java opens it without one). */
|
||||
readonly account: EmailClientAccount | null;
|
||||
readonly inbox: readonly EmailMessage[];
|
||||
readonly sent: readonly EmailMessage[];
|
||||
readonly drafts: readonly EmailMessage[];
|
||||
readonly addressBook: readonly EmailContact[];
|
||||
readonly nextMessageID: number;
|
||||
}
|
||||
|
||||
export interface EmailServerAccount {
|
||||
readonly username: string;
|
||||
readonly password: string;
|
||||
readonly firstName: string;
|
||||
readonly lastName: string;
|
||||
readonly mailbox: readonly EmailMessage[];
|
||||
}
|
||||
|
||||
export interface EmailServerConfiguration {
|
||||
readonly domain: string;
|
||||
readonly pop3Port: number;
|
||||
readonly accounts: readonly EmailServerAccount[];
|
||||
readonly nextMessageID: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_POP3_PORT = 110;
|
||||
export const DEFAULT_SMTP_PORT = 25;
|
||||
|
||||
/**
|
||||
* Java's echo server (ServerBaustein) and generic client (ClientBaustein)
|
||||
* keep their port and target in the file; Swift asks for them at run time.
|
||||
|
||||
Reference in New Issue
Block a user