I did configure amtm, and it's very cool. I was able to send a test email from the options menu.
HOWEVER, I'm still seeing the exact same behavior - the email gets sent when the script is run directly from the shell, but not when called by the router.
I modified my script according to...