feat: saveEmail.js ,不在向 raw 字段插入数据

This commit is contained in:
shenjianZ 2025-08-02 10:55:29 +08:00
parent 77030cc8fc
commit ae870fb601
1 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ async function saveEmail(stream) {
// Now, parse the buffered email content
const parsed = await simpleParser(emailBuffer);
const rawEmail = emailBuffer.toString();
// const rawEmail = emailBuffer.toString(); // We are not saving the raw email content for now.
const recipient = parsed.to ? parsed.to.text : 'undisclosed-recipients';
const sender = parsed.from ? parsed.from.text : 'unknown-sender';
@ -33,8 +33,8 @@ async function saveEmail(stream) {
});
const [result] = await db.execute(
'INSERT INTO emails (recipient, sender, subject, body, raw, received_at) VALUES (?, ?, ?, ?, ?, ?)',
[recipient, sender, subject, body, rawEmail, received_at]
'INSERT INTO emails (recipient, sender, subject, body, received_at) VALUES (?, ?, ?, ?, ?)',
[recipient, sender, subject, body, received_at]
);
const newEmailId = result.insertId;