The Java view now reads what FILIUS 2.14 keeps for its e-mail programs: the server's domain, switch and bean accounts with their mailboxes, and the accounts of /mailserver/konten.txt, which Java reads at every simulation start and which so win over the bean list; the client's three folders and address book, and its account from /konten.txt (no bean holds it). javaEmail.ts ports the bean setters and both file readers (stringZuListeBenutzerkonten, EmailKonto(String)); javaString.ts Java's trim, split and StringTokenizer; javaFileSystem.ts the file lookup, now shared with the DNS server, with the four non-ASCII units Java's equalsIgnoreCase also takes for an ASCII letter (measured over the BMP). Checked against Java on the corpus (the oracle dumps the e-mail state) and on 43 account files read by EmailServer.kontenLaden and EmailAnwendung.laden (EmailFileCases). Found: older files keep recipients as strings in the typed lists; a getter copy of the sender is filled and set back; one short server line makes Java throw for the whole file; a message with an empty text is lost on reading; a broken last client line empties the account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
// The e-mail beans under Java's property names, as FlsOracle.java and
|
|
// EmailFileCases.java write them.
|
|
|
|
import type { JavaEmail, JavaEmailAccount, JavaRecipient } from '../src/index.js';
|
|
|
|
export function javaEmailAccount(account: JavaEmailAccount) {
|
|
return {
|
|
benutzername: account.username,
|
|
passwort: account.password,
|
|
nachname: account.lastName,
|
|
vorname: account.firstName,
|
|
emailAdresse: account.emailAddress,
|
|
pop3server: account.pop3Server,
|
|
pop3port: account.pop3Port,
|
|
smtpserver: account.smtpServer,
|
|
smtpport: account.smtpPort,
|
|
nachrichten: account.messages.map(javaEmail),
|
|
};
|
|
}
|
|
|
|
export function javaEmail(email: JavaEmail) {
|
|
const recipient = (entry: JavaRecipient) =>
|
|
entry === null ? null : typeof entry === 'string' ? ['string', entry] : [entry.name, entry.mailAddress];
|
|
return {
|
|
absender: [email.sender.name, email.sender.mailAddress],
|
|
empfaenger: email.to.map(recipient),
|
|
cc: email.cc.map(recipient),
|
|
bcc: email.bcc.map(recipient),
|
|
betreff: email.subject,
|
|
text: email.text,
|
|
dateReceived: email.dateReceived,
|
|
neu: email.isNew,
|
|
delete: email.isDeleted,
|
|
versendet: email.isSent,
|
|
};
|
|
}
|
|
|