<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 40, comments - 58, trackbacks - 0, articles - 0
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    Apache James 收發(fā)內(nèi)外網(wǎng)郵件的配置

    Posted on 2008-08-25 15:35 Astro.Qi 閱讀(5335) 評論(4)  編輯  收藏 所屬分類: Java
    說明:1.James2.3.1部署的這臺機(jī)器的域名是xizangmilin.gov.cn 對應(yīng)的外網(wǎng)IP是202.98.244.10
          2.dns是202.98.224.69
          3.hosts文件中的IP映射是202.98.244.10  xizangmilin.gov.cn
          4.以下是配置文件的原型,注意紅色部分
      1 <?xml version="1.0"?>
      2 <!DOCTYPE config [
      3 <!ENTITY listserverConfig SYSTEM "../conf/james-listmanager.xml">
      4 <!ENTITY listserverStores SYSTEM "../conf/james-liststores.xml">
      5 <!ENTITY fetchmailConfig SYSTEM "../conf/james-fetchmail.xml">
      6 <!ENTITY smtphandlerchainConfig SYSTEM "../conf/james-smtphandlerchain.xml">
      7 ]>
      8 
      9 <config>
     10    <James>
     11 
     12       <postmaster>Postmaster@xizangmilin.gov.cn</postmaster>
     13       <servernames autodetect="false" autodetectIP="false">
     14          <servername>xizangmilin.gov.cn</servername>
     15       </servernames>
     16 
     17       <usernames ignoreCase="true" enableAliases="true" enableForwarding="true"/>
     18 
     19       <inboxRepository>
     20          <repository destinationURL="file://var/mail/inboxes/" type="MAIL"/>
     21       </inboxRepository>
     22 
     23    </James>
     24 
     25    &fetchmailConfig;
     26 
     27    <mailetpackages>
     28       <mailetpackage>org.apache.james.transport.mailets</mailetpackage>
     29       <mailetpackage>org.apache.james.transport.mailets.smime</mailetpackage>
     30    </mailetpackages>
     31    <matcherpackages>
     32       <matcherpackage>org.apache.james.transport.matchers</matcherpackage>
     33       <matcherpackage>org.apache.james.transport.matchers.smime</matcherpackage>
     34    </matcherpackages>
     35 
     36    <spoolmanager>
     37       <threads> 10 </threads>
     38       <processor name="root">
     39          <mailet match="All" class="PostmasterAlias"/>
     40          <mailet match="RelayLimit=30" class="Null"/>
     41          <mailet match="HasMailAttributeWithValue=org.apache.james.infected, true" class="ToProcessor">
     42             <processor> virus </processor>
     43          </mailet>
     44          <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
     45             <processor> transport </processor>
     46          </mailet>
     47 
     48          <mailet match="All" class="SetMailAttribute">
     49             <spamChecked>true</spamChecked>
     50          </mailet>
     51          <mailet match="SMTPAuthSuccessful" class="ToProcessor">
     52             <processor> transport </processor>
     53          </mailet>
     54 
     55          <mailet match="InSpammerBlacklist=query.bondedsender.org."
     56                  class="ToProcessor">
     57            <processor> transport </processor>
     58          </mailet>
     59 
     60          <mailet match="InSpammerBlacklist=dnsbl.njabl.org."
     61                  class="ToProcessor">
     62            <processor> spam </processor>
     63            <notice>550 Requested action not taken: rejected - see http://njabl.org/ </notice>
     64          </mailet>
     65          
     66          <mailet match="All" class="ToProcessor">
     67             <processor> transport </processor>
     68          </mailet>
     69       </processor>
     70 
     71       <processor name="error">
     72          <mailet match="All" class="ToRepository">
     73             <repositoryPath> file://var/mail/error/</repositoryPath>
     74          </mailet>
     75       </processor>
     76       <processor name="transport">
     77 
     78          <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
     79             <name>X-UserIsAuth</name>
     80             <value>true</value>
     81          </mailet>
     82     
     83          <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
     84             <name>X-WasSigned</name>
     85             <value>true</value>
     86          </mailet>
     87 
     88          <mailet match="RecipientIsLocal" class="LocalDelivery"/>
     89 
     90          <mailet match="HostIsLocal" class="ToProcessor">
     91             <processor> local-address-error </processor>
     92             <notice>550 - Requested action not taken: no such user here</notice>
     93          </mailet>
     94 
     95          <mailet match="All" class="RemoteDelivery">
     96             <outgoing> file://var/mail/outgoing/ </outgoing>
     97             <delayTime>  5 minutes </delayTime>
     98             <delayTime> 10 minutes </delayTime>
     99             <delayTime> 45 minutes </delayTime>
    100             <delayTime>  2 hours </delayTime>
    101             <delayTime>  3 hours </delayTime>
    102             <delayTime>  6 hours </delayTime>
    103             <maxRetries> 25 </maxRetries>
    104             <deliveryThreads> 1 </deliveryThreads>
    105             <sendpartial>false</sendpartial>
    106             <bounceProcessor>bounces</bounceProcessor>
    107          </mailet>
    108       </processor>
    109       
    110       <processor name="spam">
    111          <mailet match="All" class="ToRepository">
    112             <repositoryPath>file://var/mail/spam/</repositoryPath>
    113          </mailet>
    114       </processor>
    115 
    116       <processor name="virus">
    117          <mailet match="All" class="SetMailAttribute">
    118             <org.apache.james.infected>true, bouncing</org.apache.james.infected>
    119          </mailet>
    120          <mailet match="SMTPAuthSuccessful" class="Bounce">
    121             <inline>heads</inline>
    122             <attachment>none</attachment>
    123             <notice> Warning: We were unable to deliver the message below because it was found infected by virus(es). </notice>
    124          </mailet>
    125 
    126          <mailet match="All" class="Null" />
    127       </processor>
    128 
    129       
    130       <processor name="local-address-error">
    131          <mailet match="All" class="ToRepository">
    132             <repositoryPath> file://var/mail/address-error/</repositoryPath>
    133          </mailet>
    134       </processor>
    135 
    136       <processor name="relay-denied">
    137          <mailet match="All" class="ToRepository">
    138             <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
    139          </mailet>
    140       </processor>
    141 
    142       <processor name="bounces">
    143          <mailet match="All" class="DSNBounce">
    144             <passThrough>false</passThrough>
    145           </mailet>
    146       </processor>
    147    </spoolmanager>
    148 
    149 
    150    <dnsserver>
    151       <servers>
    152           <server>202.98.224.69</server>            <!-- dns -->
    153           <server>xizangmilin.gov.cn</server>       <!-- localhost -->
    154       </servers>
    155       <autodiscover>false</autodiscover>
    156       <authoritative>false</authoritative>
    157       <maxcachesize>50000</maxcachesize>
    158    </dnsserver>
    159 
    160    <remotemanager enabled="true">
    161       <port>4555</port>
    162       <handler>
    163          <helloName autodetect="true">myMailServer</helloName>
    164          <administrator_accounts>
    165             <account login="root" password="123456"/>
    166          </administrator_accounts>
    167          <connectiontimeout> 60000 </connectiontimeout>
    168       </handler>
    169    </remotemanager>
    170 
    171    <pop3server enabled="true">
    172       <port>110</port>
    173 
    174       <handler>
    175          <helloName autodetect="true">myMailServer</helloName>
    176          <connectiontimeout>120000</connectiontimeout>
    177       </handler>
    178    </pop3server>
    179 
    180    <smtpserver enabled="true">
    181       <port>25</port>
    182       <handler>
    183          <helloName autodetect="true">myMailServer</helloName>
    184          <connectiontimeout>360000</connectiontimeout>
    185          <authRequired>true</authRequired>
                       <verifyIdentity>true</verifyIdentity>
    186          <authorizedAddresses>127.0.0.0/8</authorizedAddresses>
    187          <maxmessagesize>0</maxmessagesize>
    188       </handler>
    189    </smtpserver>
    190 
    191    <nntpserver enabled="true">
    192       <port>119</port>
    193       <handler>
    194          <helloName autodetect="true">myMailServer</helloName>
    195          <connectiontimeout>120000</connectiontimeout>
    196          <authRequired>false</authRequired>
    197       </handler>
    198    </nntpserver>
    199 
    200    <nntp-repository>
    201       <readOnly>false</readOnly>
    202 
    203       <rootPath>file://var/nntp/groups</rootPath>
    204       <tempPath>file://var/nntp/temp</tempPath>
    205       <articleIDPath>file://var/nntp/articleid</articleIDPath>
    206       <articleIDDomainSuffix>news.james.apache.org</articleIDDomainSuffix>
    207       <newsgroups>
    208          <newsgroup>org.apache.james.dev</newsgroup>
    209          <newsgroup>org.apache.james.user</newsgroup>
    210          <newsgroup>org.apache.avalon.dev</newsgroup>
    211          <newsgroup>org.apache.avalon.user</newsgroup>
    212       </newsgroups>
    213 
    214       <spool>
    215          <configuration>
    216             <spoolPath>file://var/nntp/spool</spoolPath>
    217             <threadCount>1</threadCount>
    218             <threadIdleTime>60000</threadIdleTime>
    219          </configuration>
    220       </spool>
    221    </nntp-repository>
    222 
    223    <spoolrepository destinationURL="file://var/mail/spool/" type="SPOOL"/>
    224    <mailstore>
    225       <repositories>
    226          <repository class="org.apache.james.mailrepository.AvalonMailRepository">
    227             <protocols>
    228                <protocol>file</protocol>
    229             </protocols>
    230             <types>
    231                <type>MAIL</type>
    232             </types>
    233          </repository>
    234          <repository class="org.apache.james.mailrepository.AvalonSpoolRepository">
    235             <protocols>
    236                <protocol>file</protocol>
    237             </protocols>
    238             <types>
    239                <type>SPOOL</type>
    240             </types>
    241          </repository>
    242 
    243          <repository class="org.apache.james.mailrepository.JDBCMailRepository">
    244             <protocols>
    245                <protocol>db</protocol>
    246             </protocols>
    247             <types>
    248                <type>MAIL</type>
    249             </types>
    250             <config>
    251                <sqlFile>file://conf/sqlResources.xml</sqlFile>
    252             </config>
    253          </repository>
    254 
    255          <repository class="org.apache.james.mailrepository.JDBCSpoolRepository">
    256             <protocols>
    257                <protocol>db</protocol>
    258             </protocols>
    259             <types>
    260                <type>SPOOL</type>
    261             </types>
    262             <config>
    263                <sqlFile>file://conf/sqlResources.xml</sqlFile>
    264                <maxcache>1000</maxcache>
    265             </config>
    266          </repository>
    267 
    268          <repository class="org.apache.james.mailrepository.JDBCMailRepository">
    269             <protocols>
    270                <protocol>dbfile</protocol>
    271             </protocols>
    272             <types>
    273                <type>MAIL</type>
    274             </types>
    275             <config>
    276                <sqlFile>file://conf/sqlResources.xml</sqlFile>
    277                <filestore>file://var/dbmail</filestore>
    278             </config>
    279          </repository>
    280 
    281          <repository class="org.apache.james.mailrepository.JDBCSpoolRepository">
    282             <protocols>
    283                <protocol>dbfile</protocol>
    284             </protocols>
    285             <types>
    286                <type>SPOOL</type>
    287             </types>
    288             <config>
    289                <sqlFile>file://conf/sqlResources.xml</sqlFile>
    290                <filestore>file://var/dbmail</filestore>
    291                <maxcache>1000</maxcache>
    292             </config>
    293          </repository>
    294 
    295          <repository class="org.apache.james.mailrepository.MBoxMailRepository">
    296             <protocols>
    297                <protocol>mbox</protocol>
    298             </protocols>
    299             <types>
    300                <type>MAIL</type>
    301             </types>
    302          </repository>
    303 
    304          <repository class="org.apache.james.mailrepository.filepair.File_Persistent_Object_Repository">
    305             <protocols>
    306                <protocol>file</protocol>
    307             </protocols>
    308             <types>
    309                <type>OBJECT</type>
    310             </types>
    311             <models>
    312                <model>SYNCHRONOUS</model>
    313                <model>ASYNCHRONOUS</model>
    314                <model>CACHE</model>
    315             </models>
    316          </repository>
    317 
    318          <repository class="org.apache.james.mailrepository.filepair.File_Persistent_Stream_Repository">
    319             <protocols>
    320                <protocol>file</protocol>
    321             </protocols>
    322             <types>
    323                <type>STREAM</type>
    324             </types>
    325             <models>
    326                <model>SYNCHRONOUS</model>
    327                <model>ASYNCHRONOUS</model>
    328                <model>CACHE</model>
    329             </models>
    330          </repository>
    331       </repositories>
    332 
    333    </mailstore>
    334 
    335    <users-store>
    336          
    337       <repository name="LocalUsers" class="org.apache.james.userrepository.JamesUsersJdbcRepository" destinationURL="db://maildb/m_user">
    338          <sqlFile>file://conf/sqlResources.xml</sqlFile>
    339       </repository>
    340    </users-store>
    341 
    342    <database-connections>   
    343          <data-source name="maildb" class="org.apache.james.util.dbcp.JdbcDataSource">
    344           <driver>oracle.jdbc.driver.OracleDriver</driver>
    345           <dburl>jdbc:oracle:thin:@192.168.1.21:1521:***</dburl>
    346           <user>***</user>
    347           <password>***</password>
    348           <max>20</max>
    349      </data-source>
    350 
    351    </database-connections>
    352 
    353    <connections>
    354       <idle-timeout>300000</idle-timeout>
    355       <max-connections>30</max-connections>
    356    </connections>
    357 
    358    <sockets>
    359       <server-sockets>
    360          <factory name="plain" class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"/>
    361       </server-sockets>
    362       <client-sockets>
    363          <factory name="plain" class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory"/>
    364       </client-sockets>
    365    </sockets>
    366 
    367    <thread-manager>
    368       <thread-group>
    369          <name>default</name>
    370          <priority>5</priority>
    371          <is-daemon>false</is-daemon>
    372          <max-threads>100</max-threads>
    373          <min-threads>20</min-threads>
    374          <min-spare-threads>20</min-spare-threads>
    375       </thread-group>
    376    </thread-manager>
    377 </config>
    378 

    評論

    # re: Apache James 收發(fā)內(nèi)外網(wǎng)郵件的配置[未登錄]  回復(fù)  更多評論   

    2009-05-05 15:37 by Jeffrey
    HI,

    請問當(dāng)我加新的域名如何可以不用從新起動服務(wù)器?
    當(dāng)我用<authRequired>true</authRequired>, JAMES 不能發(fā)覺我的新域名.

    謝謝

    # re: Apache James 收發(fā)內(nèi)外網(wǎng)郵件的配置  回復(fù)  更多評論   

    2010-05-24 17:11 by LuckyZhang
    如上配置,可以正常發(fā)送到外網(wǎng),但是無法正常從外網(wǎng)接收。我環(huán)境是CentOS5.2+Jame2.3.2+Intouch2.1+MySql5.0
    Intouch可以發(fā)送到外網(wǎng),沒有問題。但是outlook,F(xiàn)oxmail不可以發(fā)送。全部都不可以接收外網(wǎng)過來的郵件,會出pop異常。暫未解決,期待達(dá)人指點(diǎn)。
    qq:4639966

    # re: Apache James 收發(fā)內(nèi)外網(wǎng)郵件的配置  回復(fù)  更多評論   

    2012-11-06 13:48 by gxy
    安裝上面的配置,能發(fā)送到外網(wǎng),但不能接受外網(wǎng)的郵件,比如163

    # re: Apache James 收發(fā)內(nèi)外網(wǎng)郵件的配置  回復(fù)  更多評論   

    2012-11-29 10:29 by gxy
    不能刪除郵件,樓主有遇到過這個問題嗎?
    主站蜘蛛池模板: 色噜噜亚洲男人的天堂| 亚洲已满18点击进入在线观看| 亚洲综合丁香婷婷六月香| 免费看一级一级人妻片| 91av免费观看| 国产精品四虎在线观看免费 | 日本特黄特色AAA大片免费| 日韩在线不卡免费视频一区| 国产精品免费综合一区视频| 亚洲精品福利视频| 精品视频免费在线| 成年人免费的视频| 伊人久久综在合线亚洲91| 亚洲人精品亚洲人成在线| a级精品九九九大片免费看| 岛国片在线免费观看| 亚洲第一视频网站| 色老头综合免费视频| 一个人免费观看www视频在线| 伊伊人成亚洲综合人网7777| 亚洲欧美自偷自拍另类视| 久久99精品视免费看| 亚洲精品无码你懂的网站| 亚洲精品人成网在线播放影院| 伊人免费在线观看| 免费a级毛片无码av| 亚洲av成人一区二区三区| 一个人看的www免费视频在线观看| 国产一区二区三区免费在线观看| 亚洲最大的视频网站| a级毛片毛片免费观看久潮喷| 国产视频精品免费| 亚洲人成在线免费观看| 久久精品成人免费观看| 亚洲高清无码专区视频| 亚洲风情亚Aⅴ在线发布| 免费视频爱爱太爽了| 亚洲三级电影网址| 三年片免费高清版 | 青青草国产免费久久久91| 亚洲精品视频免费看|