What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

Can I analyze multipart emails using the IMAP sensor?



Your Vote:



With the IMAP sensor, I can check the content of emails for certain keywords. Does this work with multipart emails, too?

email imap-sensor keyword mime-format multipart prtg

Created on Mar 4, 2015 8:06:34 AM by  Martina Wittmann [Paessler Support]

Last change on Nov 4, 2019 10:33:50 AM by  Brandy Greger [Paessler Support]

1 Reply

Accepted Answer



Your Vote:



This article applies to PRTG Network Monitor 19 or later

Checking content of multipart emails with the IMAP sensor

The internet standard Multipurpose Internet Mail Extensions (MIME), an extension of the original Simple Mail Transfer Protocol (SMTP), allows the transmission of messages containing a multipart body.

A multipart email is recognized as one if the content type indication contains the word “multipart”. There are different types of multipart messages, for example multipart/digest, multipart/mixed, multipart/parallel, multipart/related or multipart/alternative. The different parts of a multipart message are typically delimited by long, random character strings called "boundaries".

A multipart/alternative email, for example, contains the same information coded in different ways in its alternative parts.

It can look like this (we surrounded our comments with ### to help you better find your way through this multipart email):

Content-Type: multipart/alternative;

###Boundary Identifier of the Multipart Email###

###Alternative 1 of Boundary x-x-x-x-891c660d3750###

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

=0D=0AUhrzeit: Today at 04:28 , Successful Offsite Copy auralisSt=
B , Copied 178,7 MB (compressed to 17,64 MB) for 4 files. (Durati=
on: 1 minute),=0D=0A=0D=0A=0D=0A

###Alternative 2 of Boundary x-x-x-x-891c660d3750###

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Today at 04:28: (auralisStB) Successful Offsite Copy - Copied 178=
,7 MB (compressed to 17,64 MB) for 4 files. (Duration: 1 minute)=0D=0A=

###Alternative 3 of Boundary x-x-x-x-891c660d3750###

Content-Type: multipart/related; type="text/html";


Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64



###End of Boundary x-x-x-x-891c660d3750###

Additionally, the content or text types are indicated, like text/plain, text/html or image/png.

The IMAP sensor can scan the different parts of a multipart email for a certain keyword. You just have to add this sensor type to a device that represents your mailbox in PRTG and the sensor checks all incoming emails, also multipart messages. For example, you can define in the sensor settings that the sensor searches for the string “Backup succeeded” in emails from certain backup services in your network. This way, you can monitor if your backups succeeded the night before.

Note: At least one part in your multipart email has to be encoded quoted-printable so that the keyword string search can be successfully completed. If you want the IMAP sensor to look for the string “Backup succeeded” in a base64-encoded multipart, it will not be able to find it, because it will look like this: QmFja3VwIHN1Y2NlZWRlZA==.

Note: If your emails contain an HTML body, it can be convenient to use regular expressions when searching for keywords. See My IMAP sensor does not process HTML emails correctly using regex. What can I do?.

Created on Mar 4, 2015 8:24:33 AM by  Martina Wittmann [Paessler Support]

Last change on Dec 4, 2020 1:32:42 PM by  Brandy Greger [Paessler Support]

Please log in or register to enter your reply.

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.