save attachment from email in customer data and - or contracts
This commit is contained in:
@@ -163,12 +163,12 @@ export async function fetchEmails(
|
||||
return [];
|
||||
}
|
||||
|
||||
// E-Mails abrufen
|
||||
for await (const message of client.fetch(limitedUids, {
|
||||
uid: true,
|
||||
// E-Mails abrufen - drittes Argument { uid: true } für UID FETCH
|
||||
for await (const message of client.fetch(limitedUids.join(','), {
|
||||
uid: true, // UID im Response inkludieren
|
||||
envelope: true,
|
||||
source: true, // Vollständige E-Mail für Parsing
|
||||
})) {
|
||||
}, { uid: true })) {
|
||||
try {
|
||||
// Source muss vorhanden sein
|
||||
if (!message.source) {
|
||||
@@ -389,10 +389,10 @@ export async function fetchAttachment(
|
||||
// E-Mail per UID abrufen
|
||||
let attachment: EmailAttachmentData | null = null;
|
||||
|
||||
for await (const message of client.fetch([uid], {
|
||||
uid: true,
|
||||
// Drittes Argument { uid: true } sorgt dafür, dass UID FETCH statt FETCH verwendet wird
|
||||
for await (const message of client.fetch(uid.toString(), {
|
||||
source: true,
|
||||
})) {
|
||||
}, { uid: true })) {
|
||||
if (!message.source) continue;
|
||||
|
||||
// E-Mail parsen
|
||||
@@ -555,10 +555,10 @@ export async function fetchAttachmentList(
|
||||
await client.connect();
|
||||
await client.mailboxOpen(folder);
|
||||
|
||||
for await (const message of client.fetch([uid], {
|
||||
uid: true,
|
||||
// Drittes Argument { uid: true } für UID FETCH
|
||||
for await (const message of client.fetch(uid.toString(), {
|
||||
source: true,
|
||||
})) {
|
||||
}, { uid: true })) {
|
||||
if (!message.source) continue;
|
||||
|
||||
const parsed = await simpleParser(message.source);
|
||||
|
||||
Reference in New Issue
Block a user