Open gollumone opened 9 months ago
Could it be that the commands need to be sent in base64? shouldn't imapfilter handle this itself?
If I wait long enough for the inbox = account.INBOX
function to time out, the terminal gives me this traceback:
imapfilter: timeout period expired while waiting to read data imapfilter: login request to my_user@gmail.com@imap.gmail.com failed stack traceback: [C]: in ? [C]: in function 'error' /usr/share/imapfilter/account.lua:75: in function '_check_result' /usr/share/imapfilter/account.lua:93: in function '_login_user' /usr/share/imapfilter/mailbox.lua:32: in function '_check_connection' /usr/share/imapfilter/mailbox.lua:501: in function 'check_status' /home/mauro/.imapfilter/config.lua:94: in main chunk
the log file don't chenge.
Just an idea, instead of using oath2 it works for me with an app-password for an email on a google site acoount (free workspace acoount) account = IMAP { server = 'imap.gmail.com', username = 'user@domain', password = 'app-password', ssl = 'ssl3', }
Just an idea, instead of using oath2 it works for me with an app-password for an email on a google site acoount (free workspace acoount)
account = IMAP {
server = 'imap.gmail.com',
username = 'user@domain',
password = 'app-password',
ssl = 'ssl3',
}
Right what you say, but if it works with mutt, it MUST work with imapfilter too. Also because it seems that Google wants to remove support for this password app, sooner or later. And then it also serves me as an experience for other non-Google mailboxes, where the app-password is not really available, only aouth2.
Imapfilter just supplies the XOAUTH2 string as stored in the account's oauth2
string, so in theory the string should be in the final format as it should be sent to the server. Basically imapfilter just provides a way to do this authentication instead of the standard plain login.
Here's the code:
Now what seems to happen in this case is that apparently the server needs more data... Basically the fact that it did not respond with OK XOAUTH2 authentication successful
or similar but instead sent back a continuation response as denoted by the +
means that it expects something more from the client.
This explains why the timeout then happens. So probably something changed, as this used to work without a second exchange of data between imapfilter and the server.
I tried to use contrib/mutt_oauth2.py script with the instructions at contrib/mutt_oauth2.py.README, but I couldn't even create a Google registration at console.developers.google.com, because the instructions seem to be out of date or something...
Do you know what the 2nd exchange is about?
Because if the oauth2 script can take the reply of the server, and based on it provide another string to send to the server, we could modify imapfilter so it handles all that somehow.
This is what I also see in Google's own python/oauth2.py, that seems to have been migrated to Python 3:
Maybe the oauth2
string sent is not somehow correct, and so the XOAUTH2 process isn't completed, and the server wants more data?
@gollumone Can you give Google's python/oauth2.py a try, now that it's been migrated to Python 3? Maybe it produces a string that can authenticate you?
Imapfilter had an example of using this script in the past (it was removed because the script had stopped working):
A few years a go I could personally authenticate to Gmail using the above example.
Hi, I'm trying to use imapfilter with gmail using oauth2 as verification.
I used mutt_oauth2.py with pgp to create and store my keys.
Currently I managed to establish the connection with gmail, but subsequently, any command I can insert in the configuration file to test, imapfilter remains blocked and does not execute any requests.
This is my current config file:
and this is output of debug file:
as you can see the log stops at the server response key, the script remains suspended when
check_status
is executed.if I remove the
check_status
command, the script remains suspended when themailbox:select_all()
command is executed.In practice, every command that is sent to the server waits for a response that never arrives.
What am I doing wrong?
Thank you