Putting aside the question, whether or not %d is/should be expanded in default_fields = uid=%d gid=%d couldn't or shouldn't you place the correct numerical ids in the file anyway?
The issue is, and maybe this was a bad requirement on my part, that each domains' mailbox is owned by the user associated with that domain. I don't have a global 'virtualmail' user that handles the mailboxes. Each 'domain' hosted on the server is a system user, with their own PHP instance, Python virtualenv etc, and maildir inside $HOME. So until the client issues a log in, I don't know which uid\gid to assign to them.
Many thanks,
Tim Jones Software Development +34 612345678 C/ Quintanavides 15, Edificio 2, Planta 1ª Parque Empresarial Vía Norte de Metrovacesa Las Tablas 28050 Madrid Skype: tim.jones.fon All information in this email is confidential