panel 2 courier api restore
This commit is contained in:
parent
ec725ae8c1
commit
c4f9bee7ee
@ -175,11 +175,17 @@ export async function GET(request: Request) {
|
||||
|
||||
// Function to get mailboxes
|
||||
const getMailboxes = async () => {
|
||||
try {
|
||||
const mailboxes = [];
|
||||
for await (const mailbox of imapClient.listMailboxes()) {
|
||||
mailboxes.push(mailbox);
|
||||
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 [];
|
||||
}
|
||||
};
|
||||
|
||||
// Setup paging
|
||||
|
||||
Loading…
Reference in New Issue
Block a user