Issue Details (XML | Word | Printable)

Key: DS-234
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Stuart Lewis
Reporter: Stuart Lewis
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DSpace 1.x

Configurable passing of Javamail parameter settings

Created: 22/Jun/09 12:40 AM   Updated: 30/Oct/09 01:12 AM
Component/s: DSpace API
Affects Version/s: 1.5.2
Fix Version/s: 1.6.0

Time Tracking:
Not Specified

File Attachments: 1. Text File [DS-234]_Configurable_passing_of_Javamail_parameter_settings.patch (3 kB)


Documentation Status: Needed


 Description  « Hide
At present, if you want to configure DSpace to send emails via a security protected server (e.g. gmail) then you have to edit the DSpace java class to add in some extra parameter settings. It would be good if additional parameters and values can be passed from dspace.cfg

(see: http://www.mail-archive.com/dspace-devel@lists.sourceforge.net/msg01098.html)

 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Stuart Lewis added a comment - 31/Aug/09 10:52 PM
Patch attached.

Adds new options in dspace.cfg:

# If you are connecting to a TLS/SSL protected email server, enable this setting,
# and possibly extra settings below
#mail.ssl.enable = true

# Pass extra settings to the Java mail library. Comma separated, equals sign between
# the key and the value.
#mail.extraproperties = mail.smtp.socketFactory.port=465, \
# mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory, \
# mail.smtp.socketFactory.fallback=false

Mark Wood added a comment - 17/Sep/09 09:01 PM
As written this throws an exception when using recent (e.g. 1.5. releases of Sun JRE, since the com.sun.net.ssl.internal.ssl.Provider() is subject to an access restriction. It should not be necessary to add this provider; since about Java 1.3 it should be pre-loaded by the stock security property settings.

I hacked out the addProvider() call and the mail goes through.

Stuart Lewis added a comment - 17/Sep/09 09:19 PM
Hi Mark,

My Java 1.6 installations have no problem with this. However, as you say the mail.ssl.enable code seems to be redundant. Am happy to remove it if you want?

Thanks,


Stuart

Stuart Lewis added a comment - 24/Sep/09 11:38 PM
Code updated, removed unrequired code and config:

# If you are connecting to a TLS/SSL protected email server, enable this setting,
# and possibly extra settings below
#mail.ssl.enable = true

Jeffrey Trimble added a comment - 30/Oct/09 01:12 AM
Just caught this needed to be added to Configuration documentation. Done.