-
Notifications
You must be signed in to change notification settings - Fork 15
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 on Mac OS X #9
Comments
Hi, |
I have reached more or less the same state where I am shown That's as far as I got. |
I haven't. Perhaps @moriyoshi might have an idea? |
Sorry for leaving this behind too long. The answer depends on the setup, for example where the accompanying SASL library comes from, either the system provided or the one installed on your own, through homebrew, MacPorts, or by building it yourself. Anyways, the number appeared in the error message So all I can assume at the moment is that you are most likely using the system SASL library and I need to know more context about why this callback ID is propagated. |
Thanks @moriyoshi - what about the context would be helpful? It does seem that the system library is called but I am unsure how to make mbsync call the right library |
Did you compile mbsync It wasn't immediately clear to me why this was the only plugin listed, so I ended up patching mbsync. By adding the above mentioned callback, I was able to get mbsync working with the Apple provided implementation. Certainly not ideal, but at least it works until I can figure something else out. |
Hi @ldavison this sounds promising, do you have more details on the patch? What exactly did you change in mbsync's source? |
Specifically, the area of code is in
what changes did you make to this area before compiling Do you mean adding a case to the function as in
or something else? Thanks @ldavison! |
@guibor - The following diff will apply against the mbsync tag for v1.4.4, which will get diff --git a/src/drv_imap.c b/src/drv_imap.c
index c5a7aed..b8ac65a 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -2195,6 +2195,9 @@ static sasl_callback_t sasl_callbacks[] = {
{ SASL_CB_USER, NULL, NULL },
{ SASL_CB_AUTHNAME, NULL, NULL },
{ SASL_CB_PASS, NULL, NULL },
+#ifdef __APPLE__
+ { SASL_CB_OAUTH2_BEARER_TOKEN, NULL, NULL },
+#endif
{ SASL_CB_LIST_END, NULL, NULL }
};
@@ -2212,6 +2215,9 @@ process_sasl_interact( sasl_interact_t *interact, imap_server_conf_t *srvc )
val = ensure_user( srvc );
break;
case SASL_CB_PASS:
+#ifdef __APPLE__
+ case SASL_CB_OAUTH2_BEARER_TOKEN:
+#endif
val = ensure_password( srvc );
break;
default: This is most of the patch from this thread: https://sourceforge.net/p/isync/mailman/isync-devel/thread/20210308170245.kq4ubg24jcxezyhf%40bsd-mbp.dhcp.thefacebook.com/#msg37235467; I removed is the suppression of the warning. I did not have to change my |
Thanks a lot. So this worked! What I did was:
|
I also managed to make it work using the code patch (which I made avaiable at https://github.com/xukai92/isync.git). For anyone just started looking into how to set up |
Updated: Ignore me, I can't even read my own config. Duplicate AuthMechs further down; removed and all is right with the world. :) OK, I'm clearly missing something here.
mbsync is still trying SASL PLAIN:
|
Successfully got this to work using the above code patch. I needed to use Of note: When I run mbsync, I get the following warning on the oauth2 accounts: |
I can't speak for you (much less the you of a year ago), but I think the issue is that the The solution to this is to direct it to the correct target: This might be worth noting in the readme for macos users, given the number of us bumbling around here in the issues. :) |
I can confirm this works without the aforementioned code hack. To summarize:
The above assumes you've installed the homebrew cyrus-sasl package and then compiled this repo (cyrus-sasl-xoauth2) plugin to go along with the homebrew (not macOS) sasl version. I could not get mbsync to work with the isync homebrew formula edited and built with the same configuration options as above and using the same version. |
The following worked for me: $ sudo port install cyrus-sasl-xoauth2 #install from macports
$ # git clone isync & cd into it
$ # Run export commands specified in `brew info berkeley-db@4`
$ ./configure --with-sasl=/opt/local --with-ssl=/opt/homebrew/opt/[email protected] Hope it helps someone who is also looking to get this working. |
I used @bmclean2's comment to build I also used this stackoverflow post to build Editing the Makefile to use the correct On my system the correct After successful install,
|
i got this to work with brew. Here's roughly what i did Install cyrus sasl for mbsync to link against brew install cyrus-sasl libtool Build this xoauth2 plugin against cyrus-sasl git clone https://github.com/moriyoshi/cyrus-sasl-xoauth2.git
cd cyrus-sasl-xoauth2
vi autogen.sh Change ./autogen.sh \
&& ./configure --with-cyrus-sasl=/opt/homebrew/opt/cyrus-sasl \
&& make \
&& make install You should now have sasl with xoauth support. If this command returns nothing something went wrong. /opt/homebrew/opt/cyrus-sasl/sbin/pluginviewer | grep XOAUTH Update brew formula to use cyrus-sasl instead of apple's brew edit isync
Build isync with your local formula
(You can also mbsync should now work with XOAUTH2 and an access token as the password. Note: Homebrew doesn't use the local files when building from source. This might be the missing piece @bmclean2 and others needed (https://github.com/orgs/Homebrew/discussions/4286) |
I followed the instructions by @com4 exactly, but mbsync still gives the error:
Did anyone have the same issue? |
This worked flawlessly for me. The key part is in the last note. |
@jorgerojas26 Could you list the steps you did for the last note (make changes to the isync formula and build it)? I followed the steps in the link in the last note: uninstall isync ( By the way, running |
I'm on fedora and get a slightly different error:
Does anybody knows what |
Hi!
When I use this on Mac OS, I get the following error with mbsync
Error performing SASL authentication step: SASL(-1): generic failure: Unable to find a callback: 18948
I know this is probably an issue with mbsync, but perhaps there's a way to avoid it without changing isync code?
Thanks!
The text was updated successfully, but these errors were encountered: