2012-05-02 3 views
2

Spring 통합 메일을 사용하여 IMAP을 사용하여 Microsoft Exchange 2010에 연결하려고합니다. 제 질문은 연결 문자열이 어떻게 생겼는지입니다.Spring 통합 메일로 Microsoft Exchange Server에 연결

의가 있다고 가정 해 봅시다 :

domain=earth 
user=jdoe 
[email protected] 
Folder=inbox 

는 지금까지 내가 아는 한, MS Exchange는 단지 연결을위한 IMAPS을 지원합니다.

내 봄 통합 설정은 다음과 같습니다

<util:properties id="javaMailProperties"> 
    <prop key="mail.imaps.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop> 
    <prop key="mail.imaps.socketFactory.fallback">false</prop> 
    <prop key="mail.store.protocol">imaps</prop> 
    <prop key="mail.debug">true</prop> 
</util:properties> 

<mail:inbound-channel-adapter id="imapAdapter" 
    store-uri="imaps://earth/jdoe/jon.doe:[email protected]/inbox" channel="recieveEmailChannel" 
    should-delete-messages="false" should-mark-messages-as-read="true" 
    auto-startup="true" java-mail-properties="javaMailProperties"> 
    <int:poller fixed-delay="5" 
     time-unit="SECONDS" /> 
</mail:inbound-channel-adapter> 

<int:channel id="recieveEmailChannel" /> 

<int:service-activator input-channel="recieveEmailChannel" 
    ref="mailReceiver" method="receive" /> 

<bean id="mailReceiver" 
    class="com.earth.MailReceiver" /> 

답변

2

지금 알아보십시오. 그것은 연결 문자열로 뭔가를 할 필요가 없습니다. Exchange에 연결하려는 사람들을 위해 여기에 몇 가지 힌트를 제공합니다.

<util:properties id="javaMailProperties"> 
    <prop key="mail.imaps.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop> 
    <prop key="mail.imap.starttls.enable">true</prop> 
    <prop key="mail.imaps.socketFactory.fallback">false</prop> 
    <prop key="mail.store.protocol">imaps</prop> 
    <prop key="mail.debug">true</prop> 
</util:properties> 

<mail:inbound-channel-adapter id="imapAdapter" 
    store-uri="imap://<username>:<password>@<exchange-url>/INBOX" channel="recieveEmailChannel" 
    should-delete-messages="false" should-mark-messages-as-read="false" 
    auto-startup="true" java-mail-properties="javaMailProperties"> 
    <int:poller fixed-delay="5" 
    time-unit="SECONDS" /> 
</mail:inbound-channel-adapter> 

<int:channel id="recieveEmailChannel" /> 

<int:service-activator input-channel="recieveEmailChannel" 
    ref="reviewMailService" method="receive" /> 

는 일반적으로 Exchange가 STARTTLS 연결을 IMAPS을 사용

여기 내 설정이다. http://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java

0
  1. IMAPS 후 첫 번째 노드 : 서버의 FQDN 할 필요가 //이 아닌 도메인 (예 : email.earth.com) . 여기 http://www.oracle.com/technetwork/java/faq-135477.html
  2. 교환 자격 증명에 대한 질문이 있습니다
  3. 는 IIRC, IMAP은 하지 거래소에 기본적으로 사용하고 관리가 가능해야한다.
+0

가 어떻게 FQDN 후 연결 문자열의 형식이 될 것입니다 :

는 SSL 핸드 쉐이크, 당신은 InstallCert 자바 프로그램을 사용할 수 있습니다를 수행하려면? – Philipp

+0

죄송합니다. 나는 당신의 URL을 잘못 읽었습니다 - 나는 당신이 user @ fqdn을 가졌다 고 봅니다. faq은 domain \ user \ emailid @ fqdn이 필요하다고 말하는 것 같습니다. –