Introduction
This article explains how to feed your MTA’s inbound SMTP transaction data in real-time to Abusix, which helps improve the accuracy of our Guardian Mail product. This protocol only applies to the third wizard set-up option, “Send transaction feeds” in app.abusix.com.SMTP Transaction Data
The data we request is simple to retrieve from most MTAs and, by design, does not include any data that would cause any privacy issues. Data for each SMTP_ transaction,_ created on every SMTP MAIL command, is what is requested. Ideally, this data should be sent immediately after receiving the MAIL command, provided it is only sent once per transaction. The protocol is designed as fire-and-forget UDP to minimize overhead on your mail system.Format
Each data field must be separated by a line-feed character (LF \n) without a trailing line-feed, and all data must be sent in a single UDP packet. While all fields are required, they may also be empty if the data is unavailable. The feed receiver will discard data where (a) there are not enough line feeds, (b) the Feed ID is not recognized, or (c) the checksum does not match the checksum we compute on reception. Since this is fire-and-forget UDP, there needs to be feedback on whether the data being sent is valid and in the correct order or any acknowledgment that the data was received.
Example
Here is an example of the data showing each field and the format. Line feeds are shown as ”\n” for illustration purposes:
Transport
After completing all the Data Channel configuration steps in app.abusix.com, you can send us the data. First, verify connectivity by running the following command:Example Code
We provide example code for Exim and a fully functioning Postfix Policy daemon, written in Node.js, which can be used with any version of Postfix. These examples may also be used to write an integration with any MTA in any programming language.Exim
Each distro package in Exim is different, so you will likely need to customize this appropriately for your installation. This is what I did on Debian/Ubuntu Linux. In/etc/exim4/conf.d/acl/00_exim4-config-header – I added the following lines to the top (as macros); these must appear before the “begin acl” directive:
ABUSIX_HOST=smtp-rttf.abusix.com
ABUSIX_PORT=12211
ABUSIX_FEED_ID=<Your Feed ID>
ABUSIX_FEED_KEY=<Your Feed Key>
Then in 30_exim4_config_check_mail we want the “udpsend” to run for every message, accepted or not: