feat(rust): scaffold Rust workspace and fix TypeScript build errors

- Add @git.zone/tsrust with linux_amd64/linux_arm64 cross-compilation
- Scaffold Rust workspace with 5 crates: mailer-core, mailer-smtp, mailer-security, mailer-napi, mailer-bin
- Fix all TypeScript compilation errors for upgraded dependencies (smartfile v13, mailauth v4.13, smartproxy v23)
- Replace smartfile.fs/memory with @push.rocks/smartfs throughout codebase
- Fix .ts import extensions to .js for NodeNext module resolution
- Update DKIMSignOptions usage to match mailauth v4.13 API
- Add MTA error classes with permissive signatures for legacy SMTP client
- Replace removed DcRouter/StorageManager/deliverability imports with local interfaces
This commit is contained in:
2026-02-10 15:31:31 +00:00
parent bcde137332
commit 237dba3bab
86 changed files with 6518 additions and 2869 deletions

View File

@@ -1,9 +1,9 @@
import * as plugins from '../../plugins.ts';
import * as paths from '../../paths.ts';
import { logger } from '../../logger.ts';
import { SecurityLogger, SecurityLogLevel, SecurityEventType } from '../../security/index.ts';
import * as plugins from '../../plugins.js';
import * as paths from '../../paths.js';
import { logger } from '../../logger.js';
import { SecurityLogger, SecurityLogLevel, SecurityEventType } from '../../security/index.js';
import { LRUCache } from 'lru-cache';
import type { Email } from './classes.email.ts';
import type { Email } from './classes.email.js';
/**
* Bounce types for categorizing the reasons for bounces
@@ -650,10 +650,9 @@ export class BounceManager {
await this.storageManager.set('/email/bounces/suppression-list.json', suppressionData);
} else {
// Fall back to filesystem
plugins.smartfile.memory.toFsSync(
suppressionData,
await plugins.smartfs.file(
plugins.path.join(paths.dataDir, 'emails', 'suppression_list.json')
);
).write(suppressionData);
}
} catch (error) {
logger.log('error', `Failed to save suppression list: ${error.message}`);
@@ -744,9 +743,9 @@ export class BounceManager {
// Ensure directory exists
const bounceDir = plugins.path.join(paths.dataDir, 'emails', 'bounces');
plugins.smartfile.fs.ensureDirSync(bounceDir);
plugins.smartfile.memory.toFsSync(bounceData, bouncePath);
await plugins.smartfs.directory(bounceDir).recursive().create();
await plugins.smartfs.file(bouncePath).write(bounceData);
}
} catch (error) {
logger.log('error', `Failed to save bounce record: ${error.message}`);