Mail Autoconfiguration

1 post / 0 new
#1 Fri, 04/15/2016 - 03:03
3S-Hosting

Mail Autoconfiguration

Hello everybody,

I have configured my virtualmin for mail-autoconfiguration. The private domains are redirected to an exchange autoconfig manually. This works like a charm.

With the other domains I actually have some issues: The [...]/cgi-bin/autoconfig.cgi for each domain contains the wrong hosts. In these files the hosts are named imap.domain, smtp.domain, ... Due to the fact the Mailserver is not available under these hosts (using a central mailcluster) these hosts must be edited. This is easily done for testing in one file, but with 200 virtual servers (and many more domains) this is not funny. Is there any way to tell Virtualmin what hosts to use for this in a global manner? The only way I have found (and done) on my old servers was to hardcode the hosts in the server template, but I prefer to let this more dynamic.

This takes me to the next problem: When the mailconfig template is changed I see no possibility to update existing [...]/cgi-bin/autoconfig.cgi out of virtualmin. A button like "apply to all existing autoconfigs for every domain" would be very cool. For one domain no problem, but 200+? This has to be automated.

As one solution I thought about using "Custom Fields". I already use the function to execute scripts after server creation / editing for correcting DNS-records, creating apache home directorys, etc. It should be no problem to use these fields in the scripts, the fields should be available in the env. But ist there any possibility to read this fields outside this scope? My thought was to write in script: get field xyz for each domain -if xyz = something: do something - if xyz = something else: do something else Ok, the domain settings can be read from /etc/webmin/virtual-server/domains/, but is there no easier / cooler way to get these instead of parsing the domain-settings by ones own?

Next stumbling block I have noticed for me: creating a custom field is no problem, but there should be a possibility to decide "leave existing domains alone" or "update existing domains with value xyz for the new field".

Again, it is not very funny to walk through 200+ domains for every single change made. I am afraid of scripting to much / to hardcore when there is an API for that work.

Any help or ideas appreciated, 3S-Hosting

P.s.: please excuse my bad school english