How do I add rules remotely? Need to block spammers

Hi,

I have a server tool that harvests spammers IP’s and would like to be able to script adding firewall rules to my Mikrotik. Every few minutes I would like to connect to my Mikrotik and add new IPs and the port number 25 to have them be blocked.

Can I do this using telnet or FTP? Is it even possible? Not sure where to start.

Thanks!

you can write an expect script to log into router and issue commands automatically:
http://expect.nist.gov/

 0   chain=forward action=accept dst-port=25 protocol=tcp src-address-list=notspamer 

 1   chain=forward action=reject reject-with=icmp-port-unreachable dst-port=25 protocol=tcp src-address-list=spamer 

 2   chain=forward action=add-src-to-address-list dst-port=25 protocol=tcp connection-limit=30,32 limit=50,5 address-list=spamer address-list-timeout=15m

http://wiki.mikrotik.com/wiki/How_to_autodetect_infected_or_spammer_users_and_temporary_block_the_SMTP_output

as of 3.0rc3
*) ftpd - automatically execute uploaded scripts that have name *.auto.rsc;

This means you can have your utility generate a script and ftp it to your router with a “.auto.rsc” extension and it will automatically get executed.