Skip to content

Commit 5aa152c

Browse files
authored
feat: netease_mail (#84)
1 parent df843a7 commit 5aa152c

15 files changed

Lines changed: 1081 additions & 722 deletions

File tree

src/mail/imap-smtp/actions.ts

Lines changed: 406 additions & 0 deletions
Large diffs are not rendered by default.

src/mail/imap-smtp/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const mailImapPort: number = 993;
2+
export const mailSmtpPort: number = 465;
3+
export const mailMessageFetchByteLimit: number = 5 * 1024 * 1024;
4+
export const mailAttachmentDownloadByteLimit: number = 25 * 1024 * 1024;
5+
export const mailConnectionTimeoutMs: number = 30_000;

src/mail/imap-smtp/errors.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export type MailProtocolErrorKind = "auth" | "folder_not_found" | "uid_not_found" | "timeout" | "network" | "provider";
2+
3+
export class MailProtocolError extends Error {
4+
readonly kind: MailProtocolErrorKind;
5+
6+
constructor(kind: MailProtocolErrorKind, message: string) {
7+
super(message);
8+
this.kind = kind;
9+
}
10+
}

0 commit comments

Comments
 (0)