Tried that first and then realized that because the text-based server-manager still depends on the web interface, it's broken both places.
1. in /home/e-smith/db for the following 2 files :
portforward_tcp
portforward_udp
if you do not have any existing rules then these files will look like :
# DO NOT MODIFY THIS FILE.
# This file is automatically maintained by the Mitel Networks SME Server
# configuration software. Manually editing this file may put your
# system in an unknown state.
#
# updated: Thu Aug 9 19:34:43 2018
Here is what the file looks like ( i created a test port forward for tcp )
# DO NOT MODIFY THIS FILE.
# This file is automatically maintained by the Mitel Networks SME Server
# configuration software. Manually editing this file may put your
# system in an unknown state.
#
# updated: Mon Aug 20 22:50:35 2018
26296=forward|AllowHosts|192.168.1.2|Comment|wb test|DenyHosts|0.0.0.0/0|DestHost|localhost|DestPort|26296
This is what is logged when creating the above from server-manager :
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: OLD 26296=(undefined)
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: NEW 26296=forward
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: OLD 26296=forward
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: NEW 26296=forward|DestHost|localhost
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: OLD 26296=forward|DestHost|localhost
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: NEW 26296=forward|DestHost|localhost|DestPort|26296
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: OLD 26296=forward|DestHost|localhost|DestPort|26296
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: NEW 26296=forward|Comment|wb test|DestHost|localhost|DestPort|26296
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: OLD 26296=forward|Comment|wb test|DestHost|localhost|DestPort|26296
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: NEW 26296=forward|AllowHosts|192.168.1.2|Comment|wb test|DestHost|localhost|DestPort|26296
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: OLD 26296=forward|AllowHosts|192.168.1.2|Comment|wb test|DestHost|localhost|DestPort|26296
Aug 20 22:50:35 roxy1 /etc/e-smith/web/panels/manager/cgi-bin/portforwarding[24732]: /home/e-smith/db/portforward_tcp: NEW 26296=forward|AllowHosts|192.168.1.2|Comment|wb test|DenyHosts|0.0.0.0/0|DestHost|localhost|DestPort|26296
Aug 20 22:50:35 roxy1 esmith::event[24733]: Processing event: portforwarding-update
Aug 20 22:50:35 roxy1 esmith::event[24733]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Aug 20 22:50:35 roxy1 esmith::event[24733]: expanding /etc/rc.d/init.d/masq
Aug 20 22:50:35 roxy1 esmith::event[24733]: generic_template_expand=action|Event|portforwarding-update|Action|generic_template_expand|Start|1534798235 555086|End|1534798235 949021|Elapsed|0.393935
Aug 20 22:50:35 roxy1 esmith::event[24733]: Running event handler: /etc/e-smith/events/actions/adjust-services
Aug 20 22:50:36 roxy1 esmith::event[24733]: adjusting non-supervised masq (adjust)
Aug 20 22:50:36 roxy1 esmith::event[24733]: adjust-services=action|Event|portforwarding-update|Action|adjust-services|Start|1534798235 949473|End|1534798236 643620|Elapsed|0.694147
Might be another way ( more correct ), but i think this should work :
: create the file in /home/e-smith/db/portforward_tcp
signal-event portforwarding-update