Skip to main content
Skip table of contents

VISULOX Mail Client and Send PIN

Overview

The 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

CODE
/opt/visulox/lib/utils/mailclient.tcl

Configuration parameters

CommandDescription
-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>
-html <templatename> in /etc/html/template/

-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>

-testFull test of the configuration
-heloSmall 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

CODE
    ----------------------------------------------------------------------------------------
    | 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.

CODE
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.

CODE
visulox config edit -name mail.server=relay.domain.dom
visulox config edit -name mail.sender=noreply@domain.dom

Testing the functionality

CODE
/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

CODE
/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 valueAlternate 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>VLXSMSText number of user
-email <value>VLXEMAILeMail of user
-text <value>VLXPIN_TEXTText 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



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.