Mail Client auto-configuration templates variables

SYSTEM INFORMATION
OS type and version AlmaLinux 8.7
Webmin version 2.001
Virtualmin version 7.3

I would like to know where I could find the complete list of variables that may be used in the mail client auto-configuration template. I attempted without success.

When domains use Letsencrypt certificates, if for whatever reason the $SMTP_HOST and $IMAP_HOST variables do not correspond to existing entries in the certificate requested to Letsencrypt, the autoconfiguration will fail.

For example, my webmin/usermin sets these variables respectively to smtp.domain and imap.domain

At the moment, I’m solving the issue manually by adding the smtp.domain and imap.domain as DNS A records, and then in the Letsencrypt tab of the SSL certificate management, by copying the content of the “Domains associated with this server” to “Domains listed here”, then by adding the smtp.domain and imap.domain definitions, and finally by requesting a new SSL certificate.

Since webmin always includes the bare domain name in “Domains associated with this server”, it would be much simpler if the mail client auto-configuration template could be customized by replacing the $SMTP_HOST and $IMAP_HOST variables by something like $HOST or $DOMAIN. This could fix the mail client autoconfiguration issues for all domains without requiring further intervention.

Hello,

Hopefully this helps:

Thunderbird auto-configuration XML

This field allows you to customize the XML that is returned to mail clients that access the URL path /mail/config-v1.1.xml?emailaddress=user@example.com on a domain using this template. Clients like Thunderbird can use this XML to automatically configure the mail server hostname, login, port, protocol and username, based on the email address.

The default XML generated by Virtualmin will work fine in most cases, but in some situations you want to change the IMAP or SMTP server names, or other settings. In the template, you can use standard substitutions like ${DOM} and ${IP}, which will be replaced by the domain’s name and IP address when used.

Other variables that can be used in the XML are :

  • $SMTP_DOMAIN - The domain name, like example.com
  • $IMAP_HOST - Default IMAP server name, like mail.example.com
  • $IMAP_PORT - Automatically determined IMAP server port (like 143) taken from the IMAP server configuration
  • $IMAP_TYPE - Either SSL or plain, depending on your IMAP server configuration
  • $IMAP_ENC - Either password-cleartext or password-encrypted, depending on the IMAP server config.
  • $SMTP_LOGIN - Full username to login to the IMAP and SMTP servers, like bob.example
  • $SMTP_HOST - Default SMTP server name, like mail.example.com
  • $SMTP_PORT - Automatically determined SMTP server port (like 587) taken from the mail server configuration
  • $SMTP_TYPE - Either SSL or plain, depending on your mail server configuration
  • $SMTP_ENC - Either password-cleartext or STARTTLS, depending on the mail server config.

Perfect, just what I needed. Thank you very much :wink:

I’d like to mention that Ilia got that from the online help within Virtualmin. That’s the tooltip for Thunderbird/Outlook auto-configuration XML.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.