connection: check for transaction before attempts to access objects in it

so Haraka doesn't crash
Merge pull request #549 from msimerson/connection

connection: check for transaction before attempts to access objects in i...
smtp_proxy: bug fix, defines an undefined variable
Merge pull request #550 from msimerson/smtpproxy

smtp_proxy: bug fix, defines an undefined variable
Prevent duplicate newlines in bounce message
Fix example and prevent leak FDs
Increase the default open file limit in Upstart script
Fix date format on bounce messages
Fix timeout when processing mail
Merge branch 'master' of github.com:baudehlo/Haraka
karma: config file auth-refresh, cached in plugin.cfg
karma: collect awards during reset_transaction

(before they disappear)
karma: karma.ini adjustments,

helo.checks scores on specific tests now rather than counting pass/fails. Duplicates aren't scored in helo.checks any more, making this more robust.

increase karma value of successful auth

penalize SPF result=None a little less (-1 was -2)
karma: adding tests, 'remember tarpit' across connects

move global 'var db' to plugin.db

move deny_hooks from register() to karma_init(), so it gets refreshed if karma.ini is reloaded

refactored apply_tarpit out of should_we_deny (testability)

on new connect, apply tarpit value from last connection, slowing down abusers who rapidly reconnect

refactored max_concurrent and karma_penalty out of hook_connection (simpler code, easier to test)
karma: docs, tests, spit & polish

moved tarpit into karma (instead of depending on tarpit plugin)

adaptive connection delays based on score and IP/ASN history

added punish, with a higher threshold for penalty box

[penalty]hooks -> [deny]hooks
	penalty always rejects at connect
	[deny]hooks affects when a poor quality connection is rejected

moved penalties for invalid rfc5321.MailFrom/RcptTo to karma.ini (was hard coded in karma.js)

significant documentation updates

69 tests now.
karma: make sure that pesky transaction exists before checking properties of it
net_utils: s/stun/vs-stun/

vs-stun:
  works with current versions of node.js
  has a nicer API
  provides more net topology data (we don't need it, but nice to have)
package.json: s/stun/vs-stun/, added redis as optional dep
karma: be less punitive to roaming users
karma: add comments describing how penalty settings are used