Added email sender listener, which catches email errors in the kernel.terminate event