Gandi supports wildcard * subdomains, but they should be updated as well as the @. I hacked the script to achieve that for me, but a clean implementation should be devised…
Given that the configuration form in DSM validates the hostname a little strictly, and that there is no other setting (I wouldn't abuse the username field for that), maybe make two versions of the script?