Skip to main content

POP3 Email Data Source

The POP3 Email data source connects to a POP3 email inbox and extracts data values from incoming messages using regular expressions. It processes each message individually, applies regex patterns to locate point values within the email content, and deletes messages after processing. This is a polling data source that checks the inbox at a configurable interval.

This data source is useful for integrating with systems that send status reports, alerts, or measurement data via email -- for example, remote monitoring devices that email periodic status updates, alarm notification systems, or field equipment that transmits readings through cellular email gateways.

Overview

PropertyValue
ModulemangoAutomation-Pop3
ProtocolPOP3
DirectionPolling
Typical UseExtracting data from email messages

Prerequisites

  • A POP3 email account dedicated to receiving data messages. Because messages are deleted after processing, do not use a personal or shared inbox.
  • The POP3 server address (hostname or IP) and credentials (username and password) for the mailbox.
  • Network connectivity from the Mango server to the POP3 server on port 110 (standard POP3).
  • Knowledge of the email content format so you can write regular expressions to extract the desired values.

Configuration

Data Source Settings

SettingDescription
NameA descriptive name for the data source.
Inbox check periodHow frequently Mango connects to the POP3 mailbox and processes new messages.
POP3 serverThe domain name or IP address of the POP3 mail server. The standard POP3 port (110) is used for connections.
Inbox usernameThe email account username for authentication.
Inbox passwordThe email account password for authentication.
Test contentA text area where sample email content can be pasted to test data point regex patterns without waiting for actual messages.
important

Messages are deleted from the mailbox after processing. Use a dedicated email account for this data source. Do not point it at an inbox where you want to retain messages.

Data Point Configuration

Each data point uses a regular expression to find its value within the email body content.

SettingDescription
Data typeThe Mango data type (Binary, Multistate, Numeric, or Alphanumeric). The extracted text is converted to this type.
Value RegExA regular expression that locates the point value in the email content. Only the first match found in the content is used. See the Regular Expressions documentation for syntax details.
Ignore if missingWhen checked, a missing value in the email content is silently ignored (the point is not updated). When unchecked, a missing value raises a data source exception event.

Binary Points

SettingDescription
Binary 0 valueThe text value that maps to binary 0 (false). If the regex match equals this value, the point is set to 0. Any other value sets the point to 1.

Numeric Points

SettingDescription
Number format(Optional) A format pattern that describes how the text value should be parsed as a number. Useful when numbers contain locale-specific formatting (e.g., commas as decimal separators). See the Number Formats documentation for syntax.

Timestamp Extraction

SettingDescription
Time RegEx(Optional) A regular expression that locates a timestamp in the email content.
Time format(Required if Time RegEx is set) A date/time format pattern for parsing the matched timestamp text.

When a Time RegEx is configured, the extracted timestamp is used as the point value's time instead of the processing time.

Testing Regular Expressions

You can test regex patterns before receiving actual messages:

  1. Paste sample email content into the Test content area in the data source editor.
  2. On each data point, click the test icon to execute the regex against the test content.
  3. The extracted value (and timestamp, if configured) is displayed for verification.

Common Patterns

Remote Equipment Status Reports

Many remote monitoring devices send periodic email reports containing equipment status and measurements. For example, an email body might contain:

Station: Alpha-7
Temperature: 72.5F
Humidity: 45%
Battery: 12.6V
Status: ONLINE
Timestamp: 2026-02-16 14:30:00

Configure points with regex patterns like:

PointValue RegExData Type
TemperatureTemperature:\s+([\d.]+)Numeric
HumidityHumidity:\s+(\d+)Numeric
BatteryBattery:\s+([\d.]+)Numeric
StatusStatus:\s+(\w+)Alphanumeric

Use a Time RegEx of Timestamp:\s+(.+) with a Time format of yyyy-MM-dd HH:mm:ss to associate the correct timestamp with each value.

Alarm Notification Parsing

Parse incoming alarm emails from a third-party system to create data points that track alarm states. For example, an email with "ALARM ACTIVATED: Zone 3 Fire Detector" could use a regex to extract the zone and alarm type, updating the appropriate Mango points.

Cellular Gateway Data

Field devices without network connectivity can send measurements via cellular SMS-to-email gateways. Configure the POP3 data source to poll the email account that receives these messages. The email content is typically a short text string that can be parsed with simple regex patterns.

Multi-Value Messages

When a single email contains multiple data values, create separate data points with different regex patterns, each targeting a specific value in the message body. All points process every incoming message, so each point extracts only the value it is looking for.

Troubleshooting

Connection Failures

  1. Verify the POP3 server hostname or IP is correct and reachable from the Mango server.
  2. Confirm port 110 is not blocked by a firewall.
  3. Check that the username and password are correct. Some email providers require app-specific passwords when two-factor authentication is enabled.
  4. Some email providers have deprecated POP3 access. Verify that POP3 is enabled on the mailbox.

No Values Extracted

  1. Regex does not match -- test the regex against the actual email content (paste it into the Test content area). Common issues include unescaped special characters (., (, )), missing capture groups, or regex that does not account for extra whitespace or line breaks in the email.
  2. Wrong capture group -- the regex must include parenthesized capture groups. The first capture group (group 1) is used as the value. If the regex has no capture group, the entire match is used, which may include unwanted surrounding text.
  3. Ignore if missing is checked -- when enabled, missing values are silently skipped. Temporarily uncheck this to see if exception events are raised.

Values Are Wrong

  1. Number format issues -- if the extracted text includes currency symbols, percentage signs, or locale-specific formatting (e.g., 1.234,56 for European decimals), configure the Number format pattern to parse correctly.
  2. Multiple matches -- only the first regex match in the email content is used. If the email contains multiple instances of the pattern, ensure the regex is specific enough to match the correct one first.

Messages Not Being Deleted

  1. If messages remain in the inbox after processing, there may be a POP3 protocol issue. Some servers require an explicit QUIT command to commit deletions. Check the Mango logs for POP3-related errors.
  2. Ensure the email account credentials have full access (read and delete permissions).

Timestamp Parsing Errors

  1. Verify the Time format pattern matches the exact format of the timestamp in the email content. Use the Test content feature to validate.
  2. Common format pattern errors include using MM (month) where mm (minutes) is needed, or omitting the timezone indicator when the timestamp includes one.