panel 2 courier api restore

This commit is contained in:
alma 2025-04-25 20:22:23 +02:00
parent ec725ae8c1
commit c4f9bee7ee

View File

@ -175,11 +175,17 @@ export async function GET(request: Request) {
// Function to get mailboxes
const getMailboxes = async () => {
const mailboxes = [];
for await (const mailbox of imapClient.listMailboxes()) {
mailboxes.push(mailbox);
try {
const mailboxes = [];
const list = await imapClient.list();
for (const mailbox of list) {
mailboxes.push(mailbox.path);
}
return mailboxes;
} catch (error) {
console.error("Error listing mailboxes:", error);
return [];
}
return mailboxes;
};
// Setup paging