Thunderbird:Autoconfiguration:ConfigFileFormat

Revision as of 01:27, 18 August 2008 by BenB (talk | contribs) (→‎XML: Fix syntax errors)

This page describes the content of the config file that the Mozilla webservice, ISP config service etc. return.

It should be XML, with a clearly defined format, to be stable and usable by other mail clients, too.

The old/current RDF file format seems good in structure, but needs to be cleaned up to remove the RDF bits, Mozilla specifics etc.. It would be processed as normal XML, e.g. using E4X in Thunderbird.

XML

<?xml version="1.0"?>
<clientConfig
    xmlns="http://mailconfig.mozillamessaging.com/fileformat/namespace/2008">

    <emailProvider id="googlemail.com">
      <domain>gmail.com</domain>
      <domain>googlemail.com</domain>

      <displayName>Google Mail</displayName>
      <displayShortName>GMail</displayShortName>

      <!-- see description -->
      <inputfield key="USERNAME" label="Screen name"></inputfield>
      <inputfield key="GRANDMA" label="Grandma">Elise Bauer</inputfield>

      <incomingServer type="pop3">
         <hostname>pop.googlemail.com</hostname>
         <port>995</port>
         <socketType>TLS</socketType>
           <!-- unexcrypted, SSL, TLS
                "if available" options considered harmful -->
         <username>%EMAILLOCALPART%</username>
         <authentication>DIGEST-MD5</authentication>
            <!-- anonymous,
                 plain,
                 login,
                 CRAM-MD5,
                 DIGEST-MD5,
                 KerberosV4,
                 GSSAPI (Kerberos v5),
            -->
         <pop3>
            <!-- remove the following and leave to client/user? -->
            <leaveMessagesOnServer>true</leaveMessagesOnServer>
            <deleteMailLeftOnServer>false</deleteMailLeftOnServer>
         </pop3>
      </incomingServer>

      <outgoingServer type="smtp">
         <hostname>smtp.googlemail.com</hostname>
         <port>587</port>
         <socketType>TLS</socketType> <!-- see above -->
         <username>%EMAILLOCALPART%</username> <!-- if smtp-auth -->
         <authentication>smtp-auth</authentication>
            <!-- none (server grants access based on IP address),
                 smtp-auth (RFC 2554, 4954),
                 smtp-after-pop (authenticate to incoming mail server first
                 before contacting the smtp server)-->
         <addThisServer>true</addThisServer>
         <useGlobalPreferredServer>true</useGlobalPreferredServer>
      </outgoingServer>

      <identity>
         <!-- needed? -->
         <!-- We don't want Verizon setting "Organization: Verizon"
              for its customers -->
      </identity>

    </emailProvider>

    <clientConfigUpdate url="https://www.googlemail.com/config/mozilla.xml" />
</clientConfig>

Placeholders

The email address (before @ or with domain) that the user entered can be used as placeholder in the config file, so the file is the same for all users (i.e. static).

Placeholders:

  • %EMAILADDRESS% (full email address of the user, usually entered by the user)
  • %EMAILLOCALPART% (email address, part before @)
  • %EMAILDOMAIN% (email address, part after @)
  • %REALNAME% (needed?)
  • The key (surrounded by %) in <inputfield key=""> (see below)

These placeholders can be used as value or value part in most settings which take a string.

User input fields

For some ISPs, the IMPA/POP/SMTP username (and maybe other fields) has no relation to the email address and has to be entered separately. E.g. Email address is ben.bucksch@wong.com (chosen by user), but username is G675476 (provided by ISP).

In this case, an <inputfield> can be added for the username. It will let the client show a textfield to the user. The user-visible label is the one provided in the <inputfield label=""> attribute, to allow the ISP to use custom terminology for "username". The label is not localizable, that would be too complicated and most ISPs are local anyways - if really important, the ISP config server can look at the HTTP headers during the fetch.

The text that the user entered is written into a placeholder %key%, where key is the content of the <inputfield key=""> attribute. The placeholder can then be used in other settings, specifically the IMAP/POP and SMTP username.

For example, a config file entry

        <userinput label="Username" key="%USERNAME%">D123456</userinput>

would result in a UI like:

  Username:     [             ] example: D123456

and cound be used elsewhere in the config file like:

        <username>%USERNAME%</username>

and if the user enters "D32198", it would be automatically filled in like:

        <username>D32198</username>

i.e. using D32198 as username for IMAP, POP or SMTP.

The system is generic, so that it can in theory be used for other values as well. No other such purpose is currently known, apart from a separate POP and SMTP username maybe. It should not be used to let the user supply hostnames, as that would defeat the purpose of the autoconfig and be worse than the manual config UI provided by the client.

TODO

  • IMAP
  • All settings and enum values