Get SMTP Content in Flow

The following example extracts SMTP content from a flow.

function Flow_GetSmtpContentInFlow (dpiMessage, ruleEngine)

require 'LOG'

local my_application = GetLatestApplication(dpiMessage)

if my_application == 'smtp' then

local smtp_content = GetSmtpContent(dpiMessage)

if smtp_content ~= nil and smtp_content ~= '' then

-- smtp_content contains data from the SMTP flow.

else

EZINFO('Empty SMTP content')

end

end

end