Repository: mercurial
Revision: 137
Author: Bill Shannon <bill.shannon_at_sun.com>
Date: 2009-05-06 23:22:07 UTC
Link:
http://kenai.com/projects/javamail/sources/mercurial/revision/137
Log Message:
-----------
Add mail.transport.protocol.<address-type> property.
Modified Paths:
--------------
doc/release/CHANGES.txt
mail/src/main/java/javax/mail/Session.java
mail/src/main/java/javax/mail/package.html
mail/src/main/java/overview.html
Diffs:
-----
diff -r 9b5751010a75 -r 7f8a6c2be5dc doc/release/CHANGES.txt
--- a/doc/release/CHANGES.txt Wed May 06 15:54:27 2009 -0700
+++ b/doc/release/CHANGES.txt Wed May 06 16:22:07 2009 -0700
@@ -15,6 +15,7 @@
<no id> add starttls support to POP3
<no id> fix deadlock in IMAP IDLE support
+<no id> add mail.transport.protocol.<address-type> property
CHANGES IN THE 1.4.2 RELEASE
diff -r 9b5751010a75 -r 7f8a6c2be5dc
mail/src/main/java/javax/mail/Session.java
--- a/mail/src/main/java/javax/mail/Session.java Wed May 06
15:54:27 2009 -0700
+++ b/mail/src/main/java/javax/mail/Session.java Wed May 06
16:22:07 2009 -0700
@@ -671,7 +671,7 @@
}
/**
- * Get a Transport object that can transport a Message to the
+ * Get a Transport object that can transport a Message of the
* specified address type.
*
* @param address
@@ -683,13 +683,16 @@
public Transport getTransport(Address address)
throws
NoSuchProviderException {
- String transportProtocol =
(String)addressMap.get(address.getType());
- if (transportProtocol == null) {
- throw new NoSuchProviderException("No provider for Address
type: "+
- address.getType());
- } else {
+ String transportProtocol;
+ transportProtocol =
+ getProperty("mail.transport.protocol." +
address.getType());
+ if (transportProtocol != null)
return getTransport(transportProtocol);
- }
+ transportProtocol = (String)addressMap.get(address.getType());
+ if (transportProtocol != null)
+ return getTransport(transportProtocol);
+ throw new NoSuchProviderException("No provider for Address
type: "+
+ address.getType());
}
/**
diff -r 9b5751010a75 -r 7f8a6c2be5dc
mail/src/main/java/javax/mail/package.html
--- a/mail/src/main/java/javax/mail/package.html Wed May 06
15:54:27 2009 -0700
+++ b/mail/src/main/java/javax/mail/package.html Wed May 06
16:22:07 2009 -0700
@@ -5,7 +5,7 @@
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development
@@ -158,7 +158,7 @@
<TD>mail.transport.protocol</TD>
<TD>String</TD>
<TD>
-Specifies the default message access protocol. The
+Specifies the default message transport protocol. The
<code>Session</code> method <code>getTransport()</code> returns a
Transport
object that implements this protocol. By default the first Transport
provider in the configuration files is returned.
@@ -215,6 +215,39 @@
</TR>
</TABLE>
+
+<P>
+The following properties are supported by Sun's implementation of
+JavaMail, but are not currently a required part of the specification.
+The names, types, defaults, and semantics of these properties may
+change in future releases.
+<P>
+<TABLE BORDER>
+<TR>
+<TH>Name</TH>
+<TH>Type</TH>
+<TH>Description</TH>
+</TR>
+
+<TR>
+<TD>mail.transport.protocol.<i>address-type</i></TD>
+<TD>String</TD>
+<TD>
+Specifies the default message transport protocol for the specified
address type.
+The <code>Session</code> method <code>getTransport(Address)</code>
returns a
+Transport object that implements this protocol when the address is of
the
+specified type (e.g., "rfc822" for standard internet addresses).
+By default the first Transport configured for that address type is
used.
+This property can be used to override the behavior of the
+{_at_link javax.mail.Transport#send send} method of the
+{_at_link javax.mail.Transport Transport} class so that (for example) the
"smtps"
+protocol is used instead of the "smtp" protocol by setting the
property
+<code>mail.transport.protocol.rfc822</code> to <code>"smtps"</code>.
+</TD>
+</TR>
+
+</TABLE>
+
<P>
The JavaMail API also supports several System properties;
see the {_at_link javax.mail.internet} package documentation
diff -r 9b5751010a75 -r 7f8a6c2be5dc mail/src/main/java/overview.html
--- a/mail/src/main/java/overview.html Wed May 06 15:54:27 2009 -0700
+++ b/mail/src/main/java/overview.html Wed May 06 16:22:07 2009 -0700
@@ -5,7 +5,7 @@
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development
@@ -158,7 +158,7 @@
<TD>mail.transport.protocol</TD>
<TD>String</TD>
<TD>
-Specifies the default message access protocol. The
+Specifies the default message transport protocol. The
<code>Session</code> method <code>getTransport()</code> returns a
Transport
object that implements this protocol. By default the first Transport
provider in the configuration files is returned.
@@ -215,6 +215,39 @@
</TR>
</TABLE>
+
+<P>
+The following properties are supported by Sun's implementation of
+JavaMail, but are not currently a required part of the specification.
+The names, types, defaults, and semantics of these properties may
+change in future releases.
+<P>
+<TABLE BORDER>
+<TR>
+<TH>Name</TH>
+<TH>Type</TH>
+<TH>Description</TH>
+</TR>
+
+<TR>
+<TD>mail.transport.protocol.<i>address-type</i></TD>
+<TD>String</TD>
+<TD>
+Specifies the default message transport protocol for the specified
address type.
+The <code>Session</code> method <code>getTransport(Address)</code>
returns a
+Transport object that implements this protocol when the address is of
the
+specified type (e.g., "rfc822" for standard internet addresses).
+By default the first Transport configured for that address type is
used.
+This property can be used to override the behavior of the
+{_at_link javax.mail.Transport#send send} method of the
+{_at_link javax.mail.Transport Transport} class so that (for example) the
"smtps"
+protocol is used instead of the "smtp" protocol by setting the
property
+<code>mail.transport.protocol.rfc822</code> to <code>"smtps"</code>.
+</TD>
+</TR>
+
+</TABLE>
+
<P>
The JavaMail API also supports several System properties;
see the {_at_link javax.mail.internet} package documentation