-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
IMAP error with Kumar scrpit #92
Comments
Might be because Gmail complains of 'less secure apps' if OAuth2 isn't used for authentication. Try turning 'less secure apps' on for the account: https://www.google.com/settings/security/lesssecureapps |
Ok, I'll try that out |
It didn't work, I keep getting this; `get_tagged_response': Invalid arguments supplied to LOGIN. k3mb38185354qke (Net::IMAP::BadResponseError) |
This is the node script? I'll look at it. |
#!/usr/bin/env ruby require 'dotenv' Dotenv.load GMAIL_USERNAME = ENV['[email protected]'] GMAIL = Gmail.connect(GMAIL_USERNAME,GMAIL_PASSWORD) DB_NAME_REGEX = /\S+_staging/ def create_reply(subject) GMAIL.inbox.find(:unread, from: SCAM_EMAIL).each do |email| |
Ah, I see the issue. GMAIL_USERNAME and GMAIL_PASSWORD are set to the corresponding environment variables. So change those lines to: GMAIL_USERNAME = '[email protected]'
GMAIL_PASSWORD = 'xxx' and not GMAIL_USERNAME = ENV['[email protected]'] The latter causes it to look for an env variable called "[email protected]" |
Ok, So that fixed the first error, and a couple syntax errors popped up but I fixed those, now it is giving me the same as before but indicating to line 25; GMAIL.inbox.find(:unread, from: SCAM_EMAIL).each do |email| |
I see. I'm not sure why, maybe some one else can help with that. But I'd suggest you check if there are no unread emails from SCAM_EMAIL. 0 unread emails may throw an error. |
Alright, will do. Thanks for all your help so far! |
No problem |
Do you think that there could be any problems with the From command? I was looking at commands in IMAP that can cause problems easily and came across the From command. |
When I startup the script with all of the correct info in the right places, I get an IMAP error and I have no idea what from.
The text was updated successfully, but these errors were encountered: