This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
/**
* 仅测 IMAP 连通:登录 + SEARCH UNSEEN,不落库<E890BD>?
* pnpm imap:smoke
*/
import{getEnv,resetEnvCache}from"../src/lib/env";
import{
createImapClient,
hasImapCredentials,
}from"../src/services/imap/client";
asyncfunctionmain() {
resetEnvCache();
constenv=getEnv();
if(!hasImapCredentials()){
console.error("缺少 IMAP_USER / IMAP_PASS");
process.exit(1);
}
constclient=createImapClient();
if(!client){
console.error("createImapClient returned null");
process.exit(1);
}
console.log(`connecting ${env.IMAP_HOST}:${env.IMAP_PORT} as ${env.IMAP_USER}`);