I've tested & verified the commands below on SME 8.1; they should also work on SME 9:
config setprop smtpd AllowHosts a.b.c.d,x.y.z.0/24
signal-event remoteaccess-update
Note that the firewall rules for inbound smtp are controlled by the pre-SME 7 service 'smtpd' rather than 'qpsmtpd' which actually services the traffic.
The value following 'AllowHosts' is split at the comma and converted into multiple rules, one for each comma-separated value. Running the above command changes the default rule in /etc/rc.d/init.d/masq from this:
/sbin/iptables -A $NEW_InboundTCP --proto tcp --dport 25 \
--destination $OUTERNET --src 0.0.0.0/0 --jump ACCEPT
to this:
/sbin/iptables -A $NEW_InboundTCP --proto tcp --dport 25 \
--destination $OUTERNET --src a.b.c.d --jump ACCEPT
/sbin/iptables -A $NEW_InboundTCP --proto tcp --dport 25 \
--destination $OUTERNET --src x.y.z.0/24 --jump ACCEPT
Restore the default setting by deleting the AllowHosts property:
config delprop smtpd AllowHosts
signal-event remoteaccess-update