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
GortGort 

Email to Case - support for POP rather than IMAP?

Does anyone know if the Email to Case functionality will work with POP?  Our mail server does not support IMAP. 
If so, what is involved in making this work?
 
Thanks.
gokubigokubi
The email to case project is described by salesforce.com as an example, meaning they don't support it.

To add functionality, I'd say find a java developer who knows what they are doing and have them build off the freely available source code.

We've considered this path with a small feature we'd like to see (if a user isn't in the system as a contact, capture their email address on the case) but haven't done it.

Steve
ChrisS_SFDCChrisS_SFDC

The problem with using POP3 is that pop doesn't support multiple folders and the Email Agent utilizes three folders, one for the Inbox which it reads incoming messages from, one to copy messages to if there is an error, either in processing the message or if a case could not be created, and finally a processed folder for all successfully processed messages.  To implement POP3 you would need to change the agent a bit, first you would need to change the configuration file setting from imap to pop3 (that's the easy part).  Next you will need to modify the POP3 service extension that is delivered with the Email Agent.  This class, Pop3Client.java is currently disabled by throwing an UnsupportedOperationException from the getProtocol() method.  You will need to remove that exception and uncomment the return "pop3"; line.

In the GenericClient.java file you will also need to make some adjustments, mainly in the handleMessage method.  Currently this method does the copying of messages from the Inbox to either the Error folder or Processed Folder.  In addition the message is then Deleted from the Inbox.  For POP3, my guess is that you would not want to delete the message, but would rather mark it as read, and perhaps mark it in other ways if it is in error.  The ability to mark email messages is somewhat dependent upon the mail system in use and the POP3 implementation being used.  So where it currently markes messages as deleted like this :

messages[i].setFlag(Flags.Flag.DELETED, true);

You might try something like this:

Code:

    messages[i].setFlag(Flags.Flag.SEEN, true);
    if (r.isSuccess()) {
        logger.info(Calendar.getInstance().getTime().toString() + ":" + pSUCCESS +":" + i + " ID=" + r.getId() + " "+ pSUCCESS +"=" + r.isSuccess());
        messages[i].setFlag(Flags.Flag.ANSWERED, true);
    } else {
        String sMessage = r.getErrors(0).getMessage() == null — "" : r.getErrors(0).getMessage();
        logger.error(Calendar.getInstance().getTime().toString() + ":"+ pERROR +":" + i + ": " + sMessage);
    }


 

Notice how the SEEN flag is set for all messages, but the Answered flag is set only if the message has been processed succussfully.  This is just an idea, I'm not sure if it's appropriate for your situation.

After doing all of this setup, I'm not 100% sure it will work, but you should be close to making it.