API to cover dkim etc

Hello,

I am trying to get to a state where I can deploy Virtualmin programmatically 100%, via the API preferably. Right now this is not entirely possible using full feature set, for example setting up domain keys is not covered by the API, nor is email rate limiting, greylisting, mail client configuration and so on.

Would it be possible to expand the API and cover the aforementioned features?

PS: happy to learn of any workarounds, if can be suggested

Regards, Lucian

Status: 
Active

Comments

Ok, I somehow managed to work around it like this. It can probably be done much better than this. The below is just to enable dkim:

  1. Change the settings and switch to the old theme as javascript gets in the way

  2. Run this curl commands:

curl -c ./cookie.txt -k https://$hostname:10000
curl -k -c ./cookie.txt -b ./cookie.txt -d "user=root" -d "pass=$password" -d "page=/" "https://$hostname:10000/session_login.cgi"
curl -k -b ./cookie.txt -d "user=root" -d "pass=$password" "https://$hostname:10000/virtual-server/enable_dkim.cgi?enabled=1&selector=2020&verify=0&size=2048&extra=&exclude=&undefined=&xnavigation=1"

Yes, we can add more API functions. What kind of DKIM setup are you looking to do?

Just the regular kind virtualmin does when enabled, though for security it'd be best if by default every domain had their own key, so they can't impersonat each other etc. Not sure if this answers your question. Thanks!

Ok - we'll update this ticket with progress

The next release will include a set-dkim API command to enable, disable and configure DKIM.