Reworked email metaata extraction

This commit is contained in:
Luca Deri
2019-10-21 01:27:07 +02:00
parent 58daa5ed7d
commit 960aa77b6d
8 changed files with 250 additions and 105 deletions
+5 -5
View File
@@ -175,8 +175,8 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
if(column) {
column[0] = '\0';
snprintf(flow->protos.imap.username,
sizeof(flow->protos.imap.username),
snprintf(flow->protos.ftp_imap_pop_smtp.username,
sizeof(flow->protos.ftp_imap_pop_smtp.username),
"%s", item);
column = strchr(&column[1], '"');
@@ -186,8 +186,8 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
if(column) {
column[0] = '\0';
snprintf(flow->protos.imap.password,
sizeof(flow->protos.imap.password),
snprintf(flow->protos.ftp_imap_pop_smtp.password,
sizeof(flow->protos.ftp_imap_pop_smtp.password),
"%s", item);
}
}
@@ -319,7 +319,7 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|| (flow->l4.tcp.mail_imap_stage == 5)
|| (flow->l4.tcp.mail_imap_stage == 7)
) {
if((flow->protos.imap.username[0] != '\0')
if((flow->protos.ftp_imap_pop_smtp.username[0] != '\0')
|| (flow->l4.tcp.mail_imap_stage >= 7)) {
NDPI_LOG_INFO(ndpi_struct, "found MAIL_IMAP\n");
ndpi_int_mail_imap_add_connection(ndpi_struct, flow);