All Apps and Add-ons

IMAP Mailbox: Why am I getting login error "Could not log into server: %s with password provided' % self.server" for a Google account?

Path Finder

Hey,

I'm testing the IMAP in a Windows environment and I keep running into this error

__main__.LoginError: Could not log into server: imap.gmail.com with password provided. 

I'm using gmail here, is there anything that needs to be done in the python script to make it work? I have enabled IMAP in my gmail and the config file seems to be alright as well. Can someone tell me what's wrong here?

ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" Traceback (most recent call last):
08-16-2015 21:09:09.497 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py", line 717, in <module>
08-16-2015 21:09:09.497 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     parseArgs()
08-16-2015 21:09:09.497 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py", line 709, in parseArgs
08-16-2015 21:09:09.497 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     imapProc.getMail()
08-16-2015 21:09:09.497 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py", line 345, in getMail
08-16-2015 21:09:09.497 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     raise LoginError('Could not log into server: %s with password provided' % self.server)
08-16-2015 21:09:09.497 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" __main__.LoginError: Could not log into server: imap.gmail.com with password provided
0 Karma
1 Solution

Path Finder

Hey Guys .. It was a connectivity issue. It was the Firewall/Proxy that was blocking the communication. I tried the same with a wifi hot spot connection , and my mails got indexed. Still have to find what service was getting blocked.

View solution in original post

0 Karma

Path Finder

Hey Guys .. It was a connectivity issue. It was the Firewall/Proxy that was blocking the communication. I tried the same with a wifi hot spot connection , and my mails got indexed. Still have to find what service was getting blocked.

View solution in original post

0 Karma

Path Finder

Are you using the correct IMAP port to connect to gmail with? Or did you set a different one in your config file?

0 Karma

Path Finder

following is the error message. "DEBUG:root:[Errno 11004] getaddrinfo failed" wonder what this means.!

08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:END_IMAP_BREAKER=EndIMAPMessage
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:bodySourceType=imapbody
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:body_separator=____________________  Message Body  ____________________
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:debug=True
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:deleteWhenDone=False
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:folders=all
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:fullHeaders=False
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:headerSourceType=imap
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:imapSearch=UNDELETED
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:includeBody=True
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:mimeTypes=text/plain
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:noCache=False
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:password='*Password*'
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:port=993
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:server='imap.gmail.com'
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:splunkHostPath=https://localhost:8089
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:splunkpassword=Password1
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:splunkuser=admin
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:splunkxpassword=
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:timeout=10
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:useBodySourceType=False
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:useSSL=True
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:user='imapacc@gmail.com'
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:version=2.0
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:xpassword=
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:VERSION = 2.0
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" DEBUG:root:[Errno 11004] getaddrinfo failed
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" Traceback (most recent call last):
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py", line 331, in getMail
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     M = imaplib.IMAP4_SSL(self.server,int(self.port))
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\Python-2.7\Lib\imaplib.py", line 1165, in __init__
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     IMAP4.__init__(self, host, port)
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\Python-2.7\Lib\imaplib.py", line 172, in __init__
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     self.open(host, port)
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\Python-2.7\Lib\imaplib.py", line 1176, in open
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     self.sock = socket.create_connection((host, port))
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\Python-2.7\Lib\socket.py", line 553, in create_connection
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     for res in getaddrinfo(host, port, 0, SOCK_STREAM):
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" gaierror: [Errno 11004] getaddrinfo failed
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" Traceback (most recent call last):
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py", line 717, in 
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     parseArgs()
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py", line 709, in parseArgs
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     imapProc.getMail()
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""   File "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py", line 345, in getMail
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py""     raise LoginError('Could not log into server: %s with password provided' % self.server)
08-19-2015 00:04:11.839 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\IMAPmailbox\bin\get_imap_email.py"" __main__.LoginError: Could not log into server: 'imap.gmail.com' with password provided
0 Karma

Path Finder

Comparing your output with my own when I do a debug I noticed yours has (') around your server and user values. I am not sure if that is a Windows thing or not.

Did you put single quotes around those fields in your local/imap.conf file? If so try removing them. The python script may not like it and thus cannot look up the server host and thus "getaddrinfo failed" message.

Here is my local/imap.conf file as an example:
[IMAP Configuration]
debug = 0
deleteWhenDone = 1
disabled = 0
fullHeaders = 0
includeBody = 1
folders = INBOX
noCache = 0
server = imap.gmail.com
useSSL = 1
user = emailme@gmail.com
xpassword=somecrazyencryptionpasswordhere!

Path Finder

Much appreciate your response 🙂 ..it's been great help from you.!
I tried removing the single quotes and "getaddrinfo failed" is no longer there.! so it worked , though the main errors still appear the same. Could firewall be blocking such a communication? And I'm not using an encrypted password. Apart from that everything looks quite the same.
DEBUG:root:user ..is that the same as gmail username?

0 Karma

Path Finder

User, for gmail at least, is normally just your email address itself. That is what I use for my username.

I'm glad it worked.

0 Karma

Path Finder

yes I'm using port 993 to connect to gmail. I tried changing the user name password combinations ., but it returns only the same error. tried outlook..yahoo..no luck.! :(,yes..i am using port 993. I have used plain text password and rest of the settings are the same given in "read me" file. Even if I change the user name password combinations it's still giving me the same error. 😞

0 Karma

Path Finder

Run the script in debug mode to see what settings are being used and if there are any other errors.
post that here if you could.

0 Karma