<?xml version="1.0"?>

<config>


   <James>

      <postmaster>Postmaster@webmail.microman.net</postmaster>

      <servernames autodetect="true" autodetectIP="true">
         <servername>drost.servebeer.com</servername>
         <servername>drost.bounceme.net</servername>
      </servernames>

      <usernames ignoreCase="true" enableAliases="true" enableForwarding="true"/>

      <inboxRepository>
         <repository destinationURL="db://maildb/inbox/" type="MAIL"/>
      </inboxRepository>

   </James>



    <fetchpop enabled="false">
        <fetch name="mydomain.com">
            <host>mail.mydomain.com</host>
            <user>username</user>
            <password>pass</password>
            <interval>1800000</interval>
        </fetch>
    </fetchpop>



   <spoolmanager>
      <threads> 10 </threads>

      <!-- Set the Java packages from which to load mailets and matchers -->
      <mailetpackages>
         <mailetpackage>org.apache.james.transport.mailets</mailetpackage>
      </mailetpackages>
      <matcherpackages>
         <matcherpackage>org.apache.james.transport.matchers</matcherpackage>
      </matcherpackages>

      <processor name="root">

         <!-- Checks that the email Sender is associated with a valid domain. -->
         <!-- Useful for detecting and eliminating spam. -->
         <!-- For this block to function, the spam processor must be configured. -->
         <!--
         <mailet match="SenderInFakeDomain" class="ToProcessor">
            <processor> spam </processor>
         </mailet>
         -->

         <!-- Important check to avoid looping -->
         <mailet match="RelayLimit=20" class="Null"/>

         <!-- People on this list agree to pay a penalty if they send spam -->
         <mailet match="InSpammerBlacklist=query.bondedsender.org"
                 class="ToProcessor">
           <processor> transport </processor>
         </mailet>

         <!-- E-mail legally required not to be spam (see: http://www.habeas.com) -->
         <!--
         <mailet match="HasHabeasWarrantMark" class="ToProcessor">
            <processor> transport </processor>
         </mailet>
         -->
         <!-- End of White List -->

         <mailet match="InSpammerBlacklist=dnsbl.njabl.org"
                 class="ToProcessor">
           <processor> spam </processor>
           <notice>550 Requested action not taken: rejected - see http://njabl.org/ </notice>
         </mailet>

         <mailet match="InSpammerBlacklist=relays.ordb.org"
                 class="ToProcessor">
           <processor> spam </processor>
           <notice>550 Requested action not taken: rejected - see http://www.ordb.org/ </notice>
         </mailet>

         <mailet match="InSpammerBlacklist=blackholes.mail-abuse.org" class="ToProcessor">
            <processor> spam </processor>
            <notice>550 Requested action not taken: rejected - see  http://www.mail-abuse.org/rbl/ </notice>
         </mailet>
         
         <mailet match="InSpammerBlacklist=dialups.mail-abuse.org" class="ToProcessor">
            <processor> spam </processor>
            <notice>550 Requested action not taken: rejected - see http://www.mail-abuse.org/dul/ </notice>
         </mailet>
         
         <mailet match="InSpammerBlacklist=relays.mail-abuse.org" class="ToProcessor">
            <processor> spam </processor>
            <notice>550 Requested action not taken: rejected - see http://www.mail-abuse.org/rss/ </notice>
         </mailet>

         <!-- Sample matching to kill a message (send to Null) -->
         <!--
         <mailet match="RecipientIs=badboy@badhost" class="Null"/>
         -->

         <!-- Send remaining mails to the transport processor for either local or remote delivery -->
         <mailet match="All" class="ToProcessor">
            <processor> transport </processor>
         </mailet>
      </processor>

      <!-- The error processor is required.  James may internally set emails to the -->
      <!-- error state.  The error processor is generally invoked when there is an -->
      <!-- unexpected error either in the mailet chain or internal to James. -->
      <!-- -->
      <!-- By default configuration all email that generates an error in placed in -->
      <!-- an error repository. -->
      <processor name="error">

         <!-- Logs any messages to the repository specified -->
         <mailet match="All" class="ToRepository">
            <repositoryPath> db://maildb/deadletter/error </repositoryPath>
            <passThrough> true </passThrough>
         </mailet>

         <mailet match="All" class="NotifySender"/>         

      </processor>

      <processor name="transport">

		 <mailet match="All" class="JDBCVirtualUserTable">
			<table>db://maildb/VirtualUserTable</table>
		 </mailet>

         <mailet match="RecipientIsLocal" class="LocalDelivery"/>

         <mailet match="HostIsLocal" class="ToProcessor">
            <processor>error</processor>
         </mailet>

<!-- CHECKME! -->
         <!-- This is an anti-relay matcher/mailet combination -->
         <!-- -->
         <!-- Emails sent from servers not in the network list are  -->
         <!-- rejected as spam.  This is one method of preventing your -->
         <!-- server from being used as an open relay.  Make sure you understand -->
         <!-- how to prevent your server from becoming an open relay before -->
         <!-- changing this configuration. -->
         <!-- -->
         <!-- This matcher/mailet combination must come after local delivery has -->
         <!-- been performed.  Otherwise local users will not be able to receive -->
         <!-- email from senders not in this remote address list. -->
         <!-- -->
         <!-- If you are using this matcher/mailet you will probably want to -->
         <!-- update the configuration to include your own network/addresses.  The -->
         <!-- matcher can be configured with a comma separated list of IP addresses  -->
         <!-- wildcarded IP subnets, and wildcarded hostname subnets. -->
         <!-- e.g. "RemoteAddrNotInNetwork=127.0.0.1, abc.de.*, 192.168.0.*" -->
         <!-- -->
         <!-- If you are using SMTP authentication then you can (and generally -->
         <!-- should) disable this matcher/mailet pair. -->
         
         <!--
         <mailet match="RemoteAddrNotInNetwork=127.0.0.1,63.169.36.172,63.162.131.200" class="ToProcessor">
            <processor> spam </processor>
         </mailet>
         -->

         <!-- Attempt remote delivery using the specified repository for the spool, -->
         <!-- using delay time to retry delivery and the maximum number of retries -->
         <mailet match="All" class="RemoteDelivery">
            <outgoing> db://maildb/spool/outgoing </outgoing>
            <delayTime> 1800000 </delayTime>
            <maxRetries> 2 </maxRetries>
            <deliveryThreads> 5 </deliveryThreads>
         </mailet>

      </processor>

      <processor name="spam">
         
         <!-- To destroy all messages, uncomment this matcher/mailet configuration -->
         <!--
         <mailet match="All" class="Null"/>
         -->

         <!-- To notify the sender their message was marked as spam, uncomment this matcher/mailet configuration -->
         <mailet match="All" class="NotifySender"/>

         <!-- To log the message to a repository, this matcher/mailet configuration should be uncommented. -->
         <!-- This is the default configuration. -->
	 <mailet match="All" class="ToRepository">
	    <repositoryPath> db://maildb/deadletter/spam </repositoryPath>
    	</mailet>
         
      </processor>
   </spoolmanager>


   <dnsserver>
      <servers>
         <server>204.117.214.10</server>
         <server>199.2.252.10</server>
      </servers>
      <authoritative>false</authoritative>
   </dnsserver>


   <remotemanager>
      <port>?</port>
      <bind>63.169.36.225</bind>
      <useTLS>false</useTLS>

      <handler>
         <helloName autodetect="false">micromanagement</helloName>
         <administrator_accounts>
            <account login="?" password="?"/>
         </administrator_accounts>
         <connectiontimeout> 1800000 </connectiontimeout>
      </handler>
   </remotemanager>



   <pop3server enabled="true">
   
      <port>111</port>
      <bind>63.169.36.225</bind>
      <useTLS>false</useTLS>

      <handler>
         <helloName autodetect="false">micromanagement</helloName>
         <connectiontimeout>1800000</connectiontimeout>
      </handler>
      
   </pop3server>

   <smtpserver enabled="true">

      <port>26</port>
      <bind>63.169.36.225</bind>
      <useTLS>false</useTLS>

      <handler>
      
         <helloName autodetect="false">micromanagement</helloName>
         <connectiontimeout>1800000</connectiontimeout>
         <authRequired>true</authRequired>
         

         <!--  Uncomment this if you want to verify sender addresses, ensuring that -->
         <!--  the sender address matches the user who has authenticated. -->
         <!--  This prevents a user of your mail server from acting as someone else -->
         <!--
         <verifyIdentity>true</verifyIdentity>
         -->

         <!--  This sets the maximum allowed message size (in kilobytes) for this -->
         <!--  SMTP service. If unspecified, the value defaults to 0, which means no limit. -->
         
         <maxmessagesize>20000</maxmessagesize>
         
      </handler>
   </smtpserver>



   <nntpserver enabled="false">
      <port>119</port>
      <handler>
         <helloName autodetect="true">myMailServer</helloName>
         <connectiontimeout>120000</connectiontimeout>
         <authRequired>false</authRequired>
      </handler>
   </nntpserver>



   <nntp-repository>
   
      <readOnly>true</readOnly>
      <rootPath>file://java/nntp/groups</rootPath>
      <tempPath>file://java/nntp/temp</tempPath>
      <articleIDPath>file://java/nntp/articleid</articleIDPath>
      <articleIDDomainSuffix>news.james.apache.org</articleIDDomainSuffix>
      
      <newsgroups>
         <newsgroup>org.apache.james.dev</newsgroup>
         <newsgroup>org.apache.james.user</newsgroup>
         <newsgroup>org.apache.avalon.dev</newsgroup>
         <newsgroup>org.apache.avalon.user</newsgroup>
      </newsgroups>

      <spool>
         <configuration>
            <spoolPath>file://java/nntp/spool</spoolPath>
            <threadCount>1</threadCount>
            <threadIdleTime>60000</threadIdleTime>
         </configuration>
      </spool>
      
   </nntp-repository>



   <mailstore>
      <repositories>

         <!-- File based repositories.  These repositories store all message data -->
         <!-- in the file system. -->
         <repository class="org.apache.james.mailrepository.AvalonMailRepository">
            <protocols>
               <protocol>file</protocol>
            </protocols>
            <types>
               <type>MAIL</type>
            </types>
         </repository>
         <repository class="org.apache.james.mailrepository.AvalonSpoolRepository">
            <protocols>
               <protocol>file</protocol>
            </protocols>
            <types>
               <type>SPOOL</type>
            </types>
         </repository>

         <!-- JDBC based repositories.  These repositories store all message data -->
         <!-- in the database. -->
         <repository class="org.apache.james.mailrepository.JDBCMailRepository">
            <protocols>
               <protocol>db</protocol>
            </protocols>
            <types>
               <type>MAIL</type>
            </types>
            <config>
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
            </config>
         </repository>

         <repository class="org.apache.james.mailrepository.JDBCSpoolRepository">
            <protocols>
               <protocol>db</protocol>
            </protocols>
            <types>
               <type>SPOOL</type>
            </types>
            <config>
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
            </config>
         </repository>

         <!-- These repositories store message delivery and headers in the DB, and the body to the filesystem -->
         <repository class="org.apache.james.mailrepository.JDBCMailRepository">
            <protocols>
               <protocol>dbfile</protocol>
            </protocols>
            <types>
               <type>MAIL</type>
            </types>
            <config>
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
               <filestore>file://var/dbmail</filestore>
            </config>
         </repository>

         <repository class="org.apache.james.mailrepository.JDBCSpoolRepository">
            <protocols>
               <protocol>dbfile</protocol>
            </protocols>
            <types>
               <type>SPOOL</type>
            </types>
            <config>
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
               <filestore>file://var/dbmail</filestore>
            </config>
         </repository>
      </repositories>

      <spoolRepository>
         <repository destinationURL="db://maildb/spool/spool" type="SPOOL"/>
      </spoolRepository>
      
   </mailstore>



   <users-store>
      <repository name="LocalUsers" class="org.apache.james.userrepository.JamesUsersJdbcRepository" destinationURL="db://maildb/users">
         <sqlFile>file://conf/sqlResources.xml</sqlFile>
      </repository>
   </users-store>



   <database-connections>
      <data-sources>
         <data-source name="maildb" class="org.apache.james.util.mordred.JdbcDataSource">
            <driver>org.gjt.mm.mysql.Driver</driver>
            <dburl>jdbc:mysql://127.0.0.1/mail?autoReconnect=true</dburl>
            <user>?</user>
            <password>?</password>
            <max>20</max>
         </data-source>
      </data-sources>
   </database-connections>



   <!-- Configuration for Cornerstone Services -->
   <!-- -->
   <!-- For a simple configuration, nothing beneath this line should require -->
   <!-- alteration. -->
   <!-- -->
   <!-- You will need to adjust the Socket Manager service configuration if you want -->
   <!-- to enable secure sockets (TLS) for any James service.                        -->
   <!-- -->
   <!-- Complex or high volume configurations may require changes to the parameters -->
   <!-- in this section.  Please read the James and Avalon documentation before -->
   <!-- attempting to adjust this section. -->
   <!-- -->

   <!-- The Object Storage block -->
   <!-- -->
   <!-- Defines file storage details that are used for file-based repositories. -->
   <objectstorage>
      <repositories>
         <repository class="org.apache.james.mailrepository.filepair.File_Persistent_Object_Repository">
            <protocols>
               <protocol>file</protocol>
            </protocols>
            <types>
               <type>OBJECT</type>
            </types>
            <models>
               <model>SYNCHRONOUS</model>
               <model>ASYNCHRONOUS</model>
               <model>CACHE</model>
            </models>
         </repository>

         <repository class="org.apache.james.mailrepository.filepair.File_Persistent_Stream_Repository">
            <protocols>
               <protocol>file</protocol>
            </protocols>
            <types>
               <type>STREAM</type>
            </types>
            <models>
               <model>SYNCHRONOUS</model>
               <model>ASYNCHRONOUS</model>
               <model>CACHE</model>
            </models>
         </repository>
      </repositories>
   </objectstorage>



   <connections>
      <idle-timeout>1800000</idle-timeout>
      <max-connections>30</max-connections>
   </connections>



   <sockets>
      <server-sockets>
         <factory name="plain" class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"/>
      </server-sockets>
      <client-sockets>
         <factory name="plain" class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory"/>
      </client-sockets>
   </sockets>



   <thread-manager>
      <thread-group>
         <name>default</name>
         <priority>7</priority>
         <is-daemon>true</is-daemon>
         <max-threads>200</max-threads>
         <min-threads>40</min-threads>
         <min-spare-threads>40</min-spare-threads>
      </thread-group>
   </thread-manager>


   
</config>
