JavaMail API は以下のプロパティをサポートします。
(System
プロパティとして設定する必要があります)
プロパティは常に文字列として設定します。型は文字列がどの様に解釈されるかを説明します。
使用例 (J2SE 1.2 以上)
System.setProperty("mail.mime.address.strict", "false");
mail.mime.address.strict
プロパティを設定します(プロパティは boolean 型です)。
名前 | 型 | 説明 |
---|---|---|
mail.mime.address.strict | boolean |
mail.mime.address.strict セッションプロパティはアドレスヘッダーの構文解析を制御します。
デフォルトでは、アドレスヘッダーの厳密な構文解析をします。
このプロパティに "false" を設定した場合、厳密な構文解析をしません。不正なアドレスを許容します。
詳細は、InternetAddress クラスを参照。
|
mail.mime.charset | String |
mail.mime.charset システムプロパティは、エンコードされたテキストの為に使用する既定のMIME文字セットと、
文字セットを指定しないテキストパートを指定するのに使用されます。
通常、file.encoding システムプロパティで指定される様に、既定の MIME 文字セットは既定の Java 文字セットに依存します。
殆どのアプリケーションでは、明示的に既定の MIME 文字セットを指定する必要はありません。
メールメッセージで使用される既定の MIME 文字セットが、システムのファイルに使用される文字セットと異なる場合は、このプロパティを指定する必要があります。
|
mail.mime.decodetext.strict | boolean |
The mail.mime.decodetext.strict property controls
decoding of MIME encoded words. The MIME spec requires that encoded
words start at the beginning of a whitespace separated word. Some
mailers incorrectly include encoded words in the middle of a word.
If the mail.mime.decodetext.strict System property is
set to "false" , an attempt will be made to decode these
illegal encoded words. The default is true.
|
mail.mime.encodeeol.strict | boolean |
The mail.mime.encodeeol.strict property controls the
choice of Content-Transfer-Encoding for MIME parts that are not of
type "text". Often such parts will contain textual data for which
an encoding that allows normal end of line conventions is appropriate.
In rare cases, such a part will appear to contain entirely textual
data, but will require an encoding that preserves CR and LF characters
without change. If the mail.mime.encodeeol.strict
System property is set to "true" , such an encoding will
be used when necessary. The default is false.
|
mail.mime.decodefilename | boolean | If set to "true", the getFileName method uses the MimeUtility method decodeText to decode any non-ASCII characters in the filename. Note that this decoding violates the MIME specification, but is useful for interoperating with some mail clients that use this convention. The default is false. |
mail.mime.encodefilename | boolean | If set to "true", the setFileName method uses the MimeUtility method encodeText to encode any non-ASCII characters in the filename. Note that this encoding violates the MIME specification, but is useful for interoperating with some mail clients that use this convention. The default is false. |
mail.mime.decodeparameters | boolean | If set to "true", non-ASCII parameters in a ParameterList, e.g., in a Content-Type header, will be encoded as specified by RFC 2231. The default is false. |
mail.mime.encodeparameters | boolean | If set to "true", non-ASCII parameters in a ParameterList, e.g., in a Content-Type header, will be decoded as specified by RFC 2231. The default is false. |
mail.mime.multipart.ignoremissingendboundary | boolean |
Normally, when parsing a multipart MIME message, a message that is
missing the final end boundary line is not considered an error.
The data simply ends at the end of the input.
Note that messages of this form violate the MIME specification.
If the property mail.mime.multipart.ignoremissingendboundary
is set to false, such messages are considered an error and
a MesagingException will be thrown when parsing such a message.
|
mail.mime.multipart.ignoremissingboundaryparameter | boolean |
If the Content-Type header for a multipart content does not have a
boundary parameter, the multipart parsing code will look for the
first line in the content that looks like a boundary line and
extract the boundary parameter from the line.
If this property is set to "false", a MessagingException will
be thrown if the Content-Type header doesn't specify a boundary parameter.
The default is true.
|
The following properties are supported by Sun's implementation of
JavaMail, but are not currently a required part of the specification.
As above, these must be set as System
properties.
The names, types, defaults, and semantics of these properties may
change in future releases.
名前 | 型 | 説明 |
---|---|---|
mail.mime.base64.ignoreerrors | boolean |
If set to "true" , the BASE64 decoder will ignore errors
in the encoded data, returning EOF. This may be useful when dealing
with improperly encoded messages that contain extraneous data at the
end of the encoded stream. Note however that errors anywhere in the
stream will cause the decoder to stop decoding so this should be used
with extreme caution. The default is false.
|
mail.mime.foldtext | boolean |
If set to "true" , header fields containing just text
such as the Subject and Content-Description
header fields, and long parameter values in structured headers such
as Content-Type will be folded (broken into 76 character lines)
when set and unfolded when read. The default is true.
|
mail.mime.setcontenttypefilename | boolean |
If set to "true" , the setFileName method
will also set the name parameter on the Content-Type
header to the specified filename. This supports interoperability with
some old mail clients. The default is true.
|
mail.mime.setdefaulttextcharset | boolean |
When updating the headers of a message, a body
part with a text content type but no charset
parameter will have a charset parameter added to it
if this property is set to "true" .
The default is true.
|
mail.mime.multipart.ignoremissingendboundary | boolean |
Normally, when parsing a multipart MIME message, a message that is
missing the final end boundary line is not considered an error.
The data simply ends at the end of the input. Note that messages
of this form violate the MIME specification. If the property
mail.mime.multipart.ignoremissingendboundary is set
to false , such messages are considered an error and a
MesagingException will be thrown when parsing such a
message.
|
mail.alternates | String |
A string containing other email addresses that the current user is known by.
The MimeMessage reply method will eliminate any
of these addresses from the recipient list in the message it constructs,
to avoid sending the reply back to the sender.
|
mail.replyallcc | boolean |
If set to "true" , the MimeMessage
reply method will put all recipients except the original
sender in the Cc list of the newly constructed message.
Normally, recipients in the To header of the original
message will also appear in the To list of the newly
constructed message.
|