Installation

This document describes how to install the Email Service software. The following topics can be found in this section:

System Requirements

This section details the system requirements for installing and operating the Email Service.

Java Runtime Environment

The Email Service was developed using Java and will run on any platform with a supported Java Runtime Environment (JRE). The software was specifically compiled for and tested in Java version 1.8. The following commands test the local Java installation in a UNIX-based environment:

% which java
/usr/bin/java

% java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
        

The first command above checks whether the java executable is in the environment's path and the second command reports the version. If Java is not installed or the version is not at least 1.8, Java will need to be downloaded and installed in the current environment. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, the Java software can be downloaded from the Oracle Java Download page. The suggested software package is the Java Standard Edition (SE) 8, either the JDK or the JRE package. The JDK package is not necessary to run the software but could be useful if development and compilation of Java software will also occur in the current environment.

Java Application Server

The Email Service requires a Java application server for hosting the web application. The suggested application server for this release is Apache Tomcat with a minimal version of 7.0.X. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, see the Tomcat Deployment document for installation and configuration details. If viewing this document from the email-service package, view the Tomcat Deployment document from the Engineering Node site.

The top-level directory where Apache Tomcat is installed (i.e. the directory containing the webapps and conf sub-directories) will be referenced in these instructions as $TOMCAT_HOME.

Unpacking the Package

Download the email-service package from the PDS FTP site. The binary distribution is available in identical zip or tar/gzip packages. The installation directory may vary from environment to environment but in UNIX-based environments it is typical to install software packages in the /usr/local directory and in Windows-based environments it is typical to install software packages in the C:\Program Files directory. Unpack the selected binary distribution file with one of the following commands:

% unzip email-service-0.1.0-bin.zip
or
% tar -xzvf email-service-0.1.0-bin.tar.gz
      

Note: Depending on the platform, the native version of tar may produce an error when attempting to unpack the distribution file because many of the file paths are greater than 100 characters. If available, the GNU version of tar will resolve this problem. If that is not available or cannot be installed, the zipped package will work just fine in a UNIX environment.

The commands above will result in the creation of the email-service-0.1.0 directory with the following directory structure:

  • README.txt

    A README file directing the user to the available documentation for the project.

  • LICENSE.txt

    The copyright notice from the California Institute of Technology detailing the restrictions regarding the use and distribution of this software. Although the license is strictly worded, the software has been classified as Technology and Software Publicly Available (TSPA) and is available for anyone to download and use.

  • email-service.war

    The Web ARchive file (WAR) containing the Email Service application, which will need to be deployed to Apache Tomcat.

  • doc/

    This directory contains a local web site with the Email Service documentation, javadoc, unit test results and other configuration management information. Just point the desired web browser to the index.html file in this directory.

Deploying the Application

The Email Service web application is packaged as a WAR file and is intended for installation under a standard Java Application Server. For a Tomcat server deployment, the WAR file is normally copied directly to the webapps directory within the Tomcat installation or installed via the Manager interface. Once this step is complete, the application is ready for configuration.

Configuring the SMTP Server

The preferred method to configure the SMTP server for the Email Service is to manually edit the application configuration file (web.xml). The configuration defaults to accessing the SMTP server on the localhost at port 25 without a username and password. Edit the file $TOMCAT_HOME/webapps/email-service/WEB-INF/web.xml and modify the following parameters to correspond with the SMTP server of choice:

<context-param>
  <param-name>host</param-name>
  <param-value>localhost</param-value>
</context-param>

<context-param>
  <param-name>port</param-name>
  <param-value>25</param-value>
</context-param>

<context-param>
  <param-name>user</param-name>
  <param-value></param-value>
</context-param>

<context-param>
  <param-name>pass</param-name>
  <param-value></param-value>
</context-param>
      

To set the maximum mail size to chunks the provided email recipients, modify the value of max_msg_nums as shown below. The default value is 200.

<context-param>
  <param-name>max_msg_nums</param-name>
  <param-value>200</param-value>
</context-param>
      

To set the recipients of any emails send through the servlet, modify the value of recipients as shown below. The default email address is pds_operator@jpl.nasa.gov. Use a comma (,) to separate multiple email addresses. NOTE: If this is accessible to outside world, a value should always we set for the recipients.

<context-param>
  <param-name>recipients</param-name>
  <param-value>pds_operator@jpl.nasa.gov</param-value>
</context-param>
      

Configuration changes should be applied automatically. If not, restart Tomcat server to load the configuration changes.

Configuring for Feedback Widget

To allow for Feedback emails, we want to configure a specific endpoint to be more explicit, as well as allow for the opportunity to spin up additional Email Servlets in the future. You can do so by editting the file $TOMCAT_HOME/webapps/email-service/WEB-INF/web.xml by updating the servlet-mapping url-pattern to be SubmitFeedback:

Before update:

<servlet-mapping>
  <servlet-name>EmailSendingServlet</servlet-name>
  <url-pattern>/EmailSendingServlet</url-pattern>
</servlet-mapping>
      

After update:

<servlet-mapping>
  <servlet-name>EmailSendingServlet</servlet-name>
  <url-pattern>/SubmitFeedback</url-pattern>
</servlet-mapping>
      

Testing

You should test that the Email Service web application is up-and-running. To do so, type the following URL in your browser:

http://localhost:8080/email-service/
      

The above URL assumes that your Tomcat is running on the default port 8080 on the localhost - if not, please adjust the URL accordingly. A form is displayed for entering message details.