Tropicalista / lucee-cfimap

cfimap tag for Lucee Server
13 stars 6 forks source link

Using the cfimap tag #19

Open DrunkenMoose opened 6 years ago

DrunkenMoose commented 6 years ago

Hey,

First of all, thanks for this code! When I found out the lucee IMAP tag was different from the coldfusion one, I freaked out a bit. In example: I wanted to get emails from a given folder, this is not an option in the lucee tag.

So I guess you made the coldfusion imap tag for lucee? I'm currently stuck at an error and thought maybe you have an idea what is going wrong. These are the steps I followed:

<cfimap 
    server = "imap.gmail.com" 
    username = "xxxxxx" 
    action="open" 
    secure="yes" 
    password = "xxxxx" 
    connection = "mail.example.com" >

  <cfimap   
    action="getHeaderOnly"
    name="test1"
    connection="mail.example.com" >

    <cfdump var = "#test1#">

<cfimap action="close" connection = "mail.example.com">

It's giving an error saying that variable "test1" doesn't exist. I also saw an other post here on github describing the same issue. Did I do something wrong with the installation? Any inside would be very helpfull.

Thanks again! Roland

DrunkenMoose commented 6 years ago

Any help would be very helpful!

spraguey commented 6 years ago

I'm not sure how much help this is, but we are using this library and have almost identical code to what you posted here. It is working well for us. We are also connecting to imap.gmail.com.

Some things to check...

  1. Does it work if you specify a folder name in the getHeaderOnly call? folder="Inbox"
  2. Confirm that IMAP is actually enabled in the Gmail account settings area.
  3. Newer Gmail accounts have "allow access from insecure apps" turned off by default. This connection may be considered an insecure app. https://support.google.com/accounts/answer/6010255?hl=en

Because the same library is working for others using Gmail, I would lean toward the issue being specific to the account you are connecting to.

The only other possibility I can think of is a difference in the underlying Java version that is causing an issue. We're on 1.8.0_131.

Hopefully this helps!

DrunkenMoose commented 6 years ago

Hey Spraguey,

Thanks for the response. I will now try the different things you mentioned but I firstly wanted to state something.

I'm currently using the Lucee imap tag and with this I can successfully retrieve emails, it's just that most of the coldfusion imap tag functionality is missing. So by getting these emails I've to say that I think the gmail imap server is correctly implemented.

But I will try to dig some deeper to get this tag working. It would be very helpful to get the full functionality the imap has to offer.

Thanks again!

spraguey commented 6 years ago

Interesting. Given that Lucee IMAP works, you are right that it is probably not an issue with your Gmail account. I'm at a loss for what else it could be, then, because it is working for us. Maybe just different Lucee or Java versions?

DrunkenMoose commented 6 years ago

Hey,

I also said in the first post that I'm only using one file. But the library has two different imap.cfc files. It looks like the one in the folder is the logic and the one in the parent folder is a overlay code which you can use to get the imap functionality.

Should I use both files. If yes, how can I use the overlay cfc file?

Thanks in advance!

DrunkenMoose commented 6 years ago

UPDATE:

I've taken another look and found the solution! I added the other overlay cfc as a component and called it with createObject. I have taken a good look which parameters are expected and now it gives indeed a value back! I now can i.e. create a folder or delete it. With all the other functions available.

Thanks again for your help! Hope I can make a good email importer with this.

ChrisDunk commented 6 years ago

Hi DrunkenMoose,

Please can you post the code of how you did this? I am having the same issue.

Lucee 5.2.8.50 OS | Windows Server 2012 R2 (6.3) 64bit Apache Tomcat/8.0.28 1.8.0_66 (Oracle Corporation) 64bit

UPDATE: Oops, I had not copied the imap folder into the tags folder, just the imap.cfc. Working now.

Tropicalista commented 6 years ago

Hi guys, sorry for the late response.

I have just tested this with my gmail account and it's working properly. I think the problem is with the default folder on gmail, which is "INBOX". Please can you give me more details?