Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8452437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:29:59+00:00 2026-06-10T11:29:59+00:00

I have a Spring Integration process created to process email messages programatically. It works

  • 0

I have a Spring Integration process created to process email messages programatically. It works fine from my IDE, but fails when I deploy it to our Tomcat Unix server.
I’m running JDK 1.6.0.4, Tomcat 7.0.29, Grails 2.0.4, Spring Integration 2.1.3, and JavaMail 1.4.5. I’m trying to figure out how to get proxy settings configured so that I can run this. I’ve seen posts from 2010 saying that it’s not possible, but it looks like there are JavaMail properties for it now.

I did try setting -DsocksProxyHost=myproxy.mycompany.com in the Tomcat setenv.sh, but my app failed before it even got to the mail part because it then couldn’t access internal sites (like our datatbase connection)

I’ve looked at the JavaMail API – FAQ and I think I’m setting things up correctly, but it keeps timing out.

Has anyone successfully setup email proxies for Spring Integration processes?

Snippet from my Spring Integration XML file:

<util:properties id="javaMailProperties">
    <prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
    <prop key="mail.imap.socketFactory.fallback">false</prop>
    <prop key="mail.store.protocol">imaps</prop>
    <prop key="mail.debug">true</prop>
    <prop key="mail.smtp.socks.host">socksproxy.mycompany.com</prop>
    <prop key="mail.smtp.socks.port">1080</prop>
    <prop key="mail.imap.socks.host">socksproxy.mycompany.com</prop>
    <prop key="mail.imap.socks.port">1080</prop>
</util:properties>

<mail:inbound-channel-adapter id="imapAdapter"
                              store-uri="imaps://myEmailAddress:myPassword@imap.gmail.com/INBOX"
                              java-mail-properties="javaMailProperties"
                              channel="receiveEmailChannel"
                              should-delete-messages="false"
                              should-mark-messages-as-read="true"
                              auto-startup="true">
    <int:poller max-messages-per-poll="1" fixed-rate="15" time-unit="SECONDS">
    </int:poller>
</mail:inbound-channel-adapter>

Solution

Based on Bill Shannon’s response, I updated my javaMailProperties to the snippet below and everything is working as expected.

<util:properties id="javaMailProperties">
    <prop key="mail.store.protocol">imaps</prop>
    <prop key="mail.imap.ssl.enable">true</prop>
    <prop key="mail.debug">true</prop>
    <prop key="mail.imaps.socks.host">socksproxy.mycompany.com</prop>
    <prop key="mail.imaps.socks.port">1080</prop>
</util:properties>

I think it’s important to point out the fine print from the JavaDocs…

Note that if you’re using the “imaps” protocol to access IMAP over SSL, all the properties would be named “mail.imaps.*”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:30:01+00:00Added an answer on June 10, 2026 at 11:30 am

    There’s at least two problems…

    First, you don’t need the socket factory settings.

    Second, you’re using the imaps protocol, but setting properties for the imap protocol.

    Either set mail.store.protocol to imap and set mail.imap.ssl.enable to true, or change all the mail.imap.* properties to mail.imaps.* properties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing web app using Spring Integration to route my messages, but I have
I have a Spring JUnit test with configuration files and @ContextConfiguration parameters: package ru.csbi.registry.domain.envers.integration;
I have a Spring Batch process which has following kind of code. <step id=step1
I have a self-executable jar program that relies heavily on Spring Integration. The problem
I have an event-driven application based on MDB, spring integration and JPA for persistence.
I have a spring-integration transformer that accepts a org.w3c.dom.Document and returns a domain object.
I have a Spring Integration project where I am trying to call a method
I have a Spring Integration application which needs to be relatively resource efficient. I
Please, help me understand the following. I have an spring integration test, which I'm
I have a Grails webapp running a Spring Integration inbound-channel-adapter that is configured to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.