apache-james-2.3.2+Claros-intouch2.1组建自己的邮件服务器

          准备:jdk1.6+tomcat6.0(版本没什么限定,不要太旧就可以)

           软件包:apache-james-2.3.2+Claros-intouch2.1

          下载地址自己网上找找,挺多的。

          jdk和tomcat得配置在这里就不说了

           配置之前建议有服务器做实验最好 

           这里:我的服务器映射域名为 :  mail.weixiuche.com 

           首先在apahce-james的apache-james-2.3.2/james-2.3.2/apps/james/SAR-INF/config.xml里面配置

           我的配置如下:

          <?xml version="1.0"?>
<!DOCTYPE config [
<!ENTITY listserverConfig SYSTEM "../conf/james-listmanager.xml">
<!ENTITY listserverStores SYSTEM "../conf/james-liststores.xml">
<!ENTITY fetchmailConfig SYSTEM "../conf/james-fetchmail.xml">
<!ENTITY smtphandlerchainConfig SYSTEM "../conf/james-smtphandlerchain.xml">
]>
<!--
 Licensed to the Apache Software Foundation (ASF) under one  
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information       
 regarding copyright ownership.  The ASF licenses this file  
 to you under the Apache License, Version 2.0 (the           
 "License"); you may not use this file except in compliance  
 with the License.  You may obtain a copy of the License at  
                                                              
   http://www.apache.org/licenses/LICENSE-2.0                
                                                              
  Unless required by applicable law or agreed to in writing,  
 software distributed under the License is distributed on an 
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY      
 KIND, either express or implied.  See the License for the   
 specific language governing permissions and limitations     
 under the License. 
-->
<!--  Configuration file for the ASF James server -->

<!--  This file contains important settings that control the behaviour -->
<!--  of all of the services and repositories. -->

<!--                               README!                            -->

<!-- This configuration file is designed to run without alteration for simple tests. -->
<!-- It assumes you have a DNS server on localhost and assigns a root password of root. -->

<!-- In case the defaults do not suit you, the items you are most likely to need to change -->
<!-- are preceded by a CHECKME! or CONFIRM? comment in the left margin. -->

<!-- For production use you will probably need to make more extensive changes, see -->
<!-- http://james.apache.org/server/2.3.0/ -->

<!-- $Revision: 776655 $ Committed on $Date: 2009-05-20 11:43:57 +0100 (Wed, 20 May 2009) $ by: $Author: rdonkin $ -->

<config>
   <James>

<!-- CHECKME! -->
      <!-- This is the postmaster email address for this mail server. -->
      <!-- Set this to the appropriate email address for error reports -->
      <!-- If this is set to a non-local email address, the mail server -->
      <!-- will still function, but will generate a warning on startup. -->
      <postmaster>Postmaster@weixiuche.com</postmaster>

      <!-- servernames identifies the DNS namespace served by this instance of James. -->
      <!-- These servernames are used for both matcher/mailet processing and SMTP auth -->
      <!-- to determine when a mail is intended for local delivery. -->
      <!-- -->
      <!-- If autodetect is TRUE, James wil attempt to discover its own host name AND -->
      <!-- use any explicitly specified servernames. -->
      <!-- If autodetect is FALSE, James will use only the specified servernames. -->
      <!-- -->
      <!-- If autodetectIP is not FALSE, James will also allow add the IP address for each servername. -->
      <!-- The automatic IP detection is to support RFC 2821, Sec 4.1.3, address literals. -->
      <!-- -->
      <!-- To override autodetected server names simply add explicit servername elements. -->
      <!-- In most cases this will be necessary. -->
      <!-- By default, the servername 'localhost' is specified. This can be removed, if required. -->
      <!-- -->
      <!-- Warning: If you are using fetchmail it is important to include the -->
      <!-- fetched domains in the server name list to prevent looping.       -->
      <servernames autodetect="false" autodetectIP="false">
<!-- CONFIRM? -->
         <servername>mail.weixiuche.com</servername>
      </servernames>

      <!-- Set whether user names are case sensitive or case insensitive -->
      <!-- Set whether to enable local aliases -->
      <!-- Set whether to enable forwarding -->
      <usernames ignoreCase="true" enableAliases="true" enableForwarding="true"/>

      <!-- The inbox repository is the location for users inboxes -->
      <!-- Default setting: file based repository - enter path ( use  "file:///" for absolute) -->
      <inboxRepository>
         <repository destinationURL="file://var/mail/inboxes/" type="MAIL"/>
      </inboxRepository>

      <!-- Alternative inbox repository definition for DB use. -->
      <!-- The format for the destinationURL is "db://<data-source>/<table>" -->
      <!-- <data-source> is the datasource name set up in the database-connections block, below -->
      <!-- <table> is the name of the table to store user inboxes in -->
      <!-- The user name is used as <repositoryName> for this repository config. -->
      <!--
      <inboxRepository>
         <repository destinationURL="db://maildb/inbox/" type="MAIL"/>
      </inboxRepository>
      -->

      <!-- Alternative inbox repository definition for DB use. -->
      <!-- Stores message body in file system, rest in database -->
      <!--
      <inboxRepository>
         <repository destinationURL="dbfile://maildb/inbox/" type="MAIL"/>
      </inboxRepository>
      -->

      <!-- Alternative inbox repository definition for mbox use. -->
      <!-- This method uses UNIX standard mbox files and is meant for people using mbox files -->
      <!-- with systems such as mail list archive displayers -->
      <!-- Note that dot-locking is not currently supported -->
      <!-- so network (write) accesses may cause mbox corruption -->
      <!-- the sample mbox URL is an absolute URL; mbox:///var/mail will put the users mbox files in /var/mail/-->
      <!--
      <inboxRepository>
         <repository destinationURL="mbox:///var/mail/" type="MAIL"/>
      </inboxRepository>
      -->
   </James>

   <!-- This is an example configuration for FetchMail, a JavaMail based gateway  -->
   <!-- service that pulls messages from other sources, and inserts them into the -->
   <!-- spool.  They are then processed normally, although FetchMail generally    -->
   <!-- has to fabricate some of the envelope information.  FetchMail should be   -->
   <!-- considered a mail gateway, rather than a relay, in RFC terms.             -->
   <!-- Fetchmail is a functionally richer replacement for FetchPOP.              -->
   <!-- CHECKME: FetchMail is disabled by default, and must be configured to use. -->
   <!-- Edit the file referred to by fetchmailConfig to enable and configure.     -->
   &fetchmailConfig;

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

   <!-- The James Spool Manager block  -->
   <!-- -->
   <!-- This block is responsible for processing messages on the spool. -->
   <spoolmanager>
      <!-- Number of spool threads -->
      <threads> 10 </threads>

      <!-- The root processor is a required processor - James routes all mail on the spool -->
      <!-- through this processor first. -->
      <!-- -->
      <!-- This configuration is a sample configuration for the root processor. -->
      <processor name="root">

         <!-- This mailet redirects mail for the user 'postmaster' at any local domain to -->
         <!-- the postmaster address specified for the server. The postmaster address -->
         <!-- is required by rfc822. Do not remove this mailet unless you are meeting -->
         <!-- this requirement through other means (e.g. a XML/JDBCVirtualUserTable mailet) -->
         <mailet match="All" class="PostmasterAlias"/>

         <!-- 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=64.55.105.9,64.94.110.11,194.205.62.122,194.205.62.62,195.7.77.20,206.253.214.102,212.181.91.6,219.88.106.80,194.205.62.42,216.35.187.246,203.119.4.6" class="ToProcessor">
            <processor> spam </processor>
         </mailet>
         -->

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

         <!-- Check for viruses -->
         <!-- -->
         <!-- Does an antivirus scan check using a ClamAV daemon (CLAMD). -->
         <!-- -->
         <!-- Interacts directly with the daemon using the "stream" method, -->
         <!-- which should have the lowest possible overhead. -->
         <!-- The CLAMD daemon will typically reside on localhost, but could reside on a -->
         <!-- different host. -->
         <!-- It may also consist on a set of multiple daemons, each residing on a different -->
         <!-- server and on different IP number. -->
         <!-- In such case a DNS host name with multiple IP addresses (round-robin load sharing) -->
         <!-- is supported by the mailet (but on the same port number). -->
         <!-- -->
         <!-- Handles the following init parameters: -->
         <!-- <debug> -->
         <!-- <host>: the host name of the server where CLAMD runs. It can either be -->
         <!--     a machine name, such as -->
         <!--     "java.sun.com", or a textual representation of its -->
         <!--     IP address. If a literal IP address is supplied, only the -->
         <!--     validity of the address format is checked. -->
         <!--     If the machine name resolves to multiple IP addresses, round-robin load sharing will -->
         <!--     be used. -->
         <!--     The default is "localhost". -->
         <!-- <port>: the port on which CLAMD listens. The default is "3310". -->
         <!-- <maxPings>: the maximum number of connection retries during startup. -->
         <!--     If the value is "0" no startup test will be done. -->
         <!--     The default is "6". -->
         <!-- <pingIntervalMilli>: the interval (in milliseconds) -->
         <!--     between each connection retry during startup. -->
         <!--     The default is "30000" (30 seconds). -->
         <!-- <streamBufferSize>: the BufferedOutputStream buffer size to use  -->
         <!--     writing to the stream connection. The default is "8192". -->
         <!--
         <mailet match="All" class="ClamAVScan" onMailetException="ignore">
            <debug> true </debug>
         </mailet>
         -->

         <!-- If infected go to virus processor -->
         <mailet match="HasMailAttributeWithValue=org.apache.james.infected, true" class="ToProcessor">
            <processor> virus </processor>
         </mailet>

         <!-- Check attachment extensions for possible viruses -->
         <!-- The "-z" option requests the check to be non-recursively applied -->
         <!-- to the contents of any attached '*.zip' file. -->
         <!--
         <mailet match="AttachmentFileNameIs=-d -z *.exe *.com *.bat *.cmd *.pif *.scr *.vbs *.avi *.mp3 *.mpeg *.shs" class="Bounce" onMatchException="error">
            <inline>heads</inline>
            <attachment>none</attachment>
            <passThrough>false</passThrough>
            <prefix>[REJECTED]</prefix>
            <notice>
The Security Policy of XXX does not allow to forward messages containing attachments having any of the extensions .exe, .com, .bat, .cmd, .pif, .scr, .vbs, .avi, .mp3, .mpeg, .shs, therefore your message has been rejected.

Please don't reply to this e-mail as it has been automatically sent by the antivirus system.

Regards, Postmaster XXX.YYY
.....................................
            </notice>
         </mailet>
         -->

         <!-- Whitelist Management -->
         <!-- Manages for each local user a "white list" of remote addresses whose messages -->
         <!-- should never be blocked as spam. -->
         <!-- -->
         <!-- If <automaticInsert> is true, it will check, for a local sender, if a remote recipient -->
         <!-- is already in the list: if not, it will be automatically inserted. -->
         <!-- This is under the interpretation that if a local sender X sends a message to a -->
         <!-- remote recipient Y, then later on if a message is sent by Y to X it should be -->
         <!-- considered always valid and never blocked; hence Y should be in the white list -->
         <!-- of X. -->
         <!-- -->
         <!-- Another mode of operations is when a local sender sends a message to <whitelistManagerAddress> -->
         <!-- with one of three specific values in the subject, to -->
         <!-- (i) send back a message displaying a list of the addresses in his own list (<displayFlag>); -->
         <!-- (ii) insert some new addresses in his own list (<insertFlag>); -->
         <!-- (iii) remove some addresses from his own list (<removeFlag>). -->
         <!-- In all of the three above cases the message will be ghosted and the postmaster will reply -->
         <!-- to the sender. -->
         <!-- -->
         <!-- The sender name is always converted to its primary name (handling aliases). -->
         <!--
         <mailet match="SMTPAuthSuccessful" class="WhiteListManager" onMailetException="ignore">
            <repositoryPath>db://maildb</repositoryPath>
            <automaticInsert>true</automaticInsert>
            <whitelistManagerAddress>whitelist.manager@xxx.yyy</whitelistManagerAddress>
            <displayFlag>display</displayFlag>
            <insertFlag>insert</insertFlag>
            <removeFlag>remove</removeFlag>
         </mailet>
         -->

         <!-- "not spam" bayesian analysis feeder. -->
         <!--
         <mailet match="RecipientIs=not.spam@xxx.yyy" class="BayesianAnalysisFeeder">
            <repositoryPath> db://maildb </repositoryPath>
            <feedType>ham</feedType>
            <maxSize>200000</maxSize>
         </mailet>
         -->
    
         <!-- "spam" bayesian analysis feeder. -->
         <!--
         <mailet match="RecipientIs=spam@xxx.yyy" class="BayesianAnalysisFeeder">
            <repositoryPath> db://maildb </repositoryPath>
            <feedType>spam</feedType>
            <maxSize>200000</maxSize>
         </mailet>
         -->

         <!-- sample SMIME mailets configuration -->
         <!-- In order to use SMIME capabilities you need to install the bouncycastle JCE -->
         <!-- provider in your environment (james/lib) -->
         <!-- e.g: bcprov-jdk14-129.jar from http://www.bouncycastle.org/latest_releases.html -->
         <!--
         <mailet match="IsSMIMEEncrypted" class="SMIMEDecrypt">
            <keyStoreType>pkcs12</keyStoreType>
            <keyStoreFileName>c:/path.pfx</keyStoreFileName>
            <keyStorePassword>myKeyStorePass</keyStorePassword>
            <keyAlias>myKeyAlias</keyAlias>
            <keyAliasPassword>myKeyPass</keyAliasPassword>
         </mailet>
        
         <mailet match="IsSMIMESigned" class="SMIMECheckSignature">
            <keyStoreType>pkcs12</keyStoreType>
            <keyStoreFileName>c:/path.pfx</keyStoreFileName>
            <keyStorePassword>myKeyStorePass</keyStorePassword>
            <strip>false</strip>
            <onlyTrusted>true</onlyTrusted>
         </mailet>
         -->

         <!--
         <mailet match="All" class="XMLVirtualUserTable">
            <!- 1:1 mapping ->
            <mapping>morgoth@middle-earth=sauron@mordor</mapping>
            <!- 1:n mapping ->
            <mapping>istari@middle-earth=saruman@isengard;radigast;gandalf</mapping>
            <!- DSN mapping ->
            <mapping>boromir@osgilliath=error:550 Requested action not taken: no such user here</mapping>
            <!- regex based mapping ->
            <mapping>*@osgilliath=regex:(.*)@osgilliath:${1}@minas-tirith</mapping>
            <!- both standard and regex mapping ->
            <mapping>ring@*=onering@mordor;regex:ring@(.*):ring@${1}</mapping>
            <!- conditional regex mapping example ->
            <mapping>*@listserver=regex:(.*)-on@listserver:${1}-subscribe@listserver;
                                  regex:(.*)-off@listserver:${1}-unsubscribe@listserver
            </mapping>
         </mailet>
         -->

         <!-- Anti-spam processing -->
         <!-- The following two entries avoid double anti-spam analysis -->
         <!-- for forwarded messages. -->
         <!-- Has spam checking already been done? -->
         <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
            <processor> transport </processor>
         </mailet>
         <!-- Spam checking will not be done twice -->
         <mailet match="All" class="SetMailAttribute">
            <spamChecked>true</spamChecked>
         </mailet>

         <!-- White List:
              If you use block lists, you will probably want to check
              for known permitted senders.  This is particularly true
              if you use more aggressive block lists, such as SPEWS,
              that are prone to block entire subnets without regard
              for non-spamming senders.
         -->

         <!-- Messages from authenticated senders never are spam -->
         <mailet match="SMTPAuthSuccessful" class="ToProcessor">
            <processor> transport </processor>
         </mailet>

         <!-- Messages signed by trusted users never are spam -->
         <!-- Uncommenting the following entry, messages with valid signatures will never be considered spam. -->
         <!-- This can be a valid policy *if* SMIMECheckSignature was invoked -->
         <!-- with <onlyTrusted>true</onlyTrusted> set -->
         <!--
         <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="ToProcessor">
            <processor> transport </processor>
         </mailet>
         -->

         <!-- specific known senders -->
         <!--
         <mailet match="SenderIs=goodboy@goodhost"
                 class="ToProcessor">
            <processor> transport </processor>
         </mailet>
         -->

         <!-- 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>
         -->

         <!-- If the sender is in a recipient's whitelist, it is a valid sender, -->
         <!-- and as such the message should not be considered spam for such recipient. -->
         <!--
         <mailet match="IsInWhiteList=db://maildb" class="ToProcessor" onMatchException="noMatch">
            <processor> transport </processor>
         </mailet>
         -->

         <!-- End of White List -->

         <!-- Check for delivery from a known spam server -->
         <!-- This set of matchers/mailets redirect all emails from known -->
         <!-- black holes, open relays, and spam servers to the spam processor -->
         <!-- For this set to function properly, the spam processor must be configured. -->
         <mailet match="InSpammerBlacklist=dnsbl.njabl.org."
                 class="ToProcessor">
           <processor> spam </processor>
           <notice>550 Requested action not taken: rejected - see http://njabl.org/ </notice>
         </mailet>
        
         <!-- Sample matching to kill a message (send to Null) -->
         <!--
         <mailet match="RecipientIs=badboy@badhost" class="Null"/>
         -->

         <!-- Anti spam bayesian analysis -->
         <!--
         <mailet match="All" class="BayesianAnalysis" onMailetException="ignore">
            <repositoryPath>db://maildb</repositoryPath>
        <maxSize>200000</maxSize>
            <headerName>X-MessageIsSpamProbability</headerName>
            <ignoreLocalSender>true</ignoreLocalSender>
         </mailet>

         <mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability > 0.90" class="SetMailAttribute" onMatchException="noMatch">
            <isSpam>true</isSpam>
         </mailet>

         <mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability > 0.90" class="SetMimeHeader" onMatchException="noMatch">
            <name>X-MessageIsSpam</name>
            <value>true</value>
         </mailet>

         <mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability > 0.99" class="ToProcessor" onMatchException="noMatch">
            <processor> spam </processor>
            <notice>Spam not accepted</notice>
         </mailet>
         -->

         <!-- 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">
         <!-- If you want to notify the sender their message generated an error, uncomment this       -->
         <!--
         <mailet match="All" class="Bounce"/>
         -->
         <!-- If you want to notify the postmaster that a message generated an error, uncomment this  -->
         <!--
         <mailet match="All" class="NotifyPostmaster"/>
         -->

         <!-- Logs any messages to the repository specified -->
         <mailet match="All" class="ToRepository">
            <repositoryPath> file://var/mail/error/</repositoryPath>
            <!-- An alternative database repository example follows. -->
            <!--
            <repositoryPath> db://maildb/deadletter/error </repositoryPath>
            -->
         </mailet>
      </processor>

      <!-- Processor CONFIGURATION SAMPLE: transport is a sample custom processor for local or -->
      <!-- remote delivery -->
      <processor name="transport">

        <!-- This is an example configuration including configuration for a list server. -->
        <!-- CHECKME: before uncommenting this, edit the configuration file's contents   -->
        <!--
          &listserverConfig;
        -->

         <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
            <name>X-UserIsAuth</name>
            <value>true</value>
         </mailet>
   
         <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
            <name>X-WasSigned</name>
            <value>true</value>
         </mailet>

  <mailet match="HostIsLocal" class="ToProcessor">
            <processor> local-address-error </processor>
            <notice>550 - Requested action not taken: no such user here</notice>

             
     
   
                <mailet match="All" class="RemoteDelivery">
            <outgoing> file://var/mail/outgoing/ </outgoing>

                      <delayTime>  5 minutes </delayTime>
            <delayTime> 10 minutes </delayTime>
            <delayTime> 45 minutes </delayTime>
            <delayTime>  2 hours </delayTime>
            <delayTime>  3 hours </delayTime>
            <delayTime>  6 hours </delayTime>
            <maxRetries> 25 </maxRetries>

                 <deliveryThreads> 1 </deliveryThreads>

                <sendpartial>false</sendpartial>
            
                 <bounceProcessor>bounces</bounceProcessor>

                    
   
         </mailet>

      </processor>



      <processor name="spam">
 

 

   

                <mailet match="All" class="ToRepository">
            <repositoryPath>file://var/mail/spam/</repositoryPath>

               </mailet>
      </processor>

        <processor name="virus">
      
             <mailet match="All" class="SetMailAttribute">
            <org.apache.james.infected>true, bouncing</org.apache.james.infected>
         </mailet>

                <mailet match="SMTPAuthSuccessful" class="Bounce">
            <inline>heads</inline>
            <attachment>none</attachment>
            <notice> Warning: We were unable to deliver the message below because it was found infected by virus(es). </notice>
         </mailet>

              <mailet match="All" class="Null" />
      </processor>

   
 

  

         <mailet match="All" class="ToRepository">
            <repositoryPath> file://var/mail/address-error/</repositoryPath>
         
         </mailet>
      </processor>

        <processor name="relay-denied">
       

           <mailet match="All" class="ToRepository">
            <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
                 </mailet>
      </processor>

        <processor name="bounces">
         <mailet match="All" class="DSNBounce">
            <passThrough>false</passThrough>

                      
                    
                  </mailet>
      </processor>
   </spoolmanager>

           <dnsserver>
      <servers>
         <!--Enter ip address of your DNS server, one IP address per server -->
         <!-- element. -->

                      <!--下面的配置很重要-->
                      <server>223.138.10.226</server> <!--添自己的服务器IP地址-->
                     <server>223.13.200.232</server>   <!--添自己的服务器dns地址-->
                    <server>223.13.218.120</server><!--添自己的服务器被选dns地址-->
                               </servers>
      <!-- Change autodiscover to false if you would like to turn off autodiscovery -->
      <!-- and set the DNS servers manually in the <servers> section -->
      <autodiscover>false</autodiscover>
      <authoritative>false</authoritative>

      <!-- Maximum number of entries to maintain in the DNS cache -->
      <maxcachesize>50000</maxcachesize>
   </dnsserver>

      <remotemanager enabled="true">
      <port>4555</port>
          <handler>
                <helloName autodetect="true">myMailServer</helloName>
         <administrator_accounts>

                      <account login="root" password="***"/><!--密码自己设定-->
         </administrator_accounts>
         <connectiontimeout> 60000 </connectiontimeout>
         <!-- The prompt directive adds a prompt to every output from RemoteManager -->
         <!--
         <prompt>james&gt;</prompt>
         -->
      </handler>
   </remotemanager>

  
   <pop3server enabled="true">
    
      <port>110</port>
      <handler>
         <helloName autodetect="true">myMailServer</helloName>
         <connectiontimeout>120000</connectiontimeout>
      </handler>
   </pop3server>

   
   <smtpserver enabled="true">
    
      <port>25</port>
      <handler>
         <helloName autodetect="true">myMailServer</helloName>
         <connectiontimeout>360000</connectiontimeout>
          <authRequired>true</authRequired>
       <!-- <authorizedAddresses>127.0.0.0/8</authorizedAddresses>-->
         <maxmessagesize>0</maxmessagesize>   
      </handler>
   </smtpserver>
   <nntpserver enabled="true">
      <port>119</port>
      <handler>
         <helloName autodetect="true">myMailServer</helloName>
         <connectiontimeout>120000</connectiontimeout>
         <authRequired>false</authRequired>
      </handler>
   </nntpserver>

   <nntp-repository>
      <readOnly>false</readOnly>

      <rootPath>file://var/nntp/groups</rootPath>
      <tempPath>file://var/nntp/temp</tempPath>
      <articleIDPath>file://var/nntp/articleid</articleIDPath>
      <articleIDDomainSuffix>news.james.apache.org</articleIDDomainSuffix>

      <!-- The news groups hosted in this NNTP repository. -->
      <!-- Groups here will be added to those found in the file system,
           but removing groups from here will NOT remove them from the
           server.  Change <newsgroups> to <newsgroups only="true"> to
           restrict newsgroups to ONLY those found in this list.  -->
      <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://var/nntp/spool</spoolPath>
            <!-- The number of threads that process spooler related tasks. -->
            <threadCount>1</threadCount>
            <!-- The spool thread(s) should idle for some time, if it has nothing to do  -->
            <threadIdleTime>60000</threadIdleTime>
         </configuration>
      </spool>
   </nntp-repository>

    
     <!-- The Mailstore block -->
   <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>

                <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>
               <maxcache>1000</maxcache>
                       </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>
               <maxcache>1000</maxcache>
            </config>
         </repository>

         <!-- The mbox repository is designed for MAIL only; SPOOL performance would be less than ideal-->
         <repository class="org.apache.james.mailrepository.MBoxMailRepository">
            <protocols>
               <protocol>mbox</protocol>
            </protocols>
            <types>
               <type>MAIL</type>
            </types>
         </repository>

         <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>

   </mailstore>


   <!-- The User Storage block -->
   <users-store>
      <!-- Configure User Repositories here. -->
                 <repository name="LocalUsers" class="org.apache.james.userrepository.JamesUsersJdbcRepository" destinationURL="db://maildb/users">
         <sqlFile>file://conf/sqlResources.xml</sqlFile>
      </repository>

 

               </users-store>

   <!-- The database-connections block -->
   <database-connections>
      <!-- These connections are referred to by name elsewhere in the config file -->
<!-- CHECKME! -->
      <!-- To allow James to use a database you must configure the database connection here. -->
      <!-- If you are not using a database, you can leave this section unchanged. -->
      <!-- These connections are referred to by name in URLs elsewhere in the config file. -->

      
              <!-- JDBC driver .jar libraries for other RDBMS can be placed in ~james/lib/  -->

          <data-source name="maildb" class="org.apache.james.util.dbcp.JdbcDataSource">
         <driver>com.mysql.jdbc.Driver</driver>
         <dburl>jdbc:mysql://localhost/carmail?autoReconnect=true</dburl>
         <user>root</user>
         <password>******</password>
         <max>20</max>
      </data-source>
     

     

         </database-connections>


 



   <connections>
      <idle-timeout>300000</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>5</priority>
         <is-daemon>false</is-daemon>
         <max-threads>100</max-threads>
         <min-threads>20</min-threads>
         <min-spare-threads>20</min-spare-threads>
      </thread-group>
   </thread-manager>
</config>

         配置好了后,

你到mysql里面见一个数据库和上面配置文件里面的datasource要统一,先不要建表。

到apache-james-2.3.2/james-2.3.2/bin目录下启动run.bat doc窗口不消失的话,表示启动成功,显示如下:

   如果能显示这个,你再到mysql服务器去看看,是不是有一个users表已经创建好了,

  接下来你可以  通过在 cmd 里面的 doc窗口里面 telnet 登录服务器,进行用户的添加,命令如下:

  telnet 服务器名 或者服务器IP 空格  端口 就可登录了

 ( 端口在前面的配置文件里面已经配置好了),你可以通过adduser 用户名   密码 来进行添加用户

   输入 help可以查看相关的命令。

       接下来配置Claros-intouche2,到Claros-intouche2的网站上去下载Claros-intouche2.1的软件包

   解压在目录:claros-intouch-2.1/claros-intouch-2.1下面有个intouch2.war的包,把它解压到tomcat的发布目录下,然后在到intouch2/WEB-INF/config目录下有个config.xm,对它修改如下:<?xml version="1.0" encoding="UTF-8"?>
<claros-config>
 <!-- COMMON PARAMETERS -->
  <common-params>
        <charset>utf-8</charset>
        <server-timezone>Europe/Istanbul</server-timezone>
        <tmp-dir>E:/carcaremail/ROOT/tmp</tmp-dir><!--这里这个目录,你最好写个绝对路径,在这个目录下建好这个文件夹-->
        <max-attachment-size>5</max-attachment-size>
        <max-mail-size>10</max-mail-size>
        <title>Claros inTouch 2.1</title>
        <spam-check-enabled>false</spam-check-enabled>
        <default-lang>zh_cn_utf8</default-lang>
        <rss-feed>http://rss.cnn.com/rss/cnn_topstories.rss</rss-feed>
    </common-params>


  <chat>
  <default-domain>claros.org</default-domain>
  <msn-transport>msn.claros.org</msn-transport>
  <yahoo-transport>yahoo.claros.org</yahoo-transport>
  <icq-transport>icq.claros.org</icq-transport>
  <aol-transport>aol.claros.org</aol-transport>
 </chat>

 <!-- MAIL SERVER SETUP --> 
 <servers>
  <server>
   <!-- give any name you desire -->
   <shortname>mail.weixiuche.com</shortname>
   <!-- your imap/pop3 server ip/dns -->
   <fetch-server>mail.weixiuche.com</fetch-server>
   <!-- port you are running the pop3/imap server -->
   <fetch-server-port>110</fetch-server-port>
   <!-- which protocol? valid values are imap or pop3 (case sensitive) -->
   <fetch-protocol>pop3</fetch-protocol>
                     <fetch-ssl>false</fetch-ssl>
   <!-- your smtp server's ip/dns -->
   <smtp-server>mail.weixiuche.com</smtp-server>
                   <smtp-server-port>25</smtp-server-port>
                       <smtp-authenticated>true</smtp-authenticated>
                       <smtp-ssl>false</smtp-ssl>
   <!-- IMAP only: if you use courier or cyrus you'll need to set the following to  "INBOX." (with the dot(.) but omit the quotes) -->
   <folder-namespace></folder-namespace>
  </server>
 </servers>

 <!-- THE DATABASE SETUP -->
 <!--
  Please note that DB setup is essential to work. There is a intouch-mysql file in the SQL  directory
  of the zip file. Please create a database and dump the sql file to the db.
  
  mysqladmin -u root -p create intouch
  mysql -u root -p intouch < intouch-mysql.sql
  -->
 <db-config>
  <db>
   <!-- do not change the term file!!! -->
   <id>file</id>
   <!-- the connection url for the JDBC connection -->
   <database>jdbc:mysql://localhost:3306/carmail</database>
   <!-- the connection class -->
   <driver>com.mysql.jdbc.Driver</driver>
   <!-- the user with read/write/delete/update/select permission to the database  -->
   <login>root</login>
   <password>*****</password>  <!--mysql数据库密码自己填写-->
  </db>
 </db-config>
</claros-config>

  还有就是把Claros-intouche2.1包里面的sql导入到上面建好的数据库中

启动james服务器,和tomcat  通过浏览器用你 在james服务器上建好的用户名登录,即可!

至此,配置完成,有什么问题请留言,谢谢!

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值