Git Product home page Git Product logo

haraka-plugin-watch's Introduction

watch

Build Status Code Climate NPM

Watch live SMTP traffic in a web interface.

Watch Screen Capture

Enable Watch

  1. Enable Haraka's HTTP server (see listen in http.ini)
  2. Add 'watch' to config/plugins
  3. Point your web browser at http://mail.your-domain.com/watch/

Enjoy the blinky lights.

Tips

  • Hover your mouse pointer or tap (with touch devices) on table data to see more details.
  • Copy that connection UUID at left and use it to grep your logs for even more.
  • Edit the files in watch/html and play with the appearance. If you make it better, post a screen shot somewhere and create an Issue or PR.

Interpretation Key

  • Green: tests passed
  • Light Green: tests passed, but with conditions
  • Yellow: poor results, but not awful.
  • Light red: tests failed, but no rejection
  • Red: tests failed causing rejection

Config

Config options are set in watch.ini.

  • sampling: boolean, limit display connections to one-per-second
  • wss.url: specify the WSS url (default: same scheme, host, port as http)
  • wss.htdocs: an alternate docroot (default ./html)

Troubleshooting

  • If you aren't getting activity, make sure your web browser is able to establish the websockets connection. Either use straight http (only) or have a valid signed TLS certificate. The security for websockets connections is more strict than plain HTTP(s).
  • Additional info:

haraka-plugin-watch's People

Contributors

greenkeeper[bot] avatar msimerson avatar smfreegard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

haraka-plugin-watch's Issues

Haraka, plugin watch not working

system info

Haraka Haraka.js β€” Version: 2.8.18
Node v8.11.1
OS Linux smtp-nestor.v7digital.net 3.10.0-693.21.1.el7.x86_64 haraka/Haraka#1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
openssl OpenSSL 1.0.2k-fips 26 Jan 2017

Running on CentOS 7.x

Expected behavior

No error message on the Watch web page.

Observed behavior

I can access the watch web page but there are not data.

When I let it go for a while, The "Monitor" becomes RED and I get the following on the top right.
[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined[object Event], undefined

watch plugin is enabled in config/plugins
redis plugin is enabled and point to local redis-server
When I check for the existing keys in Redis, I only see karma entries

prompt->redis-cli --scan --pattern '*'
karma|209.171.113.253
karma|185.35.63.177

In the logs, when restarting haraka, there's only two entries connecting to redis
[INFO] [-] [limit] connected to redis://127.0.0.1:6379/4 v3.2.10
[INFO] [-] [redis] connected to redis://127.0.0.1:6379 v3.2.10

As the documentation is pretty thin on set up, I'm opening this ticket if someone can help me out.

Regards,
Sylvain

Issues running under AWS ELB

Ideally I would like my http traffic to go over port 80, and the websocket traffic to port 443 so I can use AWS ELB tcp protocol which supports websockets.

An in-range update of haraka-test-fixtures is breaking the build 🚨

Version 1.0.11 of haraka-test-fixtures just got published.

Branch Build failing 🚨
Dependency haraka-test-fixtures
Current Version 1.0.10
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As haraka-test-fixtures is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 3 commits (ahead by 3, behind by 2).

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Plugin crashes when otbound stages hooks return DENY

I have constant crashes of this plugin when my get_mx or send_mail hooks return DENY. Here is some stacktrace from logs:

[INFO] [EF0D4FA1-861A-41C5-8098-20DE66E2B08A.1.1] [outbound]  hook=get_mx plugin=check_email_exists function=deny_email params=outlook.com retval=DENY msg="Filtered out"
[CRIT] [EF0D4FA1-861A-41C5-8098-20DE66E2B08A.1.1] [outbound] Plugin watch failed: TypeError: Cannot read property 'host' of undefined
    at get_remote_host (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:658:33)
    at Plugin.exports.w_deny (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:118:19)
    at Object.plugins.run_next_hook (/usr/local/lib/node_modules/Haraka/plugins.js:535:28)
    at Object.plugins.run_hooks (/usr/local/lib/node_modules/Haraka/plugins.js:449:13)
    at callback (/usr/local/lib/node_modules/Haraka/plugins.js:505:21)
    at Plugin.exports.deny_email (/etc/haraka/plugins/check_email_exists.js:137:11)
    at Object.plugins.run_next_hook (/usr/local/lib/node_modules/Haraka/plugins.js:535:28)
    at Object.plugins.run_hooks (/usr/local/lib/node_modules/Haraka/plugins.js:449:13)
    at HMailItem.get_mx (/usr/local/lib/node_modules/Haraka/outbound/hmail.js:195:17)
    at HMailItem.send_email_respond (/usr/local/lib/node_modules/Haraka/outbound/hmail.js:189:18)

I've tried to swap the plugins order, but it has changed nothing.

Watch not working. Getting 404 on wss_conf from client.js

Hello,

I'm getting the following in developer tools when running watch.

client.js:172

GET http://mydomain.com:82/watch/wss_conf 404 (Not Found)

jquery-3.7.1.min.js:2 jQuery.Deferred exception: Unexpected token '<', ")
at httpGetJSON (http://mydomain.com:82/watch/client.js:173:15)
at ws_connect (http://mydomain.com:82/watch/client.js:183:18)
at HTMLDocument. (http://mydomain.com:82/watch/:31:3)
at e (http://code.jquery.com/jquery-3.7.1.min.js:2:27028)
at t (http://code.jquery.com/jquery-3.7.1.min.js:2:27330)

jquery-3.7.1.min.js:2 Uncaught SyntaxError: Unexpected token '<', ")
at httpGetJSON (client.js:173:15)
at ws_connect (client.js:183:18)
at HTMLDocument. (watch/:31:3)
at e (jquery-3.7.1.min.js:2:27028)

What is wss_conf and what is supposed to be in this file?

Email with 50MB attachment causes haraka to shutdown or crash

Sent an email from one server to an email account on haraka MX server. It caused haraka to shutdown or crash.

Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] TypeError: Cannot create property 'pass' on string 'read ECONNRESET'
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at Plugin.exports.get_class (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:539:23)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at Plugin.exports.format_any (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:447:20)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at RedisClient.plugin.redis.on (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:258:16)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at emitThree (events.js:116:13)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at RedisClient.emit (events.js:197:7)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at return_pub_sub (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:789:18)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at RedisClient.return_reply (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:828:9)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at JavascriptRedisParser.returnReply (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:192:18)
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at JavascriptRedisParser.execute (/usr/local/lib/node_modules/Haraka/node_modules/redis-parser/lib/parser.js:574:12)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] TypeError: Cannot create property 'pass' on string 'read ECONNRESET'
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at Plugin.exports.get_class (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:539:23)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at Plugin.exports.format_any (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:447:20)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at RedisClient.plugin.redis.on (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:258:16)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at emitThree (events.js:116:13)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at RedisClient.emit (events.js:197:7)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at return_pub_sub (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:789:18)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at RedisClient.return_reply (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:828:9)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at JavascriptRedisParser.returnReply (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:192:18)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at JavascriptRedisParser.execute (/usr/local/lib/node_modules/Haraka/node_modules/redis-parser/lib/parser.js:574:12)
Jun 8 06:28:36 haraka haraka[45476]: [CRIT] [-] [core] at Socket. (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:274:27)
Jun 8 06:28:36 haraka haraka[45476]: [ERROR] [-] [core] client.socket.remoteAddress undefined!
Jun 8 06:28:36 haraka haraka[45476]: [NOTICE] [-] [core] Shutting down
Jun 8 06:28:36 haraka haraka[45477]: [CRIT] [-] [core] at Socket. (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:274:27)
Jun 8 06:28:36 haraka haraka[45477]: [NOTICE] [-] [core] Shutting down
Jun 8 06:28:39 haraka haraka[45237]: [CRIT] [-] [core] TypeError: Cannot create property 'pass' on string 'read ECONNRESET'
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at Plugin.exports.get_class (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:539:23)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at RedisClient.emit (events.js:197:7)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at return_pub_sub (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:789:18)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at RedisClient.return_reply (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:828:9)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at JavascriptRedisParser.returnReply (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:192:18)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at JavascriptRedisParser.execute (/usr/local/lib/node_modules/Haraka/node_modules/redis-parser/lib/parser.js:574:12)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at Socket. (/usr/local/lib/node_modules/Haraka/node_modules/redis/index.js:274:27)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at RedisClient.plugin.redis.on (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:258:16)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at emitThree (events.js:116:13)
Jun 8 06:28:40 haraka haraka[45237]: [CRIT] [-] [core] at Plugin.exports.format_any (/usr/local/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:447:20)
Jun 8 06:28:40 haraka haraka[45237]: [NOTICE] [-] [core] Shutting down

Enable Haraka's HTTP server (see listen in http.ini)

I don't know how to enable that http server.
These are what i did:
npm install -g express.js
add listen=[::0] in config/http.ini file
add watch in config/plugins file
start haraka and i got this errors:

$ sudo haraka -c .
loaded TLD files: 1=1508 2=8565 3=2448
loaded 8995 Public Suffixes
loglevel: INFO
log format: DEFAULT
loglevel: LOGINFO
Starting up Haraka version 2.8.26
[INFO] [-] [core] Loading plugins
[INFO] [-] [core] Loading plugin: dnsbl
[INFO] [-] [core] Loading plugin: helo.checks
[INFO] [-] [core] Loading plugin: tls
[INFO] [-] [core] loading tls.ini
[INFO] [-] [core] Loading plugin: auth/flat_file
[INFO] [-] [core] Loading plugin: mail_from.is_resolvable
[INFO] [-] [core] Loading plugin: rcpt_to.in_host_list
[INFO] [-] [core] Loading plugin: headers
[INFO] [-] [core] Loading plugin: dkim_sign
[INFO] [-] [core] Loading plugin: watch
[NOTICE] [-] [core] Listening on [::0]:587
[INFO] [-] [core] [outbound] Loading outbound queue from /home/ubuntu/hoshi/haraka/queue
[INFO] [-] [core] express loaded at Server.http.express
[INFO] [-] [core] express app is at Server.http.app
[NOTICE] [-] [core] Listening on [::0]:8080
[INFO] [-] [watch] watch init_http done
[INFO] [-] [core] init_http_respond
[INFO] [-] [core] Server.http.wss loaded
[INFO] [-] [watch] watch init_wss
[INFO] [-] [watch] watch init_wss done
[INFO] [-] [core] init_wss_respond
[INFO] [-] [core] using html docroot: /home/ubuntu/hoshi/haraka/html
[INFO] [-] [core] [outbound] Loading the queue...
[INFO] [-] [core] [outbound] [pid: undefined] 0 files in my delivery queue
[INFO] [-] [core] [outbound] [pid: undefined] 0 files in my load queue
[INFO] [-] [core] [outbound] [pid: undefined] 0 files in my temp fail queue
[ERROR] [-] [server] watch plugin ran callback multiple times - ignoring subsequent calls
[ERROR] [-] [server] Error
at callback (/usr/lib/node_modules/Haraka/plugins.js:484:34)
at /usr/lib/node_modules/Haraka/node_modules/haraka-plugin-watch/index.js:273:5
at RedisClient. (/usr/lib/node_modules/Haraka/node_modules/haraka-plugin-redis/index.js:179:13)
at RedisClient.emit (events.js:315:20)
at RedisClient.on_error (/usr/lib/node_modules/Haraka/node_modules/redis/index.js:341:14)
at Socket. (/usr/lib/node_modules/Haraka/node_modules/redis/index.js:222:14)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[ERROR] [-] [server] watch plugin ran callback multiple times - ignoring subsequent calls
[ERROR] [-] [server] Error
at callback (/usr/lib/node_modules/Haraka/plugins.js:484:34)
....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.