function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pamalpamal 

Email2Case: how can I specify the HTTP Proxy to be used ?

Trying to configure Email2Case for accessing sfdc via HTTPS through the corporate HTTP Proxy, I've added the following 4 java system properties definitions in email2case.bat: -Dhttps.proxySet=true -Dhttps.proxyHost=<proxy hostname> -Dhttps.proxyPort=<proxy port> -Dhttps.proxyType=4
 
This kind of setting works fine with any "regular Java application", but with Email2Case it simply doesn't work: a network trace shows that the proxy is not called at all - the call is attempted direclty on sfdc.com, so Email2Case simply ignores these 4 parameters.
 
Is there a way to specify the proxy to be used by Email2Case ?
 
 
ChrisS_SFDCChrisS_SFDC

This is related to how the axis client being used interprets the httpProxy settings.  My understanding is that this is being addressed soon.  However, as a workaround, you can alter the CommonsHTTPSender clas delivered with the distribution.  Here is an example:

Code:

/*
 * The Apache Software License, Version 1.1 Copyright (c) 2001-2003 The Apache Software Foundation. All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
 * following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation and/or other materials provided with the
 * distribution. 3. The end-user documentation included with the redistribution, if any, must include the following
 * acknowledgment: "This product includes software developed by the Apache Software Foundation
 * (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such
 * third-party acknowledgments normally appear. 4. The names "Axis" and "Apache Software Foundation" must not be used to
 * endorse or promote products derived from this software without prior written permission. For written permission,
 * please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache"
 * appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED
 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION
 * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE. ==================================================================== This software
 * consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more
 * information on the Apache Software Foundation, please see <http://www.apache.org/>.
 * ====================================================================
 * ==================================================================== This file is based on the CommonsHTTPSender that
 * ships with Axis 1.1 It has the following changes from that version a) the ConnectionManager is now static, so that we
 * do connection pooling across instances of the class b) we set the hostConfiguration so that proxy settings get picked
 * up correctly. c) the following values are pulled from settings.xml max connections max connections per host
 * connection factory timeout connection timeout [the data timeout continues to be set from the message context] d) the
 * axis specific logging code is pulled
 *
 *  * Copyright (c) 2005, salesforce.com, inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided
 * that the following conditions are met:
 *
 *    Redistributions of source code must retain the above copyright notice, this list of conditions and the
 *    following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 *    the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 *    Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or
 *    promote products derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

package com.sforce;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Hashtable;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

import org.apache.axis.AxisFault;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.encoding.Base64;
import org.apache.axis.handlers.BasicHandler;
import org.apache.axis.soap.SOAP12Constants;
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.axis.utils.Messages;
import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.HttpMethodBase;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.log4j.Logger;

import com.sforce.util.TextUtil;


//import shared.util.TextUtil;

/**
 * This class uses Jakarta Commons's HttpClient to call a SOAP server.
 *
 * @author for sfdc Simon Fell (for axis Davanum Srinivas (dims@yahoo.com))
 * @since 136
 */
public class CommonsHTTPSender extends BasicHandler {

    /**
     * SFDC makes use of Axis for a number of different things, we can't configure all the axis clients the same way.
     * You can set the following properties on the message context to control HTTP level features for that particular
     * request. Typically you get these properties into the message context by setting them on the call object (see
     * org.apache.axis.client.Call)
     */
    public static final String JAVA_PROPERTY_PROXY_HOST = "http.proxyHost";
    public static final String JAVA_PROPERTY_PROXY_PORT = "http.proxyPort";
    public static final String JAVA_PROPERTY_PROXY_USERNAME = "http.proxyUsername";
    public static final String JAVA_PROPERTY_PROXY_PASSWORD = "http.proxyPassword";

    public static final String JAVA_PROPERTY_HTTPS_PROXY_HOST = "https.proxyHost";
    public static final String JAVA_PROPERTY_HTTPS_PROXY_PORT = "https.proxyPort";
    public static final String JAVA_PROPERTY_HTTPS_PROXY_USERNAME = "https.proxyUsername";
    public static final String JAVA_PROPERTY_HTTPS_PROXY_PASSWORD = "https.proxyPassword";

    public static final String PROPERTY_PROXY_HOST = "sfdc.proxyHost";
    public static final String PROPERTY_PROXY_PORT = "sfdc.proxyPort";
    public static final String PROPERTY_PROXY_USERNAME = "sfdc.proxyUsername";
    public static final String PROPERTY_PROXY_PASSWORD = "sfdc.proxyPassword";

    public static final String PROPERTY_ACCEPT_GZIP = "sfdc.acceptGzip";
    public static final String PROPERTY_SEND_GZIP = "sfdc.sendGzip";
    private static Logger logger = null;

    static {
        //using the default max connections and host connections
        connectionManager = new MultiThreadedHttpConnectionManager();
    }

    private static HttpConnectionManager connectionManager;

    public CommonsHTTPSender()
    {
        logger = Logger.getLogger(this.getClass());
    }

    /**
     * invoke creates a socket connection, sends the request SOAP message and then reads the response SOAP message back
     * from the SOAP server
     *
     * @param msgContext
     *            the messsage context
     * @throws AxisFault
     */
    public void invoke(MessageContext msgContext) throws AxisFault {
        HttpMethodBase method = null;
        //logger.setLevel(Controller.getConfig().getAxisLoggingLevel());

        try {
            URL targetURL = new URL(msgContext.getStrProp(MessageContext.TRANS_URL));

            // no need to retain these, as the cookies/credentials are
            // stored in the message context across multiple requests.
            // the underlying connection manager, however, is retained
            // so sockets get recycled when possible.
            HttpClient httpClient = new HttpClient(connectionManager);
            httpClient.setConnectionTimeout(5000);
            httpClient.setHttpConnectionFactoryTimeout(5000);

            setHostConfiguration(httpClient, msgContext);

            String webMethod = null;
            boolean posting = true;

            // If we're SOAP 1.2, allow the web method to be set from the
            // MessageContext.
            if (msgContext.getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS) {
                webMethod = msgContext.getStrProp(SOAP12Constants.PROP_WEBMETHOD);
                if (webMethod != null) {
                    posting = webMethod.equals(HTTPConstants.HEADER_POST);
                }
            }

            Message reqMessage = msgContext.getRequestMessage();
            logger.debug("Request: \n" + reqMessage.getSOAPPartAsString());
            if (posting) {
                method = new PostMethod(targetURL.toString());
                addContextInfo(method, httpClient, msgContext, targetURL);
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                if (msgContext.containsProperty(PROPERTY_SEND_GZIP)
                && ((Boolean)msgContext.getProperty(PROPERTY_SEND_GZIP)) == Boolean.TRUE) {
                    GZIPOutputStream gzip = new GZIPOutputStream(baos);
                    reqMessage.writeTo(gzip);
                    gzip.finish();
                } else {
                    reqMessage.writeTo(baos);
                }
                ((PostMethod)method).setRequestBody(new ByteArrayInputStream(baos.toByteArray()));
                ((PostMethod)method).setUseExpectHeader(false); // workaround for
            } else {
                method = new GetMethod(targetURL.toString());
                addContextInfo(method, httpClient, msgContext, targetURL);
            }
            int returnCode = httpClient.executeMethod(method);
            String contentType = null;
            String contentLocation = null;

            if (method.getResponseHeader(HTTPConstants.HEADER_CONTENT_TYPE) != null) {
                contentType = method.getResponseHeader(HTTPConstants.HEADER_CONTENT_TYPE).getValue();
            }
            if (method.getResponseHeader(HTTPConstants.HEADER_CONTENT_LOCATION) != null) {
                contentLocation = method.getResponseHeader(HTTPConstants.HEADER_CONTENT_LOCATION).getValue();
            }
            contentType = contentType.trim();
            if ((returnCode > 199) && (returnCode < 300)) {

                // SOAP return is OK - so fall through
            } else if (msgContext.getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS) {
                // For now, if we're SOAP 1.2, fall through, since the range of
                // valid result codes is much greater
            } else if ((contentType != null) && !contentType.equals("text/html")
                    && ((returnCode > 499) && (returnCode < 600))) {

                // SOAP Fault should be in here - so fall through
            } else {
                String statusMessage = method.getStatusText();
                AxisFault fault = new AxisFault("HTTP", "(" + returnCode + ")" + statusMessage, null, null);

                try {
                    fault.setFaultDetailString(Messages.getMessage("return01", "" + returnCode, method
                            .getResponseBodyAsString()));
                    throw fault;
                } finally {
                    method.releaseConnection(); // release connection back to pool.
                }
            }
            // if we are maintaining session state,
            // handle cookies (if any)
            if (msgContext.getMaintainSession()) {
                Header[] headers = method.getResponseHeaders();
                for (int i = 0; i < headers.length; i++) {
                    if (headers[i].getName().equalsIgnoreCase(HTTPConstants.HEADER_SET_COOKIE))
                        msgContext.setProperty(HTTPConstants.HEADER_COOKIE, cleanupCookie(headers[i].getValue()));
                    else if (headers[i].getName().equalsIgnoreCase(HTTPConstants.HEADER_SET_COOKIE2))
                            msgContext.setProperty(HTTPConstants.HEADER_COOKIE2, cleanupCookie(headers[i].getValue()));
                }
            }

            // wrap the response body stream so that close() also releases the connection back to the pool.
            InputStream responseStream = createConnectionReleasingInputStream(method);
            Header contentEnc = method.getResponseHeader("Content-Encoding");
            if (contentEnc != null && contentEnc.getValue().equalsIgnoreCase("gzip")) {
                responseStream = new GZIPInputStream(responseStream);
            }
            Message outMsg = new Message(responseStream, false, contentType, contentLocation);

            outMsg.setMessageType(Message.RESPONSE);
            msgContext.setResponseMessage(outMsg);

            logger.debug("Response: \n" + msgContext.getResponseMessage().getSOAPPartAsString());
        } catch (Exception e) {
            logger.debug(e);
            throw AxisFault.makeFault(e);
        }
    }

    /**
     * cleanup the cookie value.
     *
     * @param cookie
     *            initial cookie value
     * @return a cleaned up cookie value.
     */
    private String cleanupCookie(String cookie) {
        cookie = cookie.trim();
        // chop after first ; a la Apache SOAP (see HTTPUtils.java there)
        int index = cookie.indexOf(';');

        if (index != -1) {
            cookie = cookie.substring(0, index);
        }
        return cookie;
    }

    private void setHostConfiguration(HttpClient client, MessageContext msgContext) {

        String proxyHost = (String)msgContext.getProperty(PROPERTY_PROXY_HOST);
        Integer proxyPort = (Integer)msgContext.getProperty(PROPERTY_PROXY_PORT);
        String proxyUsername = (String)msgContext.getProperty(PROPERTY_PROXY_USERNAME);
        String proxyPassword = (String)msgContext.getProperty(PROPERTY_PROXY_PASSWORD);

        if(TextUtil.isNullEmptyOrWhitespace(proxyHost)){
            java.util.Properties p = System.getProperties();

            //Retrieve the Proxy Host, if specified
            if(p.containsKey(JAVA_PROPERTY_HTTPS_PROXY_HOST)){
                proxyHost = p.getProperty(JAVA_PROPERTY_HTTPS_PROXY_HOST);
            } else if(p.containsKey(JAVA_PROPERTY_PROXY_HOST)){
                proxyHost = p.getProperty(JAVA_PROPERTY_PROXY_HOST);
            }

            try {
                //Retrieve the Proxy Port, if specified
                if(p.containsKey(JAVA_PROPERTY_HTTPS_PROXY_PORT)){
                    proxyPort = new Integer(p.getProperty(JAVA_PROPERTY_HTTPS_PROXY_PORT));
                } else if(p.containsKey(JAVA_PROPERTY_PROXY_PORT)){
                    proxyPort = new Integer(p.getProperty(JAVA_PROPERTY_PROXY_PORT));
                }
            } catch (NumberFormatException nfe) {
                proxyPort = null;
            }

            //Retrieve the Proxy Username, if specified
            if(p.containsKey(JAVA_PROPERTY_HTTPS_PROXY_USERNAME)){
                proxyUsername = p.getProperty(JAVA_PROPERTY_HTTPS_PROXY_USERNAME);
            } else if(p.containsKey(JAVA_PROPERTY_PROXY_USERNAME)){
                proxyUsername = p.getProperty(JAVA_PROPERTY_PROXY_USERNAME);
            }

            //Retrieve the Proxy Password, if specified
            if(p.containsKey(JAVA_PROPERTY_HTTPS_PROXY_PASSWORD)){
                proxyPassword = p.getProperty(JAVA_PROPERTY_HTTPS_PROXY_PASSWORD);
            } else if(p.containsKey(JAVA_PROPERTY_PROXY_PASSWORD)){
                proxyPassword = p.getProperty(JAVA_PROPERTY_PROXY_PASSWORD);
            }
        }

        if (!TextUtil.isNullEmptyOrWhitespace(proxyHost) && proxyPort != null && proxyPort.intValue() > 0) {
            client.getHostConfiguration().setProxy(proxyHost, proxyPort.intValue());
        }
        if (!TextUtil.isNullEmptyOrWhitespace(proxyUsername) && !TextUtil.isNullEmptyOrWhitespace(proxyPassword)) {
            client.getState().setProxyCredentials(null, null, new UsernamePasswordCredentials(proxyUsername, proxyPassword));
        }
    }

    /**
     * Extracts info from message context.
     *
     * @param method
     *            Post method
     * @param httpClient
     *            The client used for posting
     * @param msgContext
     *            the message context
     * @param tmpURL
     *            the url to post to.
     * @throws Exception
     */
    private void addContextInfo(HttpMethodBase method, HttpClient httpClient, MessageContext msgContext, URL tmpURL)
            throws Exception {

        // optionally set a timeout for the request
        if (msgContext.getTimeout() != 0) {
            httpClient.setTimeout(msgContext.getTimeout());
        }

        if (msgContext.containsProperty(PROPERTY_ACCEPT_GZIP)
                && ((Boolean)msgContext.getProperty(PROPERTY_ACCEPT_GZIP)) == Boolean.TRUE) {
            method.addRequestHeader("Accept-Encoding", "gzip");
        }

        if (msgContext.containsProperty(PROPERTY_SEND_GZIP)
                && ((Boolean)msgContext.getProperty(PROPERTY_SEND_GZIP)) == Boolean.TRUE) {
            method.addRequestHeader("Content-Encoding", "gzip");
        }

        // Get SOAPAction, default to ""
        String action = msgContext.useSOAPAction() — msgContext.getSOAPActionURI() : "";

        if (action == null) {
            action = "";
        }
        Message msg = msgContext.getRequestMessage();
        if (msg != null) {
            method.setRequestHeader(new Header(HTTPConstants.HEADER_CONTENT_TYPE, msg.getContentType(msgContext
                    .getSOAPConstants())));
        }
        method.setRequestHeader(new Header(HTTPConstants.HEADER_SOAP_ACTION, "\"" + action + "\""));
        String userID = msgContext.getUsername();
        String passwd = msgContext.getPassword();

        // if UserID is not part of the context, but is in the URL, use
        // the one in the URL.
        if ((userID == null) && (tmpURL.getUserInfo() != null)) {
            String info = tmpURL.getUserInfo();
            int sep = info.indexOf(':');

            if ((sep >= 0) && (sep + 1 < info.length())) {
                userID = info.substring(0, sep);
                passwd = info.substring(sep + 1);
            } else {
                userID = info;
            }
        }
        if (userID != null) {
            Credentials cred = new UsernamePasswordCredentials(userID, passwd);
            httpClient.getState().setCredentials(null, null, cred);

            // The following 3 lines should NOT be required. But Our SimpleAxisServer fails
            // during all-tests if this is missing.
            StringBuffer tmpBuf = new StringBuffer();
            tmpBuf.append(userID).append(":").append((passwd == null) – "" : passwd);
            method.addRequestHeader(HTTPConstants.HEADER_AUTHORIZATION, "Basic "
                    + Base64.encode(tmpBuf.toString().getBytes()));
        }

        // don't forget the cookies!
        if (msgContext.getMaintainSession()) {
            String cookie = (String)msgContext.getProperty(HTTPConstants.HEADER_COOKIE);
            String cookie2 = (String)msgContext.getProperty(HTTPConstants.HEADER_COOKIE2);

            if (cookie != null) {
                method.addRequestHeader(HTTPConstants.HEADER_COOKIE, cookie);
            }
            if (cookie2 != null) {
                method.addRequestHeader(HTTPConstants.HEADER_COOKIE2, cookie2);
            }
        }

        // process user defined headers for information.
        Hashtable userHeaderTable = (Hashtable)msgContext.getProperty(HTTPConstants.REQUEST_HEADERS);

        if (userHeaderTable != null) {
            for (java.util.Iterator e = userHeaderTable.entrySet().iterator(); e.hasNext();) {
                java.util.Map.Entry me = (java.util.Map.Entry)e.next();
                Object keyObj = me.getKey();

                if (null == keyObj) {
                    continue;
                }
                String key = keyObj.toString().trim();
                String value = me.getValue().toString().trim();

                method.addRequestHeader(key, value);
            }
        }
    }

    private InputStream createConnectionReleasingInputStream(final HttpMethodBase method) throws IOException {
        return new FilterInputStream(method.getResponseBodyAsStream()) {
            public void close() throws IOException {
                try {
                    super.close();
                } finally {
                    method.releaseConnection();
                }
            }
        };
    }
}


 

pamalpamal
Thank you Chris.

This solution works very well.
VinOKVinOK
Does this solution still work with the current version of the Email2Case toolkit?  I do not see a CommonsHTTPSender class in the com.sforce package to override, so I'm assuming that there may need to be another workaround needed to get the Email2Case tooklit to work with Proxy Servers.
 
I have tried a number of things and have been mainly focused on modifiying the code around the com.sforce.mail.GenericClient login() method.  I've placed the following code at the top of the method call.  
 
    protected void login() throws ConnectionException {

        try {
            ConnectorConfig config = new ConnectorConfig();

            //retrieve the proxy information from sfdc config file.
            String proxyServer = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYSERVER);
            String proxyPort = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYPORT);
            String proxyUser = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYUSER);
            String proxyPassword = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYPASSWORD);
          
            logger.info("retrieved http/https proxy settings:"+proxyServer+":"+proxyPort+" username:"+proxyUser);
            if (proxyPassword!=null && "".equals(proxyPassword)==false){
             logger.info("http/https proxy password will also be set.");
            }
           
      if (proxyServer!=null && "".equals(proxyServer) == false) {
       Properties props = new Properties(System.getProperties());
      
       // set http/https properties
       props.put("http.proxySet", "true");
       props.put("https.proxySet", "true");

       props.put("http.proxyHost", proxyServer);
       props.put("https.proxyHost", proxyServer);
       config.setProxyHost(proxyServer);
      
       if (proxyPort!=null && "".equals(proxyPort) == false){
        props.put("http.proxyPort", proxyPort);
        props.put("https.proxyPort", proxyPort);
        config.setProxyPort(Integer.parseInt(proxyPort));
       }
       if (proxyUser!=null && "".equals(proxyUser) == false){
        props.put("http.proxyUser", proxyUser);
        props.put("https.proxyUser", proxyUser);
           config.setProxyUsername(proxyUser);
       }
       if (proxyPassword!=null && "".equals(proxyPassword) == false){
        props.put("http.proxyPassword", proxyPassword);
        props.put("https.proxyPassword", proxyPassword);
           config.setProxyPassword(proxyPassword);
       }
             
       Properties newprops = new Properties(props);
       System.setProperties(newprops);
      }
Unfortunately with this code in place, the login seems to error with an IllegalArumentException and the Error message is "Illegal character(s) in message header value : xxxx" where xxxx is a base64 encoded string which is the Username and Password that I have configured.
 
2007-11-21 17:33:08,937 [main] FATAL FATAL EXCEPTION
java.lang.IllegalArgumentException: Illegal character(s) in message header value: xxxxxxxxxx
        at sun.net.www.protocol.http.HttpURLConnection.checkMessageHeader(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.addRequestProperty(Unknown Source)
        at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:86)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:72)
        at com.sforce.soap.partner.wsc80.PartnerConnection.login(PartnerConnection.java:499)
        at com.sforce.mail.GenericClient.login(GenericClient.java:308)
        at com.sforce.mail.GenericClient.getConnection(GenericClient.java:178)
        at com.sforce.mail.GenericClient.<init>(GenericClient.java:134)
        at com.sforce.mail.ImapClient.<init>(ImapClient.java:40)
        at com.sforce.mail.EmailService.loadService(EmailService.java:153)
        at com.sforce.SalesforceAgent.main(SalesforceAgent.java:139)
2007-11-21 17:33:08,937 [main] INFO  EmailToCase Agent Shut Down.
 
 
 
Any help would be greatly appreciated. 

Message Edited by VinOK on 11-21-2007 10:14 AM

GoForceGoGoForceGo

Were you able to ever get this resolved?

 

I want to use proxy host/port for email2case.