Class EmailReceiveConfig.Builder
java.lang.Object
cloud.opencode.base.email.EmailReceiveConfig.Builder
- Enclosing class:
EmailReceiveConfig
Email Receive Configuration Builder
邮件接收配置构建器
- Since:
- JDK 25, opencode-base-email V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the configuration 构建配置connectionTimeout(Duration timeout) Set connection timeout 设置连接超时debug(boolean debug) Enable debug mode 启用调试模式defaultFolder(String folder) Set default folder to read from 设置默认读取文件夹deleteAfterReceive(boolean delete) Delete messages after receiving 接收后删除邮件Set mail server host 设置邮件服务器主机imap()Use IMAP protocol 使用IMAP协议markAsReadAfterReceive(boolean markAsRead) Mark messages as read after receiving 接收后标记邮件为已读maxMessages(int maxMessages) Set maximum messages to fetch per request 设置每次请求获取的最大邮件数oauth2Token(String oauth2Token) Set OAuth2 access token for XOAUTH2 authentication 设置OAuth2访问令牌用于XOAUTH2认证Set password for authentication 设置认证密码pop3()Use POP3 protocol 使用POP3协议port(int port) Set mail server port 设置邮件服务器端口protocol(EmailReceiveConfig.Protocol protocol) Set protocol 设置协议ssl(boolean ssl) Enable SSL connection 启用SSL连接starttls(boolean starttls) Enable STARTTLS 启用STARTTLSSet operation timeout 设置操作超时Set username for authentication 设置认证用户名
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
host
Set mail server host 设置邮件服务器主机- Parameters:
host- the mail server host | 邮件服务器主机- Returns:
- this builder | 构建器
-
port
Set mail server port 设置邮件服务器端口- Parameters:
port- the mail server port | 邮件服务器端口- Returns:
- this builder | 构建器
-
username
Set username for authentication 设置认证用户名- Parameters:
username- the username | 用户名- Returns:
- this builder | 构建器
-
password
Set password for authentication 设置认证密码- Parameters:
password- the password | 密码- Returns:
- this builder | 构建器
-
oauth2Token
Set OAuth2 access token for XOAUTH2 authentication 设置OAuth2访问令牌用于XOAUTH2认证Used for Gmail, Outlook and other OAuth2-enabled mail servers.
用于Gmail、Outlook和其他支持OAuth2的邮件服务器。
- Parameters:
oauth2Token- the OAuth2 access token | OAuth2访问令牌- Returns:
- this builder | 构建器
-
imap
-
pop3
-
protocol
Set protocol 设置协议- Parameters:
protocol- the protocol | 协议- Returns:
- this builder | 构建器
-
ssl
Enable SSL connection 启用SSL连接- Parameters:
ssl- true to enable SSL | true启用SSL- Returns:
- this builder | 构建器
-
starttls
Enable STARTTLS 启用STARTTLS- Parameters:
starttls- true to enable STARTTLS | true启用STARTTLS- Returns:
- this builder | 构建器
-
timeout
Set operation timeout 设置操作超时- Parameters:
timeout- the timeout duration | 超时时长- Returns:
- this builder | 构建器
-
connectionTimeout
Set connection timeout 设置连接超时- Parameters:
timeout- the timeout duration | 超时时长- Returns:
- this builder | 构建器
-
defaultFolder
Set default folder to read from 设置默认读取文件夹- Parameters:
folder- the default folder | 默认文件夹- Returns:
- this builder | 构建器
-
maxMessages
Set maximum messages to fetch per request 设置每次请求获取的最大邮件数- Parameters:
maxMessages- the maximum messages | 最大邮件数- Returns:
- this builder | 构建器
-
deleteAfterReceive
Delete messages after receiving 接收后删除邮件- Parameters:
delete- true to delete after receive | true接收后删除- Returns:
- this builder | 构建器
-
markAsReadAfterReceive
Mark messages as read after receiving 接收后标记邮件为已读- Parameters:
markAsRead- true to mark as read | true标记为已读- Returns:
- this builder | 构建器
-
debug
Enable debug mode 启用调试模式- Parameters:
debug- true to enable debug | true启用调试- Returns:
- this builder | 构建器
-
build
-