Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Clarifications, examples of email templates; document mail.message.headers

...

Property:

mail.server

Example Value:

mail.server = smtp.my.edu

Informational Note:

The address on which your outgoing SMTP email server can be reached.

Property:

mail.server.username

Example Value:

mail.server.username = myusername

Informational Note:

SMTP mail server authentication username, if required. This property is optional.

Property:

mail.server.password

Example Value:

mail.server.password = mypassword

Informational Note:

SMTP mail server authentication password, if required. This property is optional/

Property:

mail.server.port

Example Value:

mail.server.port = 25

Informational Note:

The port on which your SMTP mail server can be reached. By default, port 25 is used. Change this setting if your SMTP mailserver is running on another port. This property is optional.

Property:

mail.from.address

Example Value:

mail.from.address = dspace-noreply@myu.edu

Informational Note:

The "From" address for email. Change the 'myu.edu' to the site's host name.

Property:

feedback.recipient

Example Value:

feedback.recipient = dspace-help@myu.edu

Informational Note:

When a user clicks on the feedback link/feature, the information will be sent to the email address of choice. This configuration is currently limited to only one recipient. Since DSpace 4.0, this is also the email address displayed on the contacts page.

Property:

mail.admin

Example Value:

mail.admin = dspace-help@myu.edu

Informational Note:

Email address of the general site administrator (Webmaster)

Property:

alert.recipient

Example Value:

alert.recipient = john.doe@myu.edu

Informational Note:

Enter the recipient for server errors and alerts. This property is optional.

Property:

registration.notify

Example Value:

registration.notify = mike.smith@myu.edu

Informational Note:

Enter the recipient that will be notified when a new user registers on DSpace. This property is optional.

Property:

mail.charset

Example Value:

mail.charset = UTF-8

Informational Note:

Set the default mail character set. This may be over-ridden by providing a line inside the email template '#set($charset = "encoding")'.  Otherwise this default is used.

Property:

mail.allowed.referrers

Example Value:

mail.allowed.referrers = localhost

Informational Note:

A comma separated list of hostnames that are allowed to refer browsers to email forms. Default behavior is to accept referrals only from dspace.hostname. This property is optional.

Property:

mail.extraproperties

Example Value:


Code Block
mail.extraproperties = mail.smtp.socketFactory.port=465, \
       mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory, \
       mail.smtp.socketFactory.fallback=false


Informational Note:

If you need to pass extra settings to the Java mail library. Comma separated, equals sign between the key and the value. This property is optional.

Property:

mail.server.disabled

Example Value:

mail.server.disabled = false

Informational Note:

An option is added to disable the mailserver. By default, this property is set to 'false'. By setting value to 'true', DSpace will not send out emails. It will instead log the subject of the email which should have been sent. This is especially useful for development and test environments where production data is used when testing functionality. This property is optional.

Property:

mail.session.name

Example Value:

mail.session.name = myDSpace

Informational Note:

Specifies the name of a javax.mail.Session object stored in JNDI under java:comp/env/mail.  The default value is "Session".

Property:

default.language

Example Value:

default.language = en_US

Informational Note:

If no other language is explicitly stated in the input-forms.xml, the default language will be attributed to the metadata values.

Property:mail.message.headers
Example Value:

mail.message.headers = subject

mail.message.headers = charset

Informational Note:When processing a message template, setting a Velocity property whose name is one of the values of this configuration property will add or replace a message header of the same name, using the value of the property as the header's value.  See "Templates can set message headers".

Wording of E-mail Messages

Sometimes DSpace automatically sends e-mail messages to users, for example, to inform them of a new work flow task, or as a subscription e-mail alert. The wording of emails e-mails can be changed by editing the relevant file in [dspace]/config/emails . Each file is commented. Be careful to keep the right number 'placeholders' (e.g. ${params[2]}) for the template's positional parameters.

Each file is a Velocity template.  You can use the full Velocity Template Language to help you customize messages.  There are two Velocity properties pre-defined by DSpace when processing an e-mail template:

  • params is the array of message parameters provided by the DSpace code which is sending the message

...

  • .  These are indexed by number

...

  • , starting at zero.
  • config is the table of DSpace configuration properties (such as dspace.name).  These are looked up using config.get(property name).
Code Block
titleSample message template
## This is a comment.  It will not be part of the message.
This is the body of the message.  The code which sends it supplied two parameters:  ${params[0]} and ${params[1]}.
The name of this DSpace instance is ${config.get('dspace.name')} and you can browse it at ${config.get('dspace.url')}.

Also see and config is the table of DSpace configuration properties (such as dspace.name) indexed by property name.  See the template config/emails/register for an example of each.

Note: You should replace the contact-information "dspace-help@myu.edu or call us at xxx-555-xxxx" with your own contact details in:
config/emails/change_password
config/emails/register

Templates can set message headers

A template can set specific message headers by defining Velocity properties which have been enabled for this use by naming them as values of the DSpace configuration property mail.message.headers.  In most cases the name of the Velocity property will become the header's name, and the value of the property, the header's value.  For example:  #set(My-Header, "Hello World!") in a template will result in the message having a header My-Header: Hello World! IFF if mail.message.headers includes "My-Header".

A few Velocity property names are special in DSpace email templates:

namemeaning
subject

supplies the Subject: header's value.

charset

sets the charset parameter of the Content-Type: header of the bodypart, when there is a single bodypart.  It also causes the subject value to be treated as being encoded in this charset.  If not set, the charset defaults to US-ASCII as specified in RFC 2046.  If there are multiple bodyparts, all are assumed to be encoded in US-ASCII and charset has no effect on them.

...


Code Block
titleSample message template
## This is a comment.  It will not be part of the sent message.
#set($subject = "This will be the Subject: of the message")
This is the body of the message.

File Storage

Info

Beginning with DSpace 6, your file storage location (aka bitstore) is now defined in the [dspace]/config/spring/api/bitstore.xml Spring configuration file.  By default it is defined as the [dspace]/assetstore/.  More information on modifying your file storage location can be found at   Configuring the Bitstream Store in the Storage Layer documentation.

...