feat(core): the e-mail program after Java, measured against Java
The program sends to its account's SMTP server, one connection for each recipient, and fetches its mails by POP3; the server now sends mails on to other domains by MX and returns notices to their senders. The program's folders are in the snapshot and go back into the project. EmailClientRun plays six stories with two servers; the mail oracles run in the language's locale, so Java's notice dates match the core's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// message bundle says them: for comparing the core's structured lines with
|
||||
// what the Java oracle recorded (echoJava.test.ts, webJava.test.ts).
|
||||
|
||||
import type { EchoServerLogEntry, EmailServerLogEntry, PageLanguage, SendFailure, SimpleClientLogEntry, WebBrowserLogEntry } from '../src/index.js';
|
||||
import type { EchoServerLogEntry, EmailClientLogEntry, EmailServerLogEntry, PageLanguage, SendFailure, SimpleClientLogEntry, WebBrowserLogEntry } from '../src/index.js';
|
||||
|
||||
/** Java's client and server look every 100 ms whether they are connected, or switched off; the core at once. */
|
||||
export const POLL_MILLISECONDS = 100;
|
||||
@@ -102,5 +102,34 @@ export function emailServerText(entry: EmailServerLogEntry, language: PageLangua
|
||||
return language === 'de' ? `Fehler beim Senden an ${entry.address}` : `Error while sending ${entry.address}`;
|
||||
case 'stored':
|
||||
return language === 'de' ? `E-Mail für ${entry.username} im Postfach gespeichert.` : `E-mail for ${entry.username} saved in mailbox.`;
|
||||
default:
|
||||
return emailClientText(entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* What the SMTP and POP3 clients tell the program they work for, as Java's
|
||||
* observers get it (sw_smtpclient_msg1 to msg4; a failure as Java's
|
||||
* exception prints itself; the window shows its message).
|
||||
*/
|
||||
export function emailClientText(entry: EmailClientLogEntry): string {
|
||||
switch (entry.kind) {
|
||||
case 'connectionStarting':
|
||||
return '----';
|
||||
case 'smtpConnected':
|
||||
return `Verbindung zu ${entry.address}:${entry.port} hergestellt`;
|
||||
case 'mailSent':
|
||||
return `Mail versendet an ${entry.recipients}`;
|
||||
case 'smtpDisconnected':
|
||||
return `Verbindung zu ${entry.address}:${entry.port} getrennt`;
|
||||
case 'failed':
|
||||
switch (entry.failure.kind) {
|
||||
case 'answer':
|
||||
return `java.lang.Exception: ${entry.failure.text}`;
|
||||
case 'connect':
|
||||
return entry.failure.failure === 'timedOut' ? `filius.exception.TimeOutException: ${CONNECT_FAILURES.timedOut}` : `filius.exception.VerbindungsException: ${CONNECT_FAILURES[entry.failure.failure]}`;
|
||||
case 'receiveFailed':
|
||||
return 'filius.exception.VerbindungsException: Verbindung nicht aufgebaut!';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user