darold / sendmailanalyzer

Sendmail log Analyzer is a tool to monitor sendmail usage and generate HTML and graph reports. It reports all you ever wanted to know about email trafic on your network. You can also use it in ISP environment with per domain and per mailbox report.
http://sendmailanalyzer.darold.net/
GNU General Public License v3.0
76 stars 13 forks source link

fix parsing barracuda rbl #65

Closed biji closed 5 years ago

biji commented 5 years ago

fix parsing: Client host [1.1.1.1] blocked using b.barracudacentral.org; Client host blocked using Barracuda Reputation, see http://www.barracudanetworks.com/reputation/?r=1&ip=1.1.1.1

darold commented 5 years ago

Thanks for this PR. I think it can not be applied like that, the fix works for this kind of lines but can break others if there is no ;. You can fix it using the following regexp that might handle all cases.

$reject =~ /(?:client|helo) .* (blocked using [^;]+)/i

Regards,

biji commented 5 years ago

$reject =~ /(?:client|helo) .* (blocked using [^;]+)/i

Does not work: image

I haven't found better regex yet: link

darold commented 5 years ago

Sorry I've not taken care that there is two occurrences of blocked using, in this case this might work:

$reject =~ /(?:client|helo) (?:.*?) (blocked using [^;]+)/i
biji commented 5 years ago

tested and it works :+1:

darold commented 5 years ago

Thanks!