Skip to content

Commit

Permalink
Duplicate resolutions (#2)
Browse files Browse the repository at this point in the history
* getting codecov to work

* more futzing with codecov

* suppress duplicate actions
  • Loading branch information
msimerson authored Oct 2, 2016
1 parent d36d28d commit 24bae00
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,74 @@
extracts matching log entries from haraka log files


# Install


````
npm install -g haraka-plugin-log-reader
````


## Enable

Add `haraka-plugin-log-reader` to your Haraka `config/plugins` file.


# Usage

When enabled, this plugin registers two URL routes in Haraka's http server:

* karma/rules
* /logs/:uuid

The former rule simply returns a list of the Haraka rules in use. The http client uses those rules (the ID, reason, and value) to display the `Policy Rules` and `Steps to Resolve` sections in the web page.

# Example


### Sorry we blocked your message:

Our filters mistook your server for a malicious computer attempting to send spam. To improve your mail servers reputation, please contact your IT helpdesk or Systems Administrator and ask them for help.

----------

### Policy Rules

* -7, DNS Blacklist (b.barracudacentral.org)
* -5, DNS Blacklist (zen.spamhaus.org)
* -3, DNS Blacklist (dnsbl-1.uceprotect.net)
* -3, DNS Blacklist (bl.spamcop.net)
* -3, ASN reputation is spam-only (asn_all_bad)
* -1, Geographic distance is unusual for ham (4000)
* -1, Geographic distance is unusual for ham (8000)
* -1, ASN reputation is bad (karma)

----------

### Steps to Resolve

* Disinfect your host/network

----------

## Raw Logs

4D0B74C5-6D41-4074-9E43-5EE9CC1B4973

<html><pre>
[NOTICE] [core] connect ip=95.160.74.108 port=39005 local_ip=172.16.15.9 local_port=25
[INFO] [connect.p0f] os="Linux 2.4.x-2.6.x" link_type="Ethernet or modem" distance=7 total_conn=1
[INFO] [connect.fcrdns] ip=95.160.74.108 rdns="095160074108.gdansk.vectranet.pl" rdns_len=1 fcrdns="095160074108.gdansk.vectranet.pl" fcrdns_len=1 other_ips_len=0 invalid_tlds=0 generic_rdns=true
[INFO] [connect.asn] asn: 29314, org: Al. Zwyciestwa 253, 81-525 Gdynia, Poland
[INFO] [connect.geoip] EU, PL, Gdansk, 82, 8506km
[INFO] [dnsbl] fail:dnsbl-1.uceprotect.net, bl.spamcop.net, b.barracudacentral.org, zen.spamhaus.org, dnsbl.sorbs.net
[INFO] [connect.asn] asn: 29314, org: Al. Zwyciestwa 253, 81-525 Gdynia, Poland, asn_score: -4364, asn_connections: 4367, asn_good: 0, asn_bad: 4364, fail:karma, asn_all_bad
[INFO] [limit] no IP history from : karma
[INFO] [karma] score: -24, awards: 001,002,115,114,111,116,021,023
[NOTICE] [core] disconnect ip=95.160.74.108 rdns="095160074108.gdansk.vectranet.pl" helo="" relay=N early=N esmtp=N tls=N pipe=N errors=0 txns=0 rcpts=0/0/0 msgs=0/0/0 bytes=0 lr="" time=12.752
</pre></html>


[ci-img]: https://travis-ci.org/haraka/haraka-plugin-log-reader.svg
[ci-url]: https://travis-ci.org/haraka/haraka-plugin-log-reader
[cov-img]: https://codecov.io/github/haraka/haraka-plugin-log-reader/coverage.svg
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ function getResolutions (awardNums) {
});

var listItems = [];
var resolutionSeen = {};
awards.sort(sortByAward).forEach(function (a) {
if (!a.resolution) return;
if (resolutionSeen[a.resolution]) return;
listItems.push('<li>' + a.resolution + '</li>');
});
return listItems;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "haraka-plugin-log-reader",
"version": "1.0.0",
"description": "extract log entries from haraka log files",
"version": "1.0.1",
"description": "display log entries from haraka log files via HTTP",
"main": "index.js",
"scripts": {
"test": "mocha",
Expand Down

0 comments on commit 24bae00

Please sign in to comment.