Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the cfimap tag #19

Open
DrunkenMoose opened this issue Feb 28, 2018 · 8 comments
Open

Using the cfimap tag #19

DrunkenMoose opened this issue Feb 28, 2018 · 8 comments

Comments

@DrunkenMoose
Copy link

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:

  • I downloaded the zip and took the imap.cfc from the imap folder.
  • I put this in lucee -> libraray -> tag (I think the path has changed with a newer version?)
  • I noticed I got an error from the old imap tag I was using, so that's good news.
  • But now I'm stuck at retrieving a simple test with the following code:
<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
Copy link
Author

Any help would be very helpful!

@spraguey
Copy link
Contributor

spraguey commented Mar 6, 2018

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
Copy link
Author

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
Copy link
Contributor

spraguey commented Mar 6, 2018

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
Copy link
Author

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
Copy link
Author

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
Copy link

ChrisDunk commented Aug 29, 2018

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
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants