My custom source code for emailOnAway Openfire plugin (adds send of email on offline status) and compiled jar file ready for use (just place it in /usr/share/openfire/plugins and restart service).
It must be compiled using Eclipse IDE or something similar.
See novice instuction here
Use build.xml in build folder to build plugin. It is for the 4.2.4 Openfire version, but compiled plugin is compatible with all new version of server (for now it is 4.7.4).