Mailping
========

monitor email service availability _and_ functioning.

Please read the man pages mailping-cron(1) and mailping-store(1) for
real documentation. This file is just a random collection of notes,
for now.


Overview of files
-----------------

configdir:
	from
	to
	(admin)

	interval

	warntime
	failtime
	warnlatency
	faillatency

statedir:
	pending/
	incoming/{tmp,cur,new}
	broken/{tmp,cur,new}	# valid-looking messages without
				# corresponding pendings go here
	junk/{tmp,cur,new}	# invalid messages go here
	success


Rough overview of the internal processing
-----------------------------------------

- for incoming mail
	- parse mail to find identifier
		- if no identifier, move message to junk/
		- if got identifier, find matching entry in pending/
			- if not found, move message to broken/
			- if found
				- if getTime(pending/$THIS) > getTime(success)
					- then rename to "success"
					- else remove

- if max(getTime("success"), getTime("pending/*")) + interval < time:
	- send new probe
	- create pending/$THIS


Installation instructions for non-Debian
----------------------------------------

These steps are only needed if you are not using Debian. For Debian
users, these have been taken care of by the maintainer scripts.

Install the software with the usual python distutils stuff, run
"python setup.py install" as root.

Arrange for mailping-cron to be run from cron regularly. It must have
write access to statedir -- I suggest you create a user "mailping"
with homedir /var/lib/mailping (owned by root:root), and make mailping
own /var/lib/mailping/state.

Arrange for email to e.g. mailping+FOO@something to be delivered to
/var/lib/mailping/state/FOO/incoming/. If you created the user above,
just create /var/lib/mailping/.forward with "|/usr/bin/mailping-store"
and things should work.

Register the plugins mailping-success and mailping-latency with munin.

Restart munin-node to make it notice the now plugins.
