MAILTOOL Configuration Files, Router Files and Defaults

Configuration Files

Defaults for MAILTOOL can be stored in a file in the IFS in JSON format.

The standard default file is /bvstools/mailtool/config/defaults.json.

You can create subdirectories for each user you wish to have unique defaults. For example, if user JSMITH wanted their own defaults file, you would create a subdirectory named /bvstools/mailtool/config/jsmith and place the defaults.json file in the subdirectory and set the defaults specifically for that user.

You can also use the mailtool_setValue function to set configuration file used. The variable name is "configuration_file". This is the only value that can be used before the mailtool_init function.

An example of the file is as follows:

{

"variables": [

{

"name":"from_email",

"default":" "

},

{

"name":"from_name",

"default":" "

},

{

"name":"subject",

"default":" "

},

{

"name":"message",

"default":" "

},

{

"name":"reply_to_email",

"default":" "

},

{

"name":"reply_to_name",

"default":" "

},

{

"name":"mdn_email",

"default":" "

},

{

"name":"mdn_name",

"default":" "

},

{

"name":"sender_email",

"default":" "

},

{

"name":"sender_name",

"default":" "

},

{

"name":"return_email",

"default":" "

},

{

"name":"return_name",

"default":" "

},

{

"name":"footer_stream_file",

"default":" "

},

{

"name":"message_id",

"default":" "

},

{

"name":"message_id_domain",

"default":" "

},

{

"name":"send_with_server_type",

"default":"*IBMSMTP"

},

{

"name":"mail_router",

"default":"*NONE"

},

{

"name":"use_mail_router",

"default":"*NO"

},

{

"name":"mail_router_stmf",

"default":""

},

{

"name":"perform_mx_lookup",

"default":"*YES"

},

{

"name":"use_ssl",

"default":"*NO"

},

{

"name":"smtp_port",

"default":"25"

},

{

"name":"smtp_auth_user",

"default":" "

},

{

"name":"smtp_auth_password",

"default":" "

},

{

"name":"bind_to_ip_address",

"default":" "

},

{

"name":"timeout",

"default":"30"

},

{

"name":"ccsid",

"default":"819"

},

{

"name":"no_attachment_action",

"default":" "

},

{

"name":"body_content_type",

"default":"text/plain"

},

{

"name":"mime_ccsid",

"default":"819"

},

{

"name":"temporary_directory",

"default":"/tmp"

},

{

"name":"importance",

"default":"normal"

},

{

"name":"priority",

"default":" "

},

{

"name":"recipient_separator",

"default":","

},

{

"name":"close_connection",

"default":"*YES"

},

{

"name":"save_email",

"default":"*DFT"

},

{

"name":"debug",

"default":"*NO"

},

{

"name":"debug_file",

"default":"mailtooldebug_/%id%/.txt"

},

{

"name":"debug_smtp_file",

"default":"mailtoolsmtp_/%id%/.txt"

}

]

}

Router Files

A router list for MAILTOOL can be stored in a file in the IFS in JSON format when the value for the Mail Router is set to *STMF.

The standard default file is /bvstools/mailtool/config/routers.json.

You can create subdirectories for each user you wish to have unique defaults. For example, if user JSMITH wanted their own defaults file, you would create a subdirectory named /bvstools/mailtool/config/jsmith and place the routers.json file in the subdirectory and set the defaults specifically for that user.

You can also use the mailtool_setValue function to set routers file used. The variable name is "mail_router_stmf".

An example of the file is as follows:

{

"mail_routers": [

{

"mail_router": "second.smtp.mail.com", Required

"from_email": "email@domain.com", Optional [email address] (Default: FROMADDR)

"perform_mx_lookup": "*NO", Optional [*YES, *NO] (Default: *YES)

"use_ssl": "*YES", Optional [*YES, *NO] (Defalt: *NO)

"smtp_port" : "465", Optional [SMTP Port] (Default: PORT)

"smtp_auth_user" : "userid", Optional [SMTP Authentication User] (Default: blank)

"smtp_auth_password" : "password", Optional [SMTP Authentication Password] (Default: blank)

"sequence": 10 Optional [Router Sequence] (DefaultL: 0)

},

{

"mail_router": "third.smtp.mail.com",

"from_email": "email@domain.com",

"perform_mx_lookup": "*YES",

"use_ssl": "*TLS",

"smtp_port" : "587",

"smtp_auth_user" : "userid",

"smtp_auth_password" : "password",

"sequence": 20

}

]

}

The values of *G4G_XOAUTH and *G4MS_XOAUTH can be used for the smtp_auth_user value to specify to use OAuth 2.0 authentication for your Google or Outlook account, respectively. In this case the smtp_auth_password value does not need to be set.