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
akak 

Emai to Case and Google Mail

I am trying to connect to gmail imap servers using emailtocase.

The setup goes OK but I am getting an error which looks like the
process is refused connection to the gmail server. I have had the
config files checked by salesforce.com tech support and they said they
were OK.

Has anyone tried this process, or a similar one before? Does it work?

Has anyone any ideas why I might not be able to connect.

Here is a clip from the error log I get when running the process.

2008-04-02 08:48:14,369 7162 [main] INFO
com.sforce.mail.EmailService  - Scheduling poll process against
imap.googlemail.com
2008-04-02 08:48:14,369 7162 [main] INFO
com.sforce.mail.EmailService  -    Port    : default
2008-04-02 08:48:14,369 7162 [main] INFO
com.sforce.mail.EmailService  -    UserID  : [email address]
2008-04-02 08:48:14,369 7162 [main] INFO
com.sforce.mail.EmailService  -    Password:
2008-04-02 08:48:14,369 7162 [main] INFO
com.sforce.mail.EmailService  -    Interval: 10 minute(s)
2008-04-02 08:48:14,369 7162 [main] INFO
com.sforce.mail.EmailService  -    InBox   : Inbox
2008-04-02 08:48:14,369 7162 [main] INFO
com.sforce.mail.EmailService  -    ReadBox : Sent Mail
2008-04-02 08:48:14,370 7163 [main] INFO
com.sforce.mail.EmailService  -    ErrorBox: Drafts
2008-04-02 08:48:14,370 7163 [main] INFO  com.sforce.SalesforceAgent
- Service imap.googlemail.com:0:[email address]:Inbox
successfully registered
2008-04-02 08:48:14,370 7163 [main] INFO  com.sforce.SalesforceAgent
- com.sforce.mail.EmailService  loaded as a timer service.
2008-04-02 08:49:29,268 82061 [Timer-0] ERROR
com.sforce.mail.GenericClient  - Unable to connect to mail service.
Service: imap.googlemail.com
User: [email address]

Message: Operation timed out;
  nested exception is:
        java.net.ConnectException: Operation timed out

End of LOG

The email address has been changed to protect privacy
dragonmagicldragonmagicl
Never had a problem. You want your email2case.txt file to look something like this    <server1>
        <url>imap.gmail.com</url>
        <protocol>imaps</protocol>
        <userName>xxx</userName>
        <password>yyy</password>
        <interval>10</interval>
        <inbox>Inbox</inbox>
        <readbox>Processed</readbox>
        <errorbox>Error</errorbox>
    </server1>            Have never had an issue with this (unless of course you are behind a firewall that completely disallows this connection.
werewolfwerewolf
Also make sure you've actually turned on IMAP in Gmail, which is up in Settings->Forwarding and POP/IMAP.
akak
Thanks for the comments. I made a few changes to my config and - Yes I seem to be getting emails into Cases. I just need to work out what is happening to them now.

Very odd this as I thought my config files etc were ok. I will post a " What I did" here soon so my experience is recorded and can be shared.


akak
For anyone trying this, here are my final config files with [notes] where they need to be editied for your set-up. These are slightly different to the ones in the readme.txt file that comes with the developer kit. Not sure why, but these ones worked for me.

emailtocase.txt

<configFile>
    <server1>
        <url>imap.googlemail.com</url>
           <protocol>imaps</protocol>
        <userName>[enter your account]@googlemail.com</userName>
        <password>[enter account password]</password>
        <interval>10</interval>
        <inbox>Inbox</inbox>
        <readbox>Processed</readbox>
        <errorbox>Error</errorbox>
    </server1>
</configFile>

Note:
Processed and Error were set up as lables in the gmail account. Inbox already existed.

sfdcConfig.txt

<configFile>
    <sfdcLogin>
        <url>https://www.salesforce.com/services/Soap/u/7.0</url>
        <userName>[username for the sfdc org]</userName>
        <password>[password for the username followed by personal security token]</password>
        <loginRefresh>30</loginRefresh>
        <timeout>600</timeout>
    </sfdcLogin>
    <notify>
        <notifyEmail>[An email address of person to be notified of errors]</notifyEmail>
        <from>[an email address which is used to say who the email is from]</from>
        <host>[the outgoing mail smpt address so mail can be sent - in form smpt.xxxxx. </host>
        <port>25</port>
        <user></user>
        <password></password>
        <service>com.sforce.mail.SMTPNotification</service>
    </notify>
    <attachments>
        <largeAttachmentDirectory>[directory for files]</largeAttachmentDirectory>
        <largeAttachmentURLPrefix>[url of location of above directory]</largeAttachmentURLPrefix>
        <largeAttachmentSize>0.5</largeAttachmentSize>
    </attachments>
    <services>
        <com.sforce.mail.EmailService>email2case.txt</com.sforce.mail.EmailService>
    </services>
</configFile>