Hmmm -- I see your point.
/var/service/imaps/run is not templated.
What happens if you do this:
config setprop imaps status disabled
config set imaps-alt service TCPPort 1993 access public status enabled
db portforward_tcp set 1993 forward DestHost localhost DestPort 993
expand-template /etc/rc.d/init.d/masq
/etc/rc.d/init.d/masq restart
signal-event remoteaccess-update
This should do the following:
* disable any firewall rule for port 993 (which will prevent WAN traffic but not LAN traffic)
* create a new "service" (as far as the firewall is concerned) named imaps-alt allowing traffic on port 1993
* create a port forwarding rule from port 1993 to 993.
* rebuild /etc/rc.d/init.d/masq
* reset remote access rules.
If you're trying to restrict access for LAN users, you might need to use 'AllowHosts' or 'DenyHosts' instead of "status disabled" for the imaps service. Learn more about configuring the firewall by clicking on the link below, then scrolling down to the table showing relevant db variables:
http://wiki.contribs.org/DB_Variables_Configuration#IPTables_firewall_.28masq.29Undo these changes with:
config delete imaps-alt
db portforward_tcp delete 1993
config setprop imaps status enabled
expand-template /etc/rc.d/init.d/masq
/etc/rc.d/init.d/masq restart
signal-event remoteaccess-update