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
|
// Function to get mailboxes
|
||||||
const getMailboxes = async () => {
|
const getMailboxes = async () => {
|
||||||
const mailboxes = [];
|
try {
|
||||||
for await (const mailbox of imapClient.listMailboxes()) {
|
const mailboxes = [];
|
||||||
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 [];
|
||||||
}
|
}
|
||||||
return mailboxes;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Setup paging
|
// Setup paging
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user