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

README #21

Open
clojens opened this issue Mar 30, 2015 · 5 comments
Open

README #21

clojens opened this issue Mar 30, 2015 · 5 comments

Comments

@clojens
Copy link

clojens commented Mar 30, 2015

There are several issues when I try to run this project. For one, a while now, I haven't been able to connect to Google GMail via IMAP. I had to resort to OAuth2 Java service api libs for my gmail connection. Same here, I get bounced with invalid credentials (they aren't I'm sure and have been using them non-stop these two days with webdriver to automate oauth2 consent click.

Second thing is that the readme, at least in my case again, naming a var def store while already having a name like that in your project results in conflicts. So I renamed to store-1 before I could get invalid credentials anyway.

Third, inbox doesn't work but I guess this is due to credentials...

Anyway my question really should be: does anyone have this working without fully disabling gmail account security (less secure apps) or is that always a result that comes with this approach...

@ikarth
Copy link

ikarth commented Apr 17, 2015

It worked for me, though I set up an app-specific password so I didn't need to toss around my real password. I suspect Google may bounce rapidly repeating connections as suspicious.

@robjens
Copy link

robjens commented May 2, 2015

You must be running it in your own app context then (sorry, I'm user clojens btw). If you import symbols e.g. into the namespace (ns example) as (require '[something :refer :all]) and something contains a exported var foo, then you can't use foo as a name in (def foo ...).

Your project has a var named store and as such, that name is not usable anymore as a var. Yet in the readme, your example shows to end-user how to use the lib with a example var declared store. How is that ever going to work? I fail to see... Or do I have a brain fart (again)? :)

@owainlewis
Copy link
Owner

Hey. This is probably just an over sight on my part when writing the README. I'll take a look.

The best way to deal with this would be to alias the library (which I generally prefer anyway)

Example

(ns your-namespace
  (:require [clojure-mail.core :as mail]))

(def store (mail/gen-store "user@gmail.com" "password"))

Sorry for any confusion. I will have to update the documentation when I get a moment.

Does that make sense? Thanks

Owain

@robjens
Copy link

robjens commented May 5, 2015

Thank you. I know cargo-cult coding is bad but it really isn't if you basically grok what you are doing. Unless it is a very elaborate procedure, which needs to have parts truncated, I'd expect a 'quick start' to work out of the box... Hopefully not using :use since that stuff is borderline to be deprecated for a while and really not the best of practice. Not sure if that was the case but anyway.

One more addition might be to highlight that one already needs to have run through part of the OAuth2 process before you can use this. Meaning: you need to have a access token to do anything at the minimum, correct? I don't see this library facilitating anything on the front of authorization in that respect.

This actually posed a problem for me, obtaining a token without user interference but thats a different story I solved using clj-webdriver clicking me through user consent and then fetching header callback param auth code sent by Google in response to the authorization request. Not the best but at least it works. Google OAuth2 service accounts need some lovin' in the documentation - extremely vague if and how it works with Gmail.

Anyway, cheers.

Rob

@robjens
Copy link

robjens commented May 10, 2015

Exact (except namespace) copy/paste as instructed - conflicting names:
1

Change the name resolves the conflict
2

Yet the following really stops it (the user/pass is correct but obfuscated, without a correct one, the second expression, last blue one, would have failed as in the screenshot above). The method actually is missing.
3

Finally there is a paren too many (not balanced) see highlighted token
4

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