DSpace / DSpace

(Official) The DSpace digital asset management system that powers your Institutional Repository
https://wiki.lyrasis.org/display/DSDOC8x/
BSD 3-Clause "New" or "Revised" License
980 stars 1.35k forks source link

[DS-234] Configurable passing of Javamail parameter settings #3609

Closed dspace-bot closed 15 years ago

dspace-bot commented 15 years ago

Imported from JIRA [DS-234] created by stuartlewis

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)

dspace-bot commented 15 years ago

stuartlewis said:

Patch attached.

Adds new options in dspace.cfg:

  1. If you are connecting to a TLS/SSL protected email server, enable this setting,
  2. and possibly extra settings below
    #mail.ssl.enable = true
  1. Pass extra settings to the Java mail library. Comma separated, equals sign between
  2. the key and the value.
    #mail.extraproperties = mail.smtp.socketFactory.port=465, \
  3. mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory, \
  4. mail.smtp.socketFactory.fallback=false
dspace-bot commented 15 years ago

mwood said:

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.

dspace-bot commented 15 years ago

stuartlewis said:

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

dspace-bot commented 15 years ago

stuartlewis said:

Code updated, removed unrequired code and config:

  1. If you are connecting to a TLS/SSL protected email server, enable this setting,
  2. and possibly extra settings below
    #mail.ssl.enable = true
dspace-bot commented 15 years ago

jtrimble said:

Just caught this needed to be added to Configuration documentation. Done.