Difference between revisions of "Sending Emails"

From Lingoport Wiki
Jump to: navigation, search
(Created page with "=test=")
 
(test)
Line 1: Line 1:
  +
== config_email_global.xml ==
=test=
 
  +
  +
File '''<code>config_email_global.xml</code>''' is the configuration file for setting up the sender's email credentials for all emails that are sent by the LRM process. It is located in the global '''<code><HOME>/Lingoport_Data/L10nStreamlining/config</code>''' folder.
  +
  +
The '''config_email_global.xml''' file is used by a project's ''Notifications'' Jenkins job in order to send out status emails. This Jenkins job is, by default, set to run once a week.
  +
  +
There are 3 types of information contained in the ''config_email_global.xml'' file.
  +
* email configuration
  +
* interval between the sending of status emails
  +
* flag indicating whether to send out the 'No Files to Prep' email
  +
  +
=== Email Credentials Configuration ===
  +
The email configuration consists of the following xml elements:
  +
* '''smtp-host''' - server that will send the email
  +
* '''smtp-auth''' - authentication mechanism, if applicable
  +
** ''mail.smtp.auth'' - smtp protocol with smtp authentication
  +
** ''mail.smtps.auth'' - smtps protocol with smtps authentication
  +
** ''none''' - smtp protocol with '''no''' authentication
  +
* '''email-sender''' - valid email address
  +
* '''sender-password''' - not required
  +
  +
[[Global_Configuration_Files#Send_Email_Command|Send email command]] may be used to test the configuration values.
  +
  +
==== Example Email Credentials Configuration ====
  +
  +
&lt;smtp-host&gt;smtp.gmail.com/&lt;smtp-host&gt;
  +
&lt;smtp-auth&gt;mail.smtps.auth&lt;/smtp-auth&gt;
  +
&lt;email-sender&gt;joe@mycompany.com&lt;/email-sender&gt;
  +
&lt;sender-password encrypted="false"&gt;mypassword&lt;/sender-password&gt;
  +
  +
=== Additional Email Configuration ===
  +
In addition, there are configuration settings for when to send out notification emails and whether or not to send out the 'No Files to Prep' email.
  +
* '''dashboard-url''' - Dashboard URL used as the link destination for the email Log In button
  +
* '''notify-changes-email-interval''' - By default, the ''Notification'' email may be sent every day. Since the project's Jenkins Notification job is only run once a week, this email will only be set out once a week.
  +
* '''late-kits-email-interval''' - By default, the ''Late Prep Kits'' email may be sent every day depending on the number of days late. Since the project's Jenkins Notification job is only run once a week, this email will be sent out once a week.
  +
* '''number-days-late''' - By default, a prep kit is deemed late if it is 7 days late.
  +
* '''send-no-files-to-prep-email''' - By default, the ''No Files to Prep'' email will be sent out when there is a request to prep a kit but there are no files to prep. If a Jenkins job is created that automatically attempts to prep a kit, then this value should be set to ''0'' so that the email is not sent. Otherwise, the email recipient's inbox may be inundated with 'No Files to Prep' emails.
  +
  +
=== Java Options for sending emails ===
  +
It may be necessary to explicitly set the email port and/or STARTTLS flag rather than rely on the default mail server values. In addition, the email session debug mode can be enabled.
  +
  +
There are 3 email settings that are set through java options:
  +
* Email Server Port
  +
* SMTP STARTTLS enabled
  +
* Email Session Debug mode enabled
  +
  +
==== Email Protocol Port Number ====
  +
The expected java option for explicitly setting the protocol port number is:
  +
* mail.smtp.port
  +
  +
Linux example if setting java options within a shell session.
  +
  +
:: <span style="background-color: #eaecf0;>export _JAVA_OPTIONS='-Dmail.smtp.port=25'</span>
  +
  +
==== Enable/Disable STARTTLS ====
  +
The expected java option for explicitly enabling/disabling STARTTLS is:
  +
* mail.smtp.starttls.enable
  +
  +
Linux example if setting java options within a shell session.
  +
  +
:: <span style="background-color: #eaecf0;>export _JAVA_OPTIONS='-Dmail.smtp.starttls.enable=true'</span>
  +
  +
==== Enable Email Session Debug mode ====
  +
The expected java option for explicitly enabling/disabling the email session debug mode is:
  +
* mail.debug.mode
  +
  +
Linux example if setting java options within a shell session.
  +
  +
:: <span style="background-color: #eaecf0;>export _JAVA_OPTIONS='-Dmail.debug.mode=true'</span>
  +
  +
=== Send Email Command ===
  +
The ''send email command'' is accessed through the lpcommon.jar file and is located in the <code>lib</code> folder (i.e. ../lrm-server-x.x/lib).
  +
  +
=== Encrypted Password ===
  +
The <code><sender-password></code> can be configured with the <code>encrypted</code> attribute set to true, as in
  +
<pre>
  +
...
  +
<email-sender>mailuser@company.com</email-sender>
  +
<sender-password encrypted="true">UUIasd455</sender-password>
  +
...
  +
</pre>
  +
  +
To encrypt the password, use the <code>encrypt</code> command line on <code>lrm-common.jar</code> file. For instance:
  +
  +
'''<code>> java -jar <LRM_INSTALLATION_PATH>/lib/lpcommon.jar --encrypt</code>'''
  +
  +
which will prompt you for the text (here the password) to encrypt and will provide the result on the console.

Revision as of 21:09, 8 September 2017

config_email_global.xml

File config_email_global.xml is the configuration file for setting up the sender's email credentials for all emails that are sent by the LRM process. It is located in the global <HOME>/Lingoport_Data/L10nStreamlining/config folder.

The config_email_global.xml file is used by a project's Notifications Jenkins job in order to send out status emails. This Jenkins job is, by default, set to run once a week.

There are 3 types of information contained in the config_email_global.xml file.

  • email configuration
  • interval between the sending of status emails
  • flag indicating whether to send out the 'No Files to Prep' email

Email Credentials Configuration

The email configuration consists of the following xml elements:

  • smtp-host - server that will send the email
  • smtp-auth - authentication mechanism, if applicable
    • mail.smtp.auth - smtp protocol with smtp authentication
    • mail.smtps.auth - smtps protocol with smtps authentication
    • none' - smtp protocol with no authentication
  • email-sender - valid email address
  • sender-password - not required

Send email command may be used to test the configuration values.

Example Email Credentials Configuration

   <smtp-host>smtp.gmail.com/<smtp-host>
   <smtp-auth>mail.smtps.auth</smtp-auth>
   <email-sender>joe@mycompany.com</email-sender>  
   <sender-password encrypted="false">mypassword</sender-password>

Additional Email Configuration

In addition, there are configuration settings for when to send out notification emails and whether or not to send out the 'No Files to Prep' email.

  • dashboard-url - Dashboard URL used as the link destination for the email Log In button
  • notify-changes-email-interval - By default, the Notification email may be sent every day. Since the project's Jenkins Notification job is only run once a week, this email will only be set out once a week.
  • late-kits-email-interval - By default, the Late Prep Kits email may be sent every day depending on the number of days late. Since the project's Jenkins Notification job is only run once a week, this email will be sent out once a week.
  • number-days-late - By default, a prep kit is deemed late if it is 7 days late.
  • send-no-files-to-prep-email - By default, the No Files to Prep email will be sent out when there is a request to prep a kit but there are no files to prep. If a Jenkins job is created that automatically attempts to prep a kit, then this value should be set to 0 so that the email is not sent. Otherwise, the email recipient's inbox may be inundated with 'No Files to Prep' emails.

Java Options for sending emails

It may be necessary to explicitly set the email port and/or STARTTLS flag rather than rely on the default mail server values. In addition, the email session debug mode can be enabled.

There are 3 email settings that are set through java options:

  • Email Server Port
  • SMTP STARTTLS enabled
  • Email Session Debug mode enabled

Email Protocol Port Number

The expected java option for explicitly setting the protocol port number is:

  • mail.smtp.port

Linux example if setting java options within a shell session.

export _JAVA_OPTIONS='-Dmail.smtp.port=25'

Enable/Disable STARTTLS

The expected java option for explicitly enabling/disabling STARTTLS is:

  • mail.smtp.starttls.enable

Linux example if setting java options within a shell session.

export _JAVA_OPTIONS='-Dmail.smtp.starttls.enable=true'

Enable Email Session Debug mode

The expected java option for explicitly enabling/disabling the email session debug mode is:

  • mail.debug.mode

Linux example if setting java options within a shell session.

export _JAVA_OPTIONS='-Dmail.debug.mode=true'

Send Email Command

The send email command is accessed through the lpcommon.jar file and is located in the lib folder (i.e. ../lrm-server-x.x/lib).

Encrypted Password

The <sender-password> can be configured with the encrypted attribute set to true, as in

         ...
         <email-sender>mailuser@company.com</email-sender>
         <sender-password encrypted="true">UUIasd455</sender-password>
         ...

To encrypt the password, use the encrypt command line on lrm-common.jar file. For instance:

> java -jar <LRM_INSTALLATION_PATH>/lib/lpcommon.jar --encrypt

which will prompt you for the text (here the password) to encrypt and will provide the result on the console.