<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
    targetNamespace="http://jboss.com/products/seam/mail"
    xmlns:mail="http://jboss.com/products/seam/mail"
    xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
    <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.0.xsd"/>
    
    <xs:attributeGroup name="attlist.mailSession">
        <xs:attribute name="username" type="xs:string"/>
        <xs:attribute name="password" type="xs:string"/>
        <xs:attribute name="host" type="xs:string" default="localhost"/>
        <xs:attribute name="port" type="xs:string" />
        <xs:attribute name="debug" type="xs:string" default="false" />
        <xs:attribute name="ssl" type="xs:boolean" default="false" />
        <xs:attribute name="tls" type="xs:boolean" default="true" />
        <xs:attribute name="session-jndi-name" type="xs:string" />
    </xs:attributeGroup>
    <xs:element name="mail-session">
        <xs:complexType>
            <xs:attributeGroup ref="components:attlist.component" />
            <xs:attributeGroup ref="mail:attlist.mailSession" />
        </xs:complexType>
    </xs:element>
    
    <xs:element name="users" type="components:multiValuedProperty"/>
    <xs:element name="meldware">
        <xs:complexType>
        	<xs:choice minOccurs="0" maxOccurs="unbounded">
        		<xs:element ref="mail:users" />
        	</xs:choice>
        	<xs:attributeGroup ref="components:attlist.component" />
        </xs:complexType>
    </xs:element>
    
    <xs:element name="aliases" type="components:multiValuedProperty"/>
    <xs:attributeGroup name="attlist.meldwareUser">
    	<xs:attribute name="username" type="xs:string" />
    	<xs:attribute name="password" type="xs:string" />
    	<xs:attribute name="administrator" type="xs:boolean" default="false"/>
    </xs:attributeGroup>
    <xs:element name="meldware-user">
        <xs:complexType>
        	<xs:choice minOccurs="0" maxOccurs="unbounded">
        		<xs:element ref="mail:aliases" />
        	</xs:choice>
            <xs:attributeGroup ref="components:attlist.component" />
            <xs:attributeGroup ref="mail:attlist.meldwareUser" />
        </xs:complexType>
    </xs:element>
</xs:schema>

