Send Email TLM. Table of contents



Similar documents
OCS Training Workshop LAB14. Setup

Emacs SMTP Library. An Emacs package for sending mail via SMTP. Simon Josefsson, Alex Schroeder

Jobs Guide Identity Manager February 10, 2012

Novell Identity Manager

Unifying Information Security. Implementing TLS on the CLEARSWIFT SECURE Gateway

s sent to the FaxFinder fax server must meet the following criteria to be processed for sending as a fax:

smtplib SMTP protocol client

Sage HRMS 2014 Sage Employee Self Service Tech Installation Guide for Windows 2003, 2008, and October 2013

CompleteView Admin Console User s Manual. Version 3.8

TIBCO Spotfire Server Migration. Migration Manual

Application Note. Using Mercury/32 as an SMTP Relay Client

Command Line Interface User Guide for Intel Server Management Software

AKIPS Network Monitor User Manual (DRAFT) Version 15.x. AKIPS Pty Ltd

Issue 2EN. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

ScriptLogic File System Auditor User Guide

Polycom RealPresence Resource Manager System Getting Started Guide

Front-Office Server 2.7

CipherMail Gateway Quick Setup Guide

TIBCO Spotfire Automation Services 6.5. User s Manual

# Constructors $smtp = Net::SMTP->new('mailhost'); $smtp = Net::SMTP->new('mailhost', Timeout => 60);

Secure Web Service - Hybrid. Policy Server Setup. Release Manual Version 1.01

Synology NAS Server Mail Station User Guide

# Constructors $smtp = Net::SMTP->new('mailhost'); $smtp = Net::SMTP->new('mailhost', Timeout => 60);

Using Microsoft Windows Authentication for Microsoft SQL Server Connections in Data Archive

4.0. Offline Folder Wizard. User Guide

Integrated Citrix Servers

TIBCO Spotfire Automation Services 6.5. Installation and Deployment Manual

IGEL Universal Management. Installation Guide

Configuring Security for SMTP Traffic

Configuring PPP And SIP

SendMIME Pro Installation & Users Guide

Setup Guide Access Manager 3.2 SP3

StreamServe . User Guide SP2 Rev A

Encryption. Administrator Guide

IceWarp Unified Communications. AntiVirus Reference. Version 10.4

WebSphere Application Server security auditing

THUNDERBIRD SETUP (STEP-BY-STEP)

Device Log Export ENGLISH

CA Nimsoft Monitor Snap

How To Use Gfi Mailarchiver On A Pc Or Macbook With Gfi From A Windows 7.5 (Windows 7) On A Microsoft Mail Server On A Gfi Server On An Ipod Or Gfi.Org (

Configuring Notification for Business Glossary

PHD Virtual Backup for Hyper-V

Administration Guide Novell Filr May 2014

Installation Guide. SafeNet Authentication Service

FaxFinder. V.34 Fax Server. Configuration Guide for Inter-Operation with Panasonic TDA Phone Systems

CompleteView Admin Console Users Guide. Version Revised: 02/15/2008

LANDESK Service Desk. Desktop Manager

MobileStatus Server Installation and Configuration Guide

This guide consists of the following two chapters and an appendix. Chapter 1 Installing ETERNUSmgr This chapter describes how to install ETERNUSmgr.

Configuring your client to connect to your Exchange mailbox

Synchronization Agent Configuration Guide

Version 1.0 Revision MODBUS/TCP Ethernet Communication Interface API for the Intelligent Instrumentation WinCE Platform SETUP MANUAL

Intel Storage System SSR212CC Enclosure Management Software Installation Guide For Red Hat* Enterprise Linux

RealPresence Platform Director

Guardian Digital Secure Mail Suite Quick Start Guide

Simple Scan to Setup Guide

Server Installation Guide ZENworks Patch Management 6.4 SP2

Installation Guide. Version 1.5. May 2015 Edition ICS Learning Group

Scan to Quick Setup Guide

Getting Started Guide. Review system requirements and follow the easy steps in this guide to successfully deploy and test GFI FaxMaker.

Track and Trace. Administration Guide

An Oracle White Paper September Oracle WebLogic Server 12c on Microsoft Windows Azure

1 Thunderbird v3 and IMAP/SMTP Configuration

Administration Quick Start

PRINT FLEET MANAGER USER MANUAL

IBM. Implementing SMTP and POP3 Scenarios with WebSphere Business Integration Connect. Author: Ronan Dalton

Trustwave SEG Cloud Customer Guide

WebSphere MQ Oracle Enterprise Gateway Integration Guide

StreamServe Job Gateway

Setting Up a Unisphere Management Station for the VNX Series P/N Revision A01 January 5, 2010

Android App User Guide

Lepide Software. LepideAuditor for File Server [CONFIGURATION GUIDE] This guide informs How to configure settings for first time usage of the software

NetIQ Sentinel Quick Start Guide

CS 326e F2002 Lab 1. Basic Network Setup & Ethereal Time: 2 hrs

Ingenious Testcraft Technical Documentation Installation Guide

Articles Fighting SPAM in Lotus Domino

PePWave Surf Series PePWave Surf Indoor Series: Surf 200, AP 200, AP 400

Altiris Monitor Pack for Servers 7.1 SP2 from Symantec Release Notes

Working with the Cognos BI Server Using the Greenplum Database

RSM Web Gateway RSM Web Client INSTALLATION AND ADMINISTRATION GUIDE

SpamPanel Reseller Level Manual 1 Last update: September 26, 2014 SpamPanel

Remote Console Installation & Setup Guide. November 2009

Log Analyzer Reference

Microsoft IIS Integration Guide

Monetra Payment Software

SITRANS RD500 Configuring the RD500 with PSTN or GSM modems and Windows-based servers and clients for communication Objective:

Integration Guide. SafeNet Authentication Service. Integrating Active Directory Lightweight Services

Contents Notice to Users

Administration guide. Océ LF Systems. Connectivity information for Scan-to-File

MailEnable Installation Guide

NovaBACKUP xsp Version 15.0 Upgrade Guide

MarkLogic Server. Connector for SharePoint Administrator s Guide. MarkLogic 8 February, 2015

Healthstone Monitoring System

CA Nimsoft Monitor. Probe Guide for IIS Server Monitoring. iis v1.5 series

Enterprise Self Service Quick start Guide

Option Network Management Software for UPS UNMS II

Implementing MDaemon as an Security Gateway to Exchange Server

Windows Azure Pack Installation and Initial Configuration

Interactive Reporting er Manual

Transcription:

Table of contents 1 Overview... 3 1.1 Overview...3 1.1.1 Introduction...3 1.1.2 Definitions... 3 1.1.3 Concepts... 3 1.1.4 Features...4 1.1.5 Requirements... 4 2 Warranty... 5 2.1 Terms of Use... 5 3 Configuration...6 3.1 Configuration Basics...6 3.1.1 Email Components... 6 3.1.2 Sample Main Body Files...7 3.1.3 Attachment Files...7 3.1.4 SENDMAIL.LST Configuration File... 7 4 Usage... 9 4.1 Usage...9 4.1.1 Installation... 9 4.1.2 Editor Usage... 10 4.1.3 Programming the TLI...11 5 Debugging... 11 5.1 Debugging Tips...11 5.1.1 Using the debug Configuration Setting... 11

5.1.2 Using the Command Line Program mailtest... 11 6 All... 12 Page 2

1 Overview 1.1 Overview 1.1.1 Introduction The Send Email TLM (Cat No SM-MSG) is an add-on firmware option for SoftPLC version 4.x and later, which can be purchased for each system needing the capability to send emails or text messages. This capability is implemented as a TOPDOC Loadable Module (TLM), written in C++ and implements a ladder instruction (TLI) which sends email using the well known SMTP protocol. This document describes the installation, usage, and functionality of the sendmail TLM. This TLM may be used to send email by way of a ladder logic instruction, giving the user full programatic control over the trigger conditions. Queuing is implemented. Therefore a number of outbound emails can be triggered within a very small window of time and the TLM will queue up the requests on a first in first out basis in the same way that an alarm annunciator would. The queued emails will be sent out as fast as possible, depending on the speed of the connection path to the SMTP server and SMTP server speed. A number of different SMTP authentication methods are supported, include the one used by Google's well known gmail. Providing you have a gmail account, the GMail SMTP server can be used to forward messages to your cell phone. (Gmail accounts are readily attainable for free, making this capability available to all SoftPLC users with Internet access.) 1.1.2 Definitions An email message consists of the following parts: recipient list, sender identity, message body, and optional attachment. An SMTP server is provided by your Internet Service Provider, or you may use any for which you can provide authentication information such as a username and password. This TLM must be given authenticated access to an SMTP server. That is, all email is sent through an SMTP server on the Internet or in house. 1.1.3 Concepts The SoftPLC runtime engine software supports TLMs, which are shared library extensions to SoftPLC. A TLM may be loaded either as a DRIVER or as a MODULE. The difference between a DRIVER and a MODULE is that a DRIVER is called once per SoftPLC scan, and optionally an additional number of times per scan. A MODULE is only called when the control program decides to call it and not as an inherent part of the scan. TLMs are made Page 3

known to SoftPLC in the MODULES.LST file which may be edited by TOPDOC NexGen by traversing to: PLC Modules. This SENDMAIL TLM is to be used as a MODULE, not as a DRIVER, and it provides a Topdoc Loadable Instruction (TLI) called SENDMAIL that you call from your ladder program. A new email is sent on any false to true rung condition edge. The SENDMAIL TLI takes a CONTROL datatable element as its first parameter and uses this to keep track of edge triggering and email sending progress. Each TLI used in your ladder program must have its own dedicated unique CONTROL element. 1.1.4 Features In order to use the SENDMAIL TLI you need a working ethernet connection, DNS server, and default gateway. This TLM takes a configuration file named SENDMAIL.LST which holds information about one or more SMTP servers that you intend to use, and about your SMTP account on each identified server. Up to 5 email messages may be queued at one time in RAM before the SENDMAIL TLI begins to report that the queue is full. As soon as the first queued up email message has been sent, this frees up another slot and then the TLI is ready for another rising edge trigger condition. (The limit of 5 is arbitrary. If you have enough RAM relative to the size of your email messages, this limit can be expanded upon special request.) An email message can consist of a text file that you prepare in advance on a SoftPLC runtime disk. Optionally, a second file can be included as an attachment to the email. The attachment is another disk file, and if provided, can be either text or binary in nature. A few different levels of verbosity are supported regarding debug logging of the SMTP transactions. A command line program is provided allowing you to debug your configuration and SMTP client setup outside of the SoftPLC runtime, yet on the same box using the Linux command prompt. 1.1.5 Requirements A working link to the Internet, using either ethernet, modem, or PPP. A DNS server defined in your /etc/network.lst file. A default gateway defined in your /etc/network.lst file. Version 4.x SoftPLC or later. Page 4

2 Warranty 2.1 Terms of Use Because of the variety of uses of the information described in this manual, the users of, and those responsible for applying this information must satisfy themselves as to the acceptability of each application and use of the information. In no event will SoftPLC Corporation be responsible or liable for its use, nor for any infringements of patents or other rights of third parties which may result from its use. SOFTPLC CORPORATION MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. SoftPLC Corporation reserves the right to change product specifications at any time without notice. No part of this document may be reproduced by any means, nor translated, nor transmitted to any magnetic medium without the written consent of SoftPLC Corporation. SoftPLC, and TOPDOC are registered trademarks of SoftPLC Corporation. Copyright 2010-2011 SoftPLC Corporation ALL RIGHTS RESERVED First Printing: May, 2010 Latest Printing: Jan, 2011 SoftPLC Corporation 25603 Red Brangus Drive Spicewood, Texas 78669 USA Telephone: 1-800-SoftPLC Fax: 512/264-8399 URL: http://softplc.com Email: support@softplc.com Page 5

3 Configuration 3.1 Configuration Basics 3.1.1 Email Components An email message as supported by this TLM is assembled from various parts. Listed below are the parts that the TLM needs or uses and the source of the part. Part Name Description Source Control Result Identity To File Attachment A datatable CONTROL element consisting of 3 words. Used to keep track of the progress of the email. A datatable STRING element that will hold explanatory text about the status of the send operation at completion. A datatable STRING element which names a record in the SENDMAIL.LST file. The named file record will provide the SMTP server, SMTP account username and password, and Reverse-Path. Reverse-Path is a formal designation of the "From:" address. A datatable STRING element which holds a recipient list of email addresses, separated by a comma. No comma if only a single address. For example: "rbs@hme.com, another@hme.com" without the quotes. A datatable STRING element which holds the filename of the main body of the email message. A datatable STRING element which holds the filename of the attachment to the email message. First TLI parameter Second TLI parameter Third TLI parameter and the file / SoftPLC/tlm/SENDMAIL.LST Fourth TLI parameter. Fifth TLI parameter and the named disk file. For example: "/home/ root/mainbody.txt" Sixth TLI parameter and the named disk file. For example: "/ tmp/processdata.csv" without the quotes. Page 6

Part Name Description Source An empty STRING is interpreted as no attachment. File MIME Type Attachment MIME Type A formal textual description of the MIME type for the File of the email message. If not provided, then "text/plain" is supplied automatically. A valid alternative would be "text/html" if your main body file is HTML. A formal textual description of the MIME type for the Attachment of the email message. If the type is "application/octet-stream" or any other starting with "application/", then the attachment will be base64 encoded such that a binary attachment will be sent exactly. If not provided, then "application/octet-stream" is supplied automatically. A valid alternative would be "text/plain". Not required, but can be given preceeding the filename in the fifth TLI parameter. For example: "text/plain: /etc/network.lst" without the quotes. The colonspace combo is the separator, and will be stripped away when grabbing the MIME type and filename. Not required, but can be given preceeding the attachment in the sixth TLI parameter. For example: "application/octet-stream: /tmp/ mydata.zip". The colon-space combo is the separator, and will be stripped away when grabbing the MIME type and attachment. Table 1: Parts of an Email Message According to SENDMAIL TLM 3.1.2 Sample Main Body Files The main body file must be a text disk file, either simple ASCII or HTML. 3.1.3 Attachment Files The single allowed attachment may be a text or binary disk file. 3.1.4 SENDMAIL.LST Configuration File The configuration file for the SENDMAIL TLM is /SoftPLC/tlm/SENDMAIL.LST, and a sample is shown below. # Configuration file for SoftPLC SENDMAIL TLM. # Anything from # to end of line is a comment. # The debug parameter comes first, set to 0 to turn off debugging. Bits within # debug are as follows, use 3 to turn on both bits. Page 7

#define DEBUG_SHOW_ARGS (1 << 0) // print the TLI arguments #define DEBUG_TRANSACTIONS (1 << 1) // print stuff from mail server debug = 3 #debug = 0 # Next comes one or more identities. An identity consists of # identity = name # and a number of trailing attribute/value pairs that follow on separate lines. # The identity name must match your TLI "Identity" ladder instruction parameter. # Then comes server, reverse_path, and optionally: username, password, # starttls, helo. ######################################################################### identity = plc42 # server: set to the name and port number of the SMTP server. Be sure and # provide the port number, either 25 or 587 after the server name. server = mailserver.birch.net:25 # reverse_path: is tantamount to the "From:" email header, but is called # reverse_path because of RFC 2821. Think of this as a from field for the # email. reverse_path = plc42@softplc.com # helo: set the hostname to be identify as when sending HELO or EHLO commands. # This is a per identity option. It should be the name you are seen as # from the answering server. If none given, then this machine's hostname # is used (and that is usually sufficent). helo = plc42 # username = dick@softplc.com # password = not_needed_because_t1 starttls = disabled ######################################################################### identity = info@softplc.com server = smtp.gmail.com:587 # helo = plc42 username = gmailuser@gmail.com password = wordclue starttls = required reverse_path = gmailuser@softplcc.com Table 1: Sample SENDMAIL.LST From the sample configuration file above, you can see that after the debug setting, then comes the identity record(s). You only need one identity record if you only plan on using only one SMTP account. You may omit the 2nd identity record. The comments in the sample file should be enough to get you going. Page 8

4 Usage 4.1 Usage 4.1.1 Installation The TLM is named sendmail.tlm.so, and the configuration file is SENDMAIL.LST. You will need to copy these onto the SoftPLC flash in the /SoftPLC/tlm directory. Then, to use it you have to enable it in NexGen's PLC MODULES editor. Simply click on the Configure button after selecting and enabling Use in the same row as the SENDMAIL TLM. Page 9

4.1.2 Editor Usage Load button will load the configuration file from the development system's disk. Page 10

Save button will write the configuration file to the development system's disk. Fetch button will load the configuration file from the runtime system's disk. Send button will write the configuration file to the runtime system's disk. The next step is to cycle power on the SoftPLC for the changes to take place. As an alternative to cycling power, you may enter "Remote Program" mode using NexGen, then select "Remote Program" a second time. This psuedo transition from Remote Program to Remote Program is a signal to the TLM that it should reload its configuration file. This way you can reconfigure without cycling power, although it does require you enter "Remote Program" mode (twice!). 4.1.3 Programming the TLI The TLI is low to high edge triggered, and this edge will queue up another copy of an outbound email with the makeup given by the TLI parameters. Currently the queue size is arbitrarily set to 5 emails. A sixth attempt would not succeed until the first email was completely sent. Upon completion, either the DN bit or ER bit will be set: Success: The DN (done) bit is set within the CONTROL, the POS field of the CONTROL will increment by 1, and the email will have been sent OK. Failure: The ER (error) bit will be set, the LEN field within the CONTROL will be set to a non-zero error code, and the Result: STRING will tell you what went wrong. The POS field of the CONTROL will increment by 1. 5 Debugging 5.1 Debugging Tips This section gives tips on debugging problems with the TLI. 5.1.1 Using the debug Configuration Setting Set debug to 3 in the configuration file while testing out a new ISP's SMTP server. Run softplc from the command line, this will tell you something about what is happening when the ladder instruction is triggered. 5.1.2 Using the Command Line Program mailtest Run the program /SoftPLC/run/mailtest without any arguments and it will tell you how to send an email from the command line. Use this to hone your email components for the TLI. Page 11

6 All Page 12