Introduction

A number of Arguments and Environment Variables for jobs are provided from the eMailDefault Job Resource. The Job Resource carries settings used to connect to a mail server.

The eMailDefault Job Resource is available for download

The Job Resource can be assigned workflows and jobs that require connection to a mail server, for details see JS7 - Job Resources

The eMailDefault Job Resource is not included with JS7 and is not updated/overwritten when updating JS7 products. The Job Resource is an example for frequently used settings.

Users are free to add individual settings to their needs.

Job Resource: eMailDefault

The Job Resource includes

  • Arguments for use with Java jobs,
  • Environment Variables for use with Shell jobs.

Both Arguments and Environment Variables hold the same values and are used depending on the job type for which the Job Resource is used.


CategoryArgumentEnvironment VariableDescriptionSample Value
Required Settings




fromMAIL_SMTP_FROME-Mail address from which mail will be sentjs7@example.com






from_nameMAIL_SMTP_FROM_NAMEName of the E-Mail account that sends mailJS7 JobScheduler

reply_toMAIL_SMTP_REPLY_TOE-Mail address for replies to mailsno-reply@example.com

mail.smtp.hostMAIL_SMTP_HOSTHostname or IP address of the mail servermail.example.com

mail.smtp.portMAIL_SMTP_PORTSMTP Port of the mail server25
Optional Settings



Timeoutsmail.smtp.timeoutMAIL_SMTP_TIMEOUTTimeout in ms for responses of the mail server5000

mail.smtp.connectiontimeoutMAIL_SMTP_CONNECTIONTIMEOUTTimeout in ms for establishing a connection to the mail server5000
Protocolsmail.smtp.ssl.protocols
Specifies the protocol(s) in use, for example 
  • TLSv1.2
  • TLSv1.3
  • TLSv1.2,TLSv.1.3


mail.smtp.starttls.enable
Must be set to true if TLS is used to connect to the mail server. The mail.smtp.ssl.enable setting should be set to false.

mail.smtp.ssl.enable
Must be set to true if SSL is used to connect to the mail server. The mail.smtp.starttls.enable setting should be set to false.
Authenticationmail.smtp.user
Used for SMTP user/password authentication

mail.smtp.password
Used for SMTP user/password authentication
OAuth2 Authenticationmail.smtp.auth
Must be set to true if OAuth2 authentication is used.

mail.smtp.auth.mechanisms



mail.smtp.sasl.mechanisms.oauth2.oauthToken
Holds an OAuth2 access token

Explanation:

  • Required Settings are included with the eMailDefault Job Resource.
  • Optional Settings can be added by users. 
  • Note that e-mail settings are used for JS7 - Notifications - Configuration Element MailFragment
    • The names of Arguments and Environment Variables should not be changed.
    • Any further Arguments and Environment Variables can be added that start with the prefix mail.smtp. and MAIL_SMTP_ respectively,
      • For example, to force support for TLS connections with a specific version of the protocol you can use:
        • Argument: mail.smtp.ssl.protocols, value: TLSv1.2
        • Argument: mail.smtp.starttls.enable, value: true

      • For authentication the following settings are used:
        • the mail.smtp.user setting is assigned the SMTP user account.
        • the mail.smtp.password setting is assigned the password.
      • When using OAuth2 authentication then the following settings are used:
        • the mail.smtp.auth setting is assigned the value true.
        • the mail.smtp.auth.mechanisms setting is assigned the value XOAUTH2.
        • the mail.smtp.user setting is assigned the OAuth2 user account.
        • the mail.smtp.password setting is assigned the OAuth2 access token.
        • Some mail servers such as smtp.office365.com might require the older SASL mechanism to be used:
          • the mail.smtp.sasl.mechanisms.oauth2.oauthToken setting is assigned the OAuth2 access token.
          • the mail.smtp.password setting is not specified.
    • Find the list of available settings for JavaMail from : https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html

Further Resources


  • No labels