<?xml version="1.0" encoding="UTF-8"?>
<mailetcontainer enableJmx="true">

    <context>
        <postmaster>someuser@mydomain.com</postmaster>
    </context>

    <spooler>
        <threads>1</threads>
    </spooler>

    <processors>

        <processor state="root" enableJmx="true">
            <mailet match="RelayLimit=2" class="Null"/>
            <mailet match="All" class="LogMessage">
                <headers>true</headers>
                <body>false</body>
                <comment>COMMENT: Processor root started</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="PostmasterAlias"/>
            <mailet match="HasHeader=To" class="ToProcessor">
                <processor>send</processor>
                <debug>true</debug>
            </mailet>
            <mailet match="All" class="LogMessage">
                <headers>false</headers>
                <body>false</body>
                <comment>COMMENT: Message does not contain To header</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="SetMimeHeader">
                <name>To</name>
                <value>undisclosed-recipients:;</value>
            </mailet>
            <mailet match="All" class="ToProcessor">
                <processor>send</processor>
                <debug>true</debug>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repositories/misplaced</repositoryPath>
                <notice>Mail stored in repository db://maildb/repositories/misplaced</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="send" enableJmx="true">
            <mailet match="All" class="RemoveMimeHeader">
                <name>bcc</name>
                <name>Received</name>
            </mailet>
            <mailet match="RecipientIsLocal" class="LocalDelivery">
                <consume>false</consume>
            </mailet>
            <mailet match="SenderIs=mail1@mail.ru" class="ToProcessor">
                <processor>mail1</processor>
                <debug>true</debug>
            </mailet>
            <mailet match="SenderIs=mail2@mail.ru" class="ToProcessor">
                <processor>mail2</processor>
                <debug>true</debug>
            </mailet>
            <mailet match="SenderIs=mail3@mail.ru" class="ToProcessor">
                <processor>mail3</processor>
                <debug>true</debug>
            </mailet>
            <mailet match="SenderIs=mailtrap@mail.ru" class="ToProcessor">
                <processor>mailtrap</processor>
                <debug>true</debug>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repositories/disallowed</repositoryPath>
                <notice>Mail stored in repository db://maildb/repositories/disallowed</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="mail1" enableJmx="true">
            <mailet match="All" class="LogMessage">
                <headers>false</headers>
                <body>false</body>
                <comment>COMMENT: Processor mail1 started</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="RemoteDelivery">
                <deliveryThreads>1</deliveryThreads>
                <outgoing>outgoing</outgoing>
                <startTLS>false</startTLS>
                <sslEnable>true</sslEnable>
                <gateway>smtp.mail.ru</gateway>
                <gatewayPort>465</gatewayPort>
                <gatewayUsername>mail1</gatewayUsername>
                <gatewayPassword>changeit</gatewayPassword>
                <bounceProcessor>bounces</bounceProcessor>
                <debug>true</debug>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repostitories/mail1</repositoryPath>
                <notice>Mail stored in repository db://maildb/repostitories/mail1</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="mail2" enableJmx="true">
            <mailet match="All" class="LogMessage">
                <headers>false</headers>
                <body>false</body>
                <comment>COMMENT: Processor mail2 started</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="RemoteDelivery">
                <deliveryThreads>1</deliveryThreads>
                <outgoing>outgoing</outgoing>
                <startTLS>false</startTLS>
                <sslEnable>true</sslEnable>
                <gateway>smtp.mail.ru</gateway>
                <gatewayPort>465</gatewayPort>
                <gatewayUsername>mail2</gatewayUsername>
                <gatewayPassword>changeit</gatewayPassword>
                <bounceProcessor>bounces</bounceProcessor>
                <debug>true</debug>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repostitories/mail2</repositoryPath>
                <notice>Mail stored in repository db://maildb/repostitories/mail2</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="mail3" enableJmx="true">
            <mailet match="All" class="LogMessage">
                <headers>false</headers>
                <body>false</body>
                <comment>COMMENT: Processor mail2 started</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="RemoteDelivery">
                <deliveryThreads>1</deliveryThreads>
                <outgoing>outgoing</outgoing>
                <startTLS>false</startTLS>
                <sslEnable>true</sslEnable>
                <gateway>smtp.mail.ru</gateway>
                <gatewayPort>465</gatewayPort>
                <gatewayUsername>mail3</gatewayUsername>
                <gatewayPassword>changeit</gatewayPassword>
                <bounceProcessor>bounces</bounceProcessor>
                <debug>true</debug>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repostitories/mail3</repositoryPath>
                <notice>Mail stored in repository db://maildb/repostitories/mail3</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="mailtrap" enableJmx="true">
            <mailet match="All" class="LogMessage">
                <headers>false</headers>
                <body>false</body>
                <comment>COMMENT: Processor mailtrap started</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="RemoteDelivery">
                <deliveryThreads>1</deliveryThreads>
                <outgoing>outgoing</outgoing>
                <startTLS>true</startTLS>
                <sslEnable>false</sslEnable>
                <gateway>smtp.mailtrap.io</gateway>
                <gatewayPort>2525</gatewayPort>
                <gatewayUsername>e8d876679ca4f0</gatewayUsername>
                <gatewayPassword>4951c8561ae627</gatewayPassword>
                <bounceProcessor>bounces</bounceProcessor>
                <debug>true</debug>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repositories/mailtrap</repositoryPath>
                <notice>Mail stored in repository db://maildb/repositories/mailtrap</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="transport" enableJmx="true">
            <mailet match="All" class="RemoveMimeHeader">
                <name>bcc</name>
            </mailet>
            <mailet match="All" class="LogMessage">
                <headers>false</headers>
                <body>false</body>
                <comment>COMMENT: Processor transport is reached</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repositories/transport</repositoryPath>
                <notice>Mail stored in repository db://maildb/repositories/transport</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="error" enableJmx="true">
            <mailet match="All" class="LogMessage">
                <headers>true</headers>
                <body>true</body>
                <comment>COMMENT: Processor error is reached</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repositories/error</repositoryPath>
                <notice>Mail stored in repository db://maildb/repositories/error</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

        <processor state="bounces" enableJmx="true">
            <mailet match="All" class="LogMessage">
                <headers>true</headers>
                <body>true</body>
                <comment>COMMENT: Processor bounces is reached</comment>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>db://maildb/repositories/bounces</repositoryPath>
                <notice>Mail stored in repository db://maildb/repositories/bounces</notice>
                <passThrough>false</passThrough>
            </mailet>
            <mailet match="All" class="Null"/>
        </processor>

    </processors>

</mailetcontainer>
