javamail - 协议SMTP\IMAP\POP3设置
2024-09-03 11:32:16
资料来自:https://www.tutorialspoint.com/javamail_api/index.htm
【SMTP - Simple Mail Transfer Protocol】
Name | Type | Description |
---|---|---|
mail.smtp.user | String | Default user name for SMTP. |
mail.smtp.host | String | The SMTP server to connect to. |
mail.smtp.port | int | The SMTP server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 25. |
mail.smtp.connectiontimeout | int | Socket connection timeout value in milliseconds. Default is infinite timeout. |
mail.smtp.timeout | int | Socket I/O timeout value in milliseconds. Default is infinite timeout. |
mail.smtp.from | String | Email address to use for SMTP MAIL command. This sets the envelope return address. Defaults to msg.getFrom() or InternetAddress.getLocalAddress(). |
mail.smtp.localhost | String | Local host name used in the SMTP HELO or EHLO command. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly. |
mail.smtp.localaddress | String | Local address (host name) to bind to when creating the SMTP socket. Defaults to the address picked by the Socket class. Should not normally need to be set. |
mail.smtp.localport | int | Local port number to bind to when creating the SMTP socket. Defaults to the port number picked by the Socket class. |
mail.smtp.ehlo | boolean | If false, do not attempt to sign on with the EHLO command. Defaults to true. |
mail.smtp.auth | boolean | If true, attempt to authenticate the user using the AUTH command. Defaults to false. |
mail.smtp.auth.mechanisms | String | If set, lists the authentication mechanisms to consider. Only mechanisms supported by the server and supported by the current implementation will be used. The default is "LOGIN PLAIN DIGEST-MD5 NTLM", which includes all the authentication mechanisms supported by the current implementation. |
mail.smtp.auth.login.disable | boolean | If true, prevents use of the AUTH LOGIN command. Default is false. |
mail.smtp.auth.plain.disable | boolean | If true, prevents use of the AUTH PLAIN command. Default is false. |
mail.smtp.auth.digest-md5.disable | boolean | If true, prevents use of the AUTH DIGEST-MD5 command. Default is false. |
mail.smtp.auth.ntlm.disable | boolean | If true, prevents use of the AUTH NTLM command. Default is false. |
mail.smtp.auth.ntlm.domain | String | The NTLM authentication domain. |
mail.smtp.auth.ntlm.flags | int | NTLM protocol-specific flags. |
mail.smtp.submitter | String | The submitter to use in the AUTH tag in the MAIL FROM command. Typically used by a mail relay to pass along information about the original submitter of the message. |
mail.smtp.dsn.notify | String | The NOTIFY option to the RCPT command. Either NEVER, or some combination of SUCCESS, FAILURE, and DELAY (separated by commas). |
mail.smtp.dsn.ret | String | The RET option to the MAIL command. Either FULL or HDRS. |
mail.smtp.sendpartial | boolean | If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to false (the default), the message is not sent to any of the recipients if there is an invalid recipient address. |
mail.smtp.sasl.enable | boolean | If set to true, attempt to use the javax.security.sasl package to choose an authentication mechanism for login. Defaults to false. |
mail.smtp.sasl.mechanisms | String | A space or comma separated list of SASL mechanism names to try to use. |
mail.smtp.sasl.authorizationid | String | The authorization ID to use in the SASL authentication. If not set, the authentication ID (user name) is used. |
mail.smtp.sasl.realm | String | The realm to use with DIGEST-MD5 authentication. |
mail.smtp.quitwait | boolean | If set to false, the QUIT command is sent and the connection is immediately closed. If set to true (the default), causes the transport to wait for the response to the QUIT command. |
mail.smtp.reportsuccess | boolean | If set to true, causes the transport to include an SMTPAddressSucceededException for each address that is successful. |
mail.smtp.socketFactory | Socket Factory | If set to a class that implements the javax.net.SocketFactory interface, this class will be used to create SMTP sockets. |
mail.smtp.socketFactory.class | String | If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets. |
mail.smtp.socketFactory.fallback | boolean | If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. |
mail.smtp.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.smtp.ssl.enable | boolean | If set to true, use SSL to connect and use the SSL port by default. Defaults to false for the "smtp" protocol and true for the "smtps" protocol. |
mail.smtp.ssl.checkserveridentity | boolean | If set to true, checks the server identity as specified by RFC 2595. Defaults to false. |
mail.smtp.ssl.trust | String | If set, and a socket factory hasn't been specified, enables use of a MailSSLSocketFactory. If set to "*", all hosts are trusted. If set to a whitespace separated list of hosts, those hosts are trusted. Otherwise, trust depends on the certificate the server presents. |
mail.smtp.ssl.socketFactory | SSL Socket Factory | If set to a class that extends the javax.net.ssl.SSLSocketFactory class, this class will be used to create SMTP SSL sockets. |
mail.smtp.ssl.socketFactory.class | String | If set, specifies the name of a class that extends the javax.net.ssl.SSLSocketFactory class. This class will be used to create SMTP SSL sockets. |
mail.smtp.ssl.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.smtp.ssl.protocols | string | Specifies the SSL protocols that will be enabled for SSL connections. The property value is a whitespace separated list of tokens acceptable to the javax.net.ssl.SSLSocket.setEnabledProtocols method. |
mail.smtp.starttls.enable | boolean | If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Defaults to false. |
mail.smtp.starttls.required | boolean | If true, requires the use of the STARTTLS command. If the server doesn't support the STARTTLS command, or the command fails, the connect method will fail. Defaults to false. |
mail.smtp.socks.host | string | Specifies the host name of a SOCKS5 proxy server that will be used for connections to the mail server. |
mail.smtp.socks.port | string | Specifies the port number for the SOCKS5 proxy server. This should only need to be used if the proxy server is not using the standard port number of 1080. |
mail.smtp.mailextension | String | Extension string to append to the MAIL command. |
mail.smtp.userset | boolean | If set to true, use the RSET command instead of the NOOP command in the isConnected method. In some cases sendmail will respond slowly after many NOOP commands; use of RSET avoids this sendmail issue. Defaults to false. |
【IMAP - Internet Message Access Protocol】
Name | Type | Description |
---|---|---|
mail.imap.user | String | Default user name for IMAP. |
mail.imap.host | String | The IMAP server to connect to. |
mail.imap.port | int | The IMAP server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 143. |
mail.imap.partialfetch | boolean | Controls whether the IMAP partial-fetch capability should be used. Defaults to true. |
mail.imap.fetchsize | int | Partial fetch size in bytes. Defaults to 16K. |
mail.imap.ignorebodystructuresize | boolean | The IMAP BODYSTRUCTURE response includes the exact size of each body part. Normally, this size is used to determine how much data to fetch for each body part. Defaults to false. |
mail.imap.connectiontimeout | int | Socket connection timeout value in milliseconds. Default is infinite timeout. |
mail.imap.timeout | int | Socket I/O timeout value in milliseconds. Default is infinite timeout. |
mail.imap.statuscachetimeout | int | Timeout value in milliseconds for cache of STATUS command response. Default is 1000 (1 second). Zero disables cache. |
mail.imap.appendbuffersize | int | Maximum size of a message to buffer in memory when appending to an IMAP folder. |
mail.imap.connectionpoolsize | int | Maximum number of available connections in the connection pool. Default is 1. |
mail.imap.connectionpooltimeout | int | Timeout value in milliseconds for connection pool connections. Default is 45000 (45 seconds). |
mail.imap.separatestoreconnection | boolean | Flag to indicate whether to use a dedicated store connection for store commands. Default is false. |
mail.imap.auth.login.disable | boolean | If true, prevents use of the non-standard AUTHENTICATE LOGIN command, instead using the plain LOGIN command. Default is false. |
mail.imap.auth.plain.disable | boolean | If true, prevents use of the AUTHENTICATE PLAIN command. Default is false. |
mail.imap.auth.ntlm.disable | boolean | If true, prevents use of the AUTHENTICATE NTLM command. Default is false. |
mail.imap.proxyauth.user | String | If the server supports the PROXYAUTH extension, this property specifies the name of the user to act as. Authenticate to the server using the administrator's credentials. After authentication, the IMAP provider will issue the PROXYAUTH command with the user name specified in this property. |
mail.imap.localaddress | String | Local address (host name) to bind to when creating the IMAP socket. Defaults to the address picked by the Socket class. |
mail.imap.localport | int | Local port number to bind to when creating the IMAP socket. Defaults to the port number picked by the Socket class. |
mail.imap.sasl.enable | boolean | If set to true, attempt to use the javax.security.sasl package to choose an authentication mechanism for login. Defaults to false. |
mail.imap.sasl.mechanisms | String | A space or comma separated list of SASL mechanism names to try to use. |
mail.imap.sasl.authorizationid | String | The authorization ID to use in the SASL authentication. If not set, the authentication ID (user name) is used. |
mail.imap.sasl.realm | String | The realm to use with SASL authentication mechanisms that require a realm, such as DIGEST-MD5. |
mail.imap.auth.ntlm.domain | String | The NTLM authentication domain. |
mail.imap.auth.ntlm.flags | int | NTLM protocol-specific flags. |
mail.imap.socketFactory | Socket Factory | If set to a class that implements the javax.net.SocketFactory interface, this class will be used to create IMAP sockets. |
mail.imap.socketFactory.class | String | If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create IMAP sockets. |
mail.imap.socketFactory.fallback | boolean | If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. |
mail.imap.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. Default port is used when not set. |
mail.imap.ssl.enable | boolean | If set to true, use SSL to connect and use the SSL port by default. Defaults to false for the "imap" protocol and true for the "imaps" protocol. |
mail.imap.ssl.checkserveridentity | boolean | If set to true, check the server identity as specified by RFC 2595. Defaults to false. |
mail.imap.ssl.trust | String | If set, and a socket factory hasn't been specified, enables use of a MailSSLSocketFactory. If set to "*", all hosts are trusted. If set to a whitespace separated list of hosts, those hosts are trusted. Otherwise, trust depends on the certificate the server presents. |
mail.imap.ssl.socketFactory | SSL Socket Factory | If set to a class that extends the javax.net.ssl.SSLSocketFactory class, this class will be used to create IMAP SSL sockets. |
mail.imap.ssl.socketFactory.class | String | If set, specifies the name of a class that extends the javax.net.ssl.SSLSocketFactory class. This class will be used to create IMAP SSL sockets. |
mail.imap.ssl.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.imap.ssl.protocols | string | Specifies the SSL protocols that will be enabled for SSL connections. The property value is a whitespace separated list of tokens acceptable to the javax.net.ssl.SSLSocket.setEnabledProtocols method. |
mail.imap.starttls.enable | boolean | If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Default is false. |
mail.imap.starttls.required | boolean | If true, requires the use of the STARTTLS command. If the server doesn't support the STARTTLS command, or the command fails, the connect method will fail. Defaults to false. |
mail.imap.socks.host | string | Specifies the host name of a SOCKS5 proxy server that will be used for connections to the mail server. |
mail.imap.socks.port | string | Specifies the port number for the SOCKS5 proxy server. This should only need to be used if the proxy server is not using the standard port number of 1080. |
mail.imap.minidletime | int | This property sets the delay in milliseconds. If not set, the default is 10 milliseconds. |
mail.imap.enableimapevents | boolean | Enable special IMAP-specific events to be delivered to the Store's ConnectionListener. If true, unsolicited responses received during the Store's idle method will be sent as ConnectionEvents with a type of IMAPStore.RESPONSE. The event's message will be the raw IMAP response string. By default, these events are not sent. |
mail.imap.folder.class | String | Class name of a subclass of com.sun.mail.imap.IMAPFolder. The subclass can be used to provide support for additional IMAP commands. The subclass must have public constructors of the form public MyIMAPFolder(String fullName, char separator, IMAPStore store, Boolean isNamespace) and public MyIMAPFolder(ListInfo li, IMAPStore store) |
【POP3 - Post Office Protocol】
Name | Type | Description |
---|---|---|
mail.pop3.user | String | Default user name for POP3. |
mail.pop3.host | String | The POP3 server to connect to. |
mail.pop3.port | int | The POP3 server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 110. |
mail.pop3.connectiontimeout | int | Socket connection timeout value in milliseconds. Default is infinite timeout. |
mail.pop3.timeout | int | Socket I/O timeout value in milliseconds. Default is infinite timeout. |
mail.pop3.rsetbeforequit | boolean | Send a POP3 RSET command when closing the folder, before sending the QUIT command. Default is false. |
mail.pop3.message.class | String | Class name of a subclass of com.sun.mail.pop3.POP3Message. The subclass can be used to handle (for example) non-standard Content-Type headers. The subclass must have a public constructor of the form MyPOP3Message(Folder f, int msgno) throws MessagingException. |
mail.pop3.localaddress | String | Local address (host name) to bind to when creating the POP3 socket. Defaults to the address picked by the Socket class. |
mail.pop3.localport | int | Local port number to bind to when creating the POP3 socket. Defaults to the port number picked by the Socket class. |
mail.pop3.apop.enable | boolean | If set to true, use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP. APOP sends a digest of the password rather than the clear text password. Defaults to false. |
mail.pop3.socketFactory | Socket Factory | If set to a class that implements the javax.net.SocketFactory interface, this class will be used to create POP3 sockets. |
mail.pop3.socketFactory.class | String | If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create POP3 sockets. |
mail.pop3.socketFactory.fallback | boolean | If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. |
mail.pop3.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.pop3.ssl.enable | boolean | If set to true, use SSL to connect and use the SSL port by default. Defaults to false for the "pop3" protocol and true for the "pop3s" protocol. |
mail.pop3.ssl.checkserveridentity | boolean | If set to true, check the server identity as specified by RFC 2595. Defaults to false. |
mail.pop3.ssl.trust | String | If set, and a socket factory hasn't been specified, enables use of a MailSSLSocketFactory. If set to "*", all hosts are trusted. If set to a whitespace separated list of hosts, those hosts are trusted. Otherwise, trust depends on the certificate the server presents. |
mail.pop3.ssl.socketFactory | SSL Socket Factory | If set to a class that extends the javax.net.ssl.SSLSocketFactory class, this class will be used to create POP3 SSL sockets. |
mail.pop3.ssl.socketFactory.class | String | If set, specifies the name of a class that extends the javax.net.ssl.SSLSocketFactory class. This class will be used to create POP3 SSL sockets. |
mail.pop3.ssl.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.pop3.ssl.protocols | string | Specifies the SSL protocols that will be enabled for SSL connections. The property value is a whitespace separated list of tokens acceptable to the javax.net.ssl.SSLSocket.setEnabledProtocols method. |
mail.pop3.starttls.enable | boolean | If true, enables the use of the STLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Defaults to false. |
mail.pop3.starttls.required | boolean | If true, requires the use of the STLS command. If the server doesn't support the STLS command, or the command fails, the connect method will fail. Defaults to false. |
mail.pop3.socks.host | string | Specifies the host name of a SOCKS5 proxy server that will be used for connections to the mail server. |
mail.pop3.socks.port | string | Specifies the port number for the SOCKS5 proxy server. |
mail.pop3.disabletop | boolean | If set to true, the POP3 TOP command will not be used to fetch message headers. Defaults to false. |
mail.pop3.forgettopheaders | boolean | If set to true, the headers that might have been retrieved using the POP3 TOP command will be forgotten and replaced by headers retrieved as part of the POP3 RETR command. Defaults to false. |
mail.pop3.filecache.enable | boolean | If set to true, the POP3 provider will cache message data in a temporary file rather than in memory. Messages are only added to the cache when accessing the message content. Message headers are always cached in memory (on demand). The file cache is removed when the folder is closed or the JVM terminates. Defaults to false. |
mail.pop3.filecache.dir | String | If the file cache is enabled, this property can be used to override the default directory used by the JDK for temporary files. |
mail.pop3.cachewriteto | boolean | Controls the behavior of the writeTo method on a POP3 message object. If set to true, and the message content hasn't yet been cached, and ignoreList is null, the message is cached before being written. Otherwise, the message is streamed directly to the output stream without being cached. Defaults to false. |
mail.pop3.keepmessagecontent | boolean | If this property is set to true, a hard reference to the cached content will be kept, preventing the memory from being reused until the folder is closed or the cached content is explicitly invalidated (using the invalidate method). Defaults to false. |
最新文章
- mysql日期格式化
- ms-dos中 MSCDEX命名语法详解
- 转: windows 10使用原生linux bash命令行
- linux挂载远程samba目录
- WCF安全3-Transport与Message安全模式
- lex&;yacc6 ---error
- 及其简易的js 倒计时插件
- 高放的c++学习笔记之模板与泛型编程
- python+sublime text2中文乱码[Decode error - output not utf-8]
- Remobjects使用经验
- Ubuntu iptalbes 保存配置
- 关于SEO的一些浅认识
- DistBlockNet:A Distributed Blockchains-Based Secure SDN Architecture for IOT Network
- 从零开始学安全(三十三)●Ununtu16 LMAP 环境搭建
- html:布局class名和其他class名个人整理总结
- 学习Python第七天
- [转帖]Linux 硬件和系统配置查看命令小结
- RabbitMQ 特性
- ceph crush的问题
- centos7.1安装tomcat8
热门文章
- Leetcode 498:对角线遍历Diagonal Traverse(python3、java)
- [angular1.6]Error: ";transition superseded"; ui-router 在angular1.6 报错误问题解决
- 爬虫实战(一) 用Python爬取百度百科
- linux cmp-比较两个文件是否有差异
- 【模板】51nod 1006 最长公共子序列Lcs
- Trees on the level (二叉链表树)
- PAT 1126 Eulerian Path
- idea 背景颜色设置
- Self Centos + Windows server 2016
- 在代码动态设置RelativeLayout的属性,比如layout_below