VISULOX Mail Client and Send PIN
OverviewThe VISULOX utilities include a small mail client to transport mails: mailclient.tcl. Another useful script for sending SMS and mails in VISULOX utilities is sendPIN.tcl. |
mailclient.tcl
/opt/visulox/lib/utils/mailclient.tcl
Configuration parameters
| Command | Description |
|---|---|
| -from <value> | Sender (originator) email, default: <visulox> |
| -to <value> | Comma or space separated list of recipients email, default: <root> |
-mg <value> | The mailinggroup and an individual email list can be provided: VLXMAILINGGROUP_UUID, VLXMAILINGGROUP_EMAILS |
| -server <value> | SMTP server, default: <localhost> |
| -port <value> | SMTP server port, default: <25> |
| -secure <value> | SMTP Securing mode: none, startTLS, TLS/SSL <none> |
| -subject <value> | Subject, default: <Visulox Mail Client> |
| -html <value> | -html <path to HTML file> |
| -file <value> | Text file <stdin> |
-user <value> | SMTP user (overwritten by resource) <> |
| -password <value> | SMTP password (overwritten by resource) <> |
| -bodymime <value> | Mime type of mail body, default: <text/plain> |
| -attachements <value> | Attachments <> |
| -timeout <value> | Timeout in seconds, default: <10> |
| -test | Full test of the configuration |
| -helo | Small Helo test to mail server |
After reading of stdin, -file or -html all variables like %VLX<xxx>% are substituted.
All style sheets in /opt/visulox/etc/css/ are read and they are ready for substitution:
%VLXINCLUDE:visulox.css% is /etc/css/visulox.css
Configuration in database
visulox config list -name mail -force
----------------------------------------------------------------------------------------
| parameter | type | value |
----------------------------------------------------------------------------------------
| mail.port | SETUP | 25 |
| mail.recipient | SETUP | root |
| mail.resource | SETUP | |
| mail.secure | SETUP | none |
| mail.sender | SETUP | visulox |
| mail.server | SETUP | localhost |
| regexp.email | FIXED | ^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+\.[A-Za-z0-9-]{2,4}$ |
| regexp.report.email | FIXED | ^$|^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+\.[A-Za-z0-9-]{2,4}$ |
----------------------------------------------------------------------------------------
The mail client can be under control of the VISULOX configuration. So it is not needed to set the mail server in each script for example.
visulox config edit -name mail.server=relay.domain.com
How to test the functionality of the VISULOX Mail Client
In the mail.sender field the SMTP-server is configured. The desired setup has to be entered if localhost should not be used.
Modifications to the setup are done e.g.
visulox config edit -name mail.server=relay.domain.dom
visulox config edit -name mail.sender=noreply@domain.dom
Testing the functionality
/opt/visulox/lib/utils/mailclient.tcl -to user@domain.dom -file <testfile> -subject test
If the mail is received, the setup is good. If no mail is delivered most likely the SMTP-server needs some configuration (check log files).
Make sure the VISULOX user has a valid eMail address configured.
Requirement for the functionality is a local or an external SMTP server.
sendPIN.tcl
/opt/visulox/lib/utils/sendPIN.tcl
The Multi Factor Authentication has to provide a PIN to the user. The PIN is sent via a PIN Script.
In some cases, the user has both, an eMail address and a text message number in the datasource and the PIN has to be be sent via one of the channels.
Here the script sendPIN.tcl is helpful. sendPIN.tcl sends the eMail and/or textmessage via SMTP.
VISULOX provides the text message number, the mail address, the PIN text in the configured PIN script. sendPIN.tcl takes care on sending.
sendPIN.tcl sends the text via eMail and/or SMS. Minimum is SMS or eMail, maximum is both.
Configuration parameters
| Commandline value | Alternate value | Description |
|---|---|---|
| -domain <value> | The text message will be sent via SMTP to <textmessagenumber>@domain. This parameter configures the SMS domain. | |
| -smsvia <value> | SMTP server to send <textmessagenumber>@domain. This is needed, if the SMS should not use the eMail server. If not set, the configured SMTP server is used | |
| -emailvia <value> | SMTP server to send the PIN text via eMail. If not set, the configured SMTP server is used | |
| -sms <value> | VLXSMS | Text number of user |
| -email <value> | VLXEMAIL | eMail of user |
| -text <value> | VLXPIN_TEXT | Text to send (160 characters) |
| -subject <value> | Subject of the eMail / text message | |
| -local <value> | Replaces local number with leading 0 to suffix <> | |
| -00 | Replaces leading + to 00 | |
| -trim | Trims leading 0 |
Related articles
- How to setup MFA with SMS response from the SMS Provider
- How to configure a user account as a group account
- Variables in notifications
- How to create and use notifications
- RSA SecureID Implementation via RSA API
- VISULOX Webservice
- Transit script variables
- Migrating to One Time Password Authentication
- The VISULOX PIN Service
- How to control action scripts from the command line
- Notifications
- MFA via external service
- VISULOX Mail Client and Send PIN
- How to enable, configure and use MFA
- How to configure a user account as a group account