fix(mail): migrate filesystem helpers to fsUtils, update DKIM and mail APIs, harden SMTP client, and bump dependencies

This commit is contained in:
2026-02-01 14:17:54 +00:00
parent dd4ac9fa3d
commit d54831765b
38 changed files with 3923 additions and 5335 deletions

View File

@@ -650,7 +650,7 @@ export class BounceManager {
await this.storageManager.set('/email/bounces/suppression-list.json', suppressionData);
} else {
// Fall back to filesystem
plugins.smartfile.memory.toFsSync(
plugins.fsUtils.toFsSync(
suppressionData,
plugins.path.join(paths.dataDir, 'emails', 'suppression_list.json')
);
@@ -744,9 +744,9 @@ export class BounceManager {
// Ensure directory exists
const bounceDir = plugins.path.join(paths.dataDir, 'emails', 'bounces');
plugins.smartfile.fs.ensureDirSync(bounceDir);
plugins.fsUtils.ensureDirSync(bounceDir);
plugins.smartfile.memory.toFsSync(bounceData, bouncePath);
plugins.fsUtils.toFsSync(bounceData, bouncePath);
}
} catch (error) {
logger.log('error', `Failed to save bounce record: ${error.message}`);

View File

@@ -613,17 +613,18 @@ export class Email {
}
// Add attachments
const smartFileFactory = plugins.smartfile.SmartFileFactory.nodeFs();
for (const attachment of this.attachments) {
const smartAttachment = await plugins.smartfile.SmartFile.fromBuffer(
const smartAttachment = smartFileFactory.fromBuffer(
attachment.filename,
attachment.content
);
// Set content type if available
if (attachment.contentType) {
(smartAttachment as any).contentType = attachment.contentType;
}
smartmail.addAttachment(smartAttachment);
}