kenso war das

This commit is contained in:
2026-02-03 23:27:25 +01:00
parent 6bf3c603d8
commit ef2faa21fd
73 changed files with 8416 additions and 257 deletions

View File

@@ -107,7 +107,7 @@ export class GmailService {
/**
* Create or get a label
* @param {string} name - Label name (e.g., "EmailSorter/VIP")
* @param {string} name - Label name (e.g., "MailFlow/VIP")
* @param {string} color - Optional label color (must be from Gmail's palette)
*/
async createLabel(name, color = null) {
@@ -272,14 +272,14 @@ export class GmailService {
}
/**
* Cleanup old EmailSorter labels
* Removes all labels starting with "EmailSorter/" and old German labels
* Cleanup old MailFlow labels
* Removes all labels starting with "MailFlow/" and old German labels
*/
async cleanupOldLabels() {
// Old labels to remove (German and old format)
const OLD_LABELS = [
// Old "EmailSorter/" prefix labels
'EmailSorter/',
// Old "MailFlow/" prefix labels
'MailFlow/',
// Old German labels
'Wichtig', 'Kunden', 'Rechnungen', 'Sicherheit', 'Termine', 'Prüfen', 'Werbung',
'VIP / Wichtig', 'Kunden / Projekte', 'Rechnungen / Belege',
@@ -293,8 +293,8 @@ export class GmailService {
// Filter labels that match old patterns
const labelsToDelete = labels.filter(l => {
if (!l.name) return false
// Check for EmailSorter/ prefix
if (l.name.startsWith('EmailSorter/')) return true
// Check for MailFlow/ prefix
if (l.name.startsWith('MailFlow/')) return true
// Check for exact matches with old labels
if (OLD_LABELS.includes(l.name)) return true
return false

View File

@@ -7,7 +7,7 @@ import { ImapFlow } from 'imapflow'
import { log } from '../middleware/logger.mjs'
const INBOX = 'INBOX'
const FOLDER_PREFIX = 'EmailSorter'
const FOLDER_PREFIX = 'MailFlow'
/** Map category key to IMAP folder name */
export function getFolderNameForCategory(category) {
@@ -134,7 +134,7 @@ export class ImapService {
}
/**
* Ensure folder exists (create if not). Use subfolder under EmailSorter to avoid clutter.
* Ensure folder exists (create if not). Use subfolder under MailFlow to avoid clutter.
*/
async ensureFolder(folderName) {
const path = `${FOLDER_PREFIX}/${folderName}`
@@ -150,7 +150,7 @@ export class ImapService {
}
/**
* Move message (by UID) from INBOX to folder name (under EmailSorter/)
* Move message (by UID) from INBOX to folder name (under MailFlow/)
*/
async moveToFolder(messageId, folderName) {
const path = `${FOLDER_PREFIX}/${folderName}`

View File

@@ -302,7 +302,7 @@ export class OutlookService {
notificationUrl: webhookUrl,
resource: 'me/mailFolders(\'inbox\')/messages',
expirationDateTime,
clientState: 'email-sorter-webhook',
clientState: 'mailflow-webhook',
}),
})
}