Skip to content

CONNECTORS mail2sms procmail

Markus Neuhold edited this page Sep 26, 2015 · 13 revisions

Mail2SMS - Procmail - Connector

This connector provides a simple procmailrc filter and an appropriate Python3 script that process the incoming e-Mail data to send it to the SMS-Gateway.

Many software products only support email notifications and are not providing a simple way to extend the base software to handle REST calls to third party software.

With the email2sms connector you can extend any email compatible software with SMS notification as result.

Currently only the SUBJECT ist passed to the SMS-Gateway!

Overview

A graphical overview of components involved. .

Postfix example configuration

At our working side we are using Postfix as mail2sms SMTP server. At least you have to configure the following main.cf parameters.

mydestination = $myhostname, mymaildomain.com, localhost.at.strabag.com, localhost
mailbox_command = /usr/bin/procmail

procmailrc

The procmailrc file is the procmail filter. It will forward all incoming e-Mail to the Python script that is configured here.
You must change /path/to/procmail3.py to the absolute path where the procmail3.py script resides.

procmail3.conf

You have to specify all parameters. No default values are provided.

  • loglevel
    Specify the loglevel. Use DEBUG to know whats going on.
    loglevel = DEBUG
  • logfile
    The logfile the logging information is going to. No path needed. The logfile will reside beside the procmail3.py script.
    logfile = procmail3.log
  • smsgateway
    The base URL under which the WIS component is reachable. In a mutli component setup you can use the loadbalancer URL.
    smsgateway = http://127.0.0.1:7777
  • priority The priority SMS are send with.
    priority = 1

procmail3.py

This is the Python script you are pointing to from the procmailrc filter. Basically you not need to change anything here.