Skip to content

Commit 34d9cb3

Browse files
Zainullin DamirZainullin Damir
authored andcommitted
Process plugins - Introduce SMTP process plugin
1 parent 30050aa commit 34d9cb3

File tree

9 files changed

+611
-470
lines changed

9 files changed

+611
-470
lines changed

src/plugins/process/smtp/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@ project(ipfixprobe-process-smtp VERSION 1.0.0 DESCRIPTION "ipfixprobe-process-sm
33
add_library(ipfixprobe-process-smtp MODULE
44
src/smtp.cpp
55
src/smtp.hpp
6+
src/smtpContext.hpp
7+
src/smtpFields.hpp
8+
src/smtpCommand.hpp
9+
src/smtpStatusCode.hpp
610
)
711

812
set_target_properties(ipfixprobe-process-smtp PROPERTIES
913
CXX_VISIBILITY_PRESET hidden
1014
VISIBILITY_INLINES_HIDDEN YES
1115
)
1216

13-
target_include_directories(ipfixprobe-process-smtp PRIVATE
17+
target_include_directories(ipfixprobe-process-smtp PRIVATE
1418
${CMAKE_SOURCE_DIR}/include/
19+
${CMAKE_SOURCE_DIR}/include/ipfixprobe/processPlugin
20+
${CMAKE_SOURCE_DIR}/include/ipfixprobe/pluginFactory
1521
${CMAKE_SOURCE_DIR}/src/plugins/process/common
22+
${adaptmon_SOURCE_DIR}/lib/include/public/
1623
)
1724

1825
if(ENABLE_NEMEA)

src/plugins/process/smtp/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SMTP Plugin
2+
3+
The **SMTP Plugin** parses SMTP data and exports relevant fields.
4+
5+
## Features
6+
7+
- Decision about the communication direction is made based on the SMTP port (25).
8+
9+
## Output Fields
10+
11+
| Field Name | Data Type | Description |
12+
| -------------------------- | ---------- | -------------------------------------------------- |
13+
| `SMTP_2XX_STAT_CODE_COUNT` | `uint32_t` | Count of SMTP status codes between 200 and 300 |
14+
| `SMTP_3XX_STAT_CODE_COUNT` | `uint32_t` | Count of SMTP status codes between 300 and 400 |
15+
| `SMTP_4XX_STAT_CODE_COUNT` | `uint32_t` | Count of SMTP status codes between 400 and 500 |
16+
| `SMTP_5XX_STAT_CODE_COUNT` | `uint32_t` | Count of SMTP status codes between 500 and 600 |
17+
| `SMTP_COMMAND_FLAGS` | `uint32_t` | Cumulative representing the SMTP commands used |
18+
| `SMTP_MAIL_CMD_COUNT` | `uint32_t` | Count of MAIL commands received |
19+
| `SMTP_RCPT_CMD_COUNT` | `uint32_t` | Count of RCPT commands received |
20+
| `SMTP_STAT_CODE_FLAGS` | `uint32_t` | Cumulative representing observed SMTP status codes |
21+
| `SMTP_DOMAIN` | `string` | Domain of the SMTP session |
22+
| `SMTP_FIRST_RECIPIENT` | `string` | First recipient of the SMTP session |
23+
| `SMTP_FIRST_SENDER` | `string` | First sender of the SMTP session |
24+
25+
## Usage
26+
27+
### YAML Configuration
28+
29+
Add the plugin to your ipfixprobe YAML configuration:
30+
31+
```yaml
32+
process_plugins:
33+
- smtp
34+
```
35+
36+
### CLI Usage
37+
38+
You can also enable the plugin directly from the command line:
39+
40+
`ipfixprobe -p smtp ...`

0 commit comments

Comments
 (0)