Don’t say we didn’t warn you – early bird pricing for Insight 2014, Message Systems user conference, will end this month. So if you haven’t yet purchased your ticket, now’s the time. And if you’ve already registered for Interact 2014, you might want to arrive a day early, because we have something smashing planned for you. No, not another guest appearance by a giant feathered friend like what happened last year, but something better: Pre-conference training sessions at no additional cost!

Our gate crashing guest of honor at the welcome reception in 2013

Come November 11, Jeff Gorton, who heads up our training division, will be conducting a full day of training on the eve of Insight 2014. Jeff, who will also be speaking about Momentum 4: REST API Overview on the first day of Insight 2014, will offer the following courses:

Advanced Policy Scripting Design

Developing policy in Momentum using the Lua programming language is super powerful, but can become unruly as you add more functionality to the policy scripts. In this training session from 9am-12pm, Jeff will present and demonstrate the most efficient approach to designing your Lua policy scripts for current functionality but also as a framework for future functionality. This training session is open to all current Message Systems University (MSU) subscribers. To learn more about how your company can join MSU, please contact [email protected].

Implementing Cross Channel Communications with Momentum

Momentum Mobile enables you to send and receive email, SMS/MMS text, push notifications and IM chat all from a single application server. From 1.30pm to 4.30pm, the Message Systems Training Team will present and demonstrate how to take advantage of this enterprise-class mobile middleware and cross-channel messaging platform. This session is open to all attendees.

Be sure to take advantage of our pre-conference training sessions taking place on the eve of Insight 2014. And after a fruitful day of learning, join us for our welcome reception where you can mingle with other attendees and enjoy some good company, and poolside food & drinks.

Remember, we have two awesome panels the following days that you’ll be sorry to miss:

Screen Shot 2014-09-17 at 3.24.33 PM

Screen Shot 2014-09-17 at 3.25.11 PM

We’re getting pretty excited to meet all of you at Insight 2014 again, so act now and register today!

To learn more about Momentum’s mobile capabilities and cross-channel communications, check our white paper, The New Communications Standard

The New Communications Standard

It’s no surprise that LinkedIn has become the go-to social network for professionals over the last several years growing from 60 million members in late 2009 to 277 million members today. Whether you are looking to build out your professional identity, engage with your professional network or search for potential job opportunities, chances are you have logged into LinkedIn recently.

As LinkedIn continues to grow and mature, so do its offerings. Over the past year, LinkedIn has transformed itself into a professional publishing platform with features including LinkedIn Pulse, an aggregation of top news and features specifically tailored to each user, and the LinkedIn Influencer program, which invites top voices in the professional world to reach other professionals through exclusive bylines.

In order to raise user awareness of its increased offerings and keep users up-to-date around content that will be of interest to them, LinkedIn relies on email as a preferred form of communication. And that’s where Message Systems comes in.

Since 2009, LinkedIn has relied on Message Systems’ Momentum Platform to provide unsurpassed sending speeds and high volume capabilities, reliability and leading deliverability rates. Additionally, Message Systems has worked closely with LinkedIn’s postmaster, Franck Martin, to help the company adopt DMARC, the email authentication standard that makes email more secure by protecting users against phishing attacks.

In fact, Franck and the LinkedIn email team were recognized at the Message Systems user conference back in October 2013 with a Customer Excellence Award. LinkedIn was singled out as the customer whose innovative use of the Message Systems solution set the highest example for delivering measurable benefits to its own organization and the wider Message Systems user community. Specifically, LinkedIn was lauded for its leading role in creating and sharing Lua-based scripted policies for the implementation of DMARC-compliant messaging processes.

Accepting the award, Franck said “I encourage conference attendees to build on the work of my team at LinkedIn to spread the adoption of DMARC, and help create a more secure online messaging environment for everyone.”

CEA LinkedIn
LinkedIn postmaster Franck Martin accepts the Customer Excellence Award from Barry Abel, SVP Sales Americas. LinkedIn was honored for setting the highest example for delivering measurable benefits to its own organization and the wider Message Systems user community, specifically for its advancement of DMARC.

The Message Systems team looks forward to continuing our professional relationship with LinkedIn as it continues to grow.

Learn more about DMARC, the email authentication standard that makes email more secure by protecting users against phishing attacks in the Don’t Deprioritize DMARC webinar!

Don't Deprioritize DMARC webinar

The Message Systems Training Division is proud to announce a new training offering to customers: Quarterly 3-Day Momentum Training Courses.

Once a quarter, the Message Systems training staff will conduct a 3-day Momentum training course at one of our offices throughout the world.

The first of these offerings is scheduled for Columbia on April 1-3, 2014.

The topics covered will include the following:

  • Deliverability Best Practices
  • Adaptive Delivery® Basic Overview
  • Momentum for Sending Overview
  • Getting Started: Installation, Starting Services and Basic Configuration
  • Momentum: Sending Messages
  • Hands-on Message Systems Adaptive Delivery
  • Momentum Configuration Management
  • DKIM, FBL’s, and Seedlists
  • Logging with Momentum
  • Momentum Bounce Handling
  • Failover: Clustering
  • Momentum Policy
  • Web Based User Interface
  • Lua Introduction, Fundamental API’s, and Policy Scripting

Attendees include professionals from different organizations and industries, each with their own unique sending issues. Gain insight into the challenges and solutions faced by other businesses or network and learn from industry peers. If you’d like to register for the training course, please email [email protected].

Can’t wait for training to start? Here’s something to keep your occupied in the meantime. Check out our white paper on adding Momentum to your business, Overcoming the Challenges of High Volume Sending.

Overcoming The Challenges of High Volume Sending

Testing your Lua scripts can sometimes be a bit tedious. It usually involves injecting a message in order to trigger the callout that will execute the code and output a message to the log. You must then open the log in order to check the log entry.

There is a better way. The Momentum console is extensible so you can add a command used solely for testing code. This does away with the need for injecting a message and looking for log entries in

Console Command




local function test_code(cc)

— put code you wish to test here

local doc = xml.parsexml([[<doc></doc>]]);

local node = doc:root();

local child = node:addchild(“item”);

child:attr(“name”, “Junior”);

child:contents(“I am a child node.”);

— use print for console output




msys.registerControl(“test_code”, test_code);


  • This code uses the XML library so it must be included.
  • Choose whatever name you wish for your function. The parameter passed to a control function is control construct userdata — we needn’t be concerned with it here but if you do want to pass an argument to the console command access it in the following way: cc.argv[1]. The code that you want to test goes inside this function.
  • This print statement will output node as text, verifying that the XML object has been created. You do not need to send a test email or check for log entries in
  • You must use the msys.registerControl function to register your console command. You can register any number of commands from the same script file so, if you wish, you can keep adding functions.

Test your code by issuing the command /opt/msys/ecelerity/bin/ec_console /tmp/2025 test_code. Invoking the console in this way-in batch mode-executes the command test_code and immediately exits the console. You should see output such as the following:


<item name=”Junior”>I am a child node.</item>


Errors will also be output to the screen. For example, if you attempt to pass nil to the child:contents function you will see the following error message:


bad argument #1 to ‘contents’ (string expected, got nil)

The console provides a very convenient way of testing code but it has limitations. You have no access to userdata such as an ec_message so you cannot test message object methods. Additionally, some Lua functions can only be used during specific callouts and require that a message transit Momentum.

Running into the same old issues whenever you try to send high volumes of email? You need Momentum, the all-in-one platform for email, mobile, integration and analytics. Get the Overcoming the Challenges of High Volume Sending white paper today!

Overcoming The Challenges of High Volume Sending

Twenty years ago, there was only one web browser and it was actually called the “World Wide Web” browser. There was only one search engine and its name was Archie. About that same time I remember reading about the research team at the Cambridge University’s computer lab where they had a non-computer problem to solve – the department coffee pot was always empty when they wanted a cup.

Being computer science geeks, they of course, found a computer science solution to the problem – rig up a camera and network it so they could always see when the coffee pot was full. That way they could make sure there was going to be coffee in the pot before they made the journey down the hall to fill a cup. This is how the first web cam was born.

What does this have to do with email? When I was thinking of radical, esoteric ways to show how email can be used to automate external processes, guess what I thought of first? Yes, that’s right – coffee. In practical terms, my coffee pot is a flight of stairs away and, like the computer geeks at Cambridge, I too would like to know that there is actually coffee in it before I make the trek. So let’s do this: let’s create a message-driven workflow that will bring some certainty and clarity to the coffee situation in my office.

Getting started:

What we need to make this work is an understanding of the Lua language – don’t worry, I’ll walk you through it. One of the things the Momentum software is very good at is processing mail – accepting messages, doing something with them, and then responding to / delivering messages. It is the “do something” part that we’re going to concentrate on here. In this case we are going to use Momentum’s embedded Lua script engine to check the incoming mail and read the subject line. If the subject line says “Show My Coffee Pot” then we want Momentum to do several things: a) get the current image from my “coffee cam” b) generate a reply email to the sender with c) an image of the coffee pot in it. The web cam watching the coffee pot captures an image every 30 seconds and saves it as a file on the server, so we can just attach that file to the mail and it will always be the current image.

Here’s the Lua script that will enable Momentum to perform our coffee pot check:

— ############################################### —

— load Message Systems helper extensions




local mod = {};


function mod:validate_data(msg, str, accept, vctx)

— define the variable tables we will need for the message components

local ctx = { ec_message = msg };

local headers = {};

local pparts = {};

local attachments = {};

local subject = msg:header(“subject”);


if string.lower(subject[1]) == “show my coffee pot” then

— create a message container and define mailfrom and rcptto

local imsg = msys.core.ec_message_new(now);

local imailfrom = “[email protected]”;

local ircptto = msg:mailfrom();


— define the headers and message parts

headers[“To”] = ircptto;

headers[“From”] = “[email protected]”;

headers[“Subject”] = “Current image from CoffeeCam”;

pparts[“text/plain; charset=utf8”] = “The CofeeCam image is attached.”;

pparts[“text/html”] = “<b>! CoffeeCam !</b> <br /> Latest image is attached.”;

local files1={};

files1[“type”] = “image/jpg”;

files1[“name”] = “coffee.jpg”;

— load the webcam image to the attachments table

local file_name = “/opt/msys/ecelerity/etc/conf/default/lua/coffee.jpg”;

local io = msys.core.io_wrapper_open(file_name, msys.core.O_RDONLY, 0666)

files1[“content”] = io;

files1[“disposition”] = “inline”;

attachments[1] = files1;


— build and send

imsg:build(headers, pparts, attachments);

imsg:inject(imailfrom, ircptto);


return msys.core.VALIDATE_CONT;



msys.registerModule(“coffee”, mod);

— ############################################### —

Toggle Comments »

The above script simply needs to be applied to a current version of Momentum and it will work. Don’t have Momentum? No worries – you can see the result in our demonstration system by sending an email to [email protected] with the subject “Show My Coffee Pot” and the system will send you back the last available image of the coffee pot. Please note that the script running on this demo system may not be here forever. If it is ever disabled, I will try to remember to update this blog.

So what does this prove? Well, admittedly, the coffee pot example is frivolous and not exactly something to base a business model on, but imagine what you can do in your business if you can enable other processes based on message activity. In this case, we automatically send an image back to an email address based on a matching subject line, but what if we send back an image from a security camera based on receiving an SMS and a security code? Or maybe we could generate an alert message to the system administrator if a particular set of key words were in the body of a message. How about automatically printing off a paper report summarizing mail activity for every 1 million messages delivered? Or getting your bank balance texted to you?

The uses for this kind of automation are endless, and any of the above scenarios would only require minor tweaks to the basic code above. If this sounds like something your business could leverage, I’d be happy to set up a meeting for you with the appropriate people at Message Systems.

(Editor’s note: Please note that Tom’s live coffee cam might not be online 24×7, but emailing to [email protected] should still return the latest image on the server as outlined above.)

Starting with Momentum Version 3.0, Message Systems has included an embedded copy of the Lua language in the bundle as a replacement for Sieve. For years Message Systems customers used Sieve as a policy engine to script actions based on message details, but Sieve, even in its modified Sieve++ form, is limited. Lua is a big improvement, offering the ability to iterate over data and work with tables, among other features. Just like Sieve, we have modified our embedded version of Lua to extend its functionality in numerous ways.

Not surprisingly, Lua has a large following in the programming world. It’s a well-developed, multi-purpose language that is often used by game developers for its simplicity and speed, as well as its inherent ability to expose and use C modules as well as its own native scripting. In Momentum, Lua has been extended with a number of local functions specifically to help with messaging rules. Aside from the extensive documentation on our custom functions, there is also a whole community of Lua users and developers on the web (links at the end of the article).

You will see in the sample below that the code itself is quite simple to follow, and anyone who has written a policy script in Sieve will see this as manna from heaven. So what does Lua look like in Momentum? I can show you using a very basic policy script that will assign messages to a binding based on an X-Header value. Here is the heavily commented policy script:

— This policy script is a common, but very simple example
You can use comments in Lua with a “–” for a single line or multi-line comments can be framed as this one is.
— As with many languages, you can “require” helper modules
— We have developed dozens of helpers that make message management easier


— We define the following variable as “local” and make it a “table” using braces
— IE: the variable “mod” is a local table

local mod = {};

— We have predefined function names for each message phase.
— This one is active specifically in the set_binding phase.

function mod:validate_set_binding(msg)

— getting the value of the X-Binding header is this easy:

local mybinding = msg:header(“X-Binding” );

— Assigning a binding of the same name as the header is just as easy:

local err = msg:binding(mybinding);

— proper etiquette requires us to “end” the function


— and finally we register the script so Momentum can use it.

msys.registerModule(“policy”, mod);

Toggle Comments »

Enabling the script to run with Momentum just requires adding a reference to the ecelerity.conf file:

scriptlet scriptlet {
script policy {
source = “/opt/msys/ecelerity/etc/conf/default/lua/policy.lua”

That is all there is to it. This is a very basic example but is probably the most common use of scripting in Momentum. Our clients have installed some extremely complex functionality with Lua including auto-responders, message cadence (recipient fatigue) protection and automated database list hygiene systems. If you do a little research you will find that Lua is embedded or core to many popular pieces of familiar code including Angry Birds, Civilization V, World of Warcraft, Far Cry, Fall Out, the Sputnik wiki engine, and the CISCO Adaptive Security Appliance. We are not alone in thinking Lua is awesome.

If you’re interested in gaining a better understanding of the Lua language, I recommend the book Programming in Lua, Second Edition by Roberto Ierusalimschy — A.K.A. the Lua Bible. There’s also a ton of links on the Internet, and I’ve listed a few of them below. By the way Lua is a proper name, and is not an acronym. Portuguese for “moon,” Lua was originally developed by a team at the Pontifical Catholic University of Rio de Janeiro in Brazil.

Tom Mairs
Manager, Enterprise Sales Engineering, Americas
[email protected]