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 // Function to get mailboxes
const getMailboxes = async () => { const getMailboxes = async () => {
try {
const mailboxes = []; const mailboxes = [];
for await (const mailbox of imapClient.listMailboxes()) { const list = await imapClient.list();
mailboxes.push(mailbox); for (const mailbox of list) {
mailboxes.push(mailbox.path);
} }
return mailboxes; return mailboxes;
} catch (error) {
console.error("Error listing mailboxes:", error);
return [];
}
}; };
// Setup paging // Setup paging