You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updates to the abuse downloader code adding in matching up with mailbaby users and mail ids .. and added a new script to match the existing data as well
$db->query("select abuse.*, abuse_plainmsg from abuse left join abuse_data using (abuse_id) where abuse_ip in ('".implode("','",$ips)."') and (abuse_plainmsg like '%Authenticated sender: %' or abuse_plainmsg like '%smtp.auth=%');");
17
+
while ($db->next_record(MYSQL_ASSOC)) {
18
+
$mbUser = null;
19
+
$mbId = null;
20
+
if (preg_match_all('/Authenticated sender: (?P<user>[^\)]*)\)/ms', $db->Record['abuse_plainmsg'], $matches) ||
echo'Abuse ID '.$db->Record['abuse_id'].' found MailBaby user '.$mbUser.PHP_EOL;
26
+
}
27
+
}
28
+
}
29
+
if (preg_match_all('/^ by (\S+|\S+ \(\S+\)) with (LMP|SMTP|ESMTP|ESMTPA|ESMTPS|ESMTPSA|HTTP) id (\S+)\.(\d{3})\s*$/mU', $db->Record['abuse_plainmsg'], $matches)) {
30
+
$ids = $matches[3];
31
+
foreach ($idsas$id) {
32
+
$mb_db->query("select * from mail_messagestore where id='{$id}'");
33
+
if ($mb_db->num_rows() > 0) {
34
+
$mb_db->next_record(MYSQL_ASSOC);
35
+
$mbId = $id;
36
+
$mbUser = $mb_db->Record['user'];
37
+
echo'Abuse ID '.$db->Record['abuse_id'].' found MailBaby mail id '.$mbId.' user '.$mbUser.PHP_EOL;
38
+
}
39
+
}
40
+
}
41
+
$updates = [];
42
+
if (!is_null($mbUser))
43
+
$updates[] = "abuse_mb_user='{$mbUser}'";
44
+
if (!is_null($mbId))
45
+
$updates[] = "abuse_mb_id='{$mbId}'";
46
+
if (count($updates) > 0) {
47
+
$db2->query("update abuse set ".implode(', ', $updates)." where abuse_id='{$db->Record['abuse_id']}'");
0 commit comments