moriyoshi / cyrus-sasl-xoauth2

XOAUTH2 mechanism plugin for cyrus-sasl
MIT License
77 stars 14 forks source link

Install to /usr/lib64/sasl2 instead of /usr/lib/sasl2 #10

Open JoePater opened 2 years ago

JoePater commented 2 years ago

I just spent a good 4 hours trying to figure out why mbsync couldn't detect XOAUTH2 as an authentication method - turns out it's because my distro's cyrus-sasl package installs to /usr/lib64/sasl2, so it wasn't detecting the plugins installed in /usr/lib/sasl2. Changing the pkglibdir variable in the makefile to "${CYRUS_SASL_PREFIX}/lib64/sasl2" fixed it. Might be worth mentioning in the README that this might be an issue.

derekperrin commented 2 years ago

How did you discover this??

I tried using this plugin a year ago and couldn't get it to work, so I gave up. I thought I'd take another crack at it today and saw this issue and it resolved my problem.

JoePater commented 2 years ago

How did you discover this??

I tried using this plugin a year ago and couldn't get it to work, so I gave up. I thought I'd take another crack at it today and saw this issue and it resolved my problem.

I can't remember exactly. I think I found that the program 'pluginviewer' (which I had compiled from scratch from the latest release of cyrus-sasl, and was therefore configured for the usual /usr/lib/sasl2 path) could detect XOAUTH2, but 'sasl2-shared-mechlist' (configured for lib64) could not. I wrote a short C program to replicate the functionality of sasl2-shared-mechlist that initialised libsasl2 then slept indefinitely, then I used pldd to see what shared libraries the program had pulled in. That revealed it was using lib64.

So not a quick fix! What's worse, after a full day trying to get all this to work, it turns out my uni has IMAP disabled, so it was all for nothing. Glad it helped you though.

averter commented 1 year ago

Thanks. This was helpful. For people using debian the installation should be in a different directory: ${CYRUS_SASL_PREFIX}/lib/x86_64-linux-gnu/sasl2% as comprehensively detailed here. Hope this also helps others. Clearly someone should write this info of cyrus-sasl-xoauth2 in the steps.org of oauth2ms.

georgepestell commented 1 year ago

So not a quick fix! What's worse, after a full day trying to get all this to work, it turns out my uni has IMAP disabled, so it was all for nothing. Glad it helped you though.

Hey thanks so much! This worked great on fedora 37 (workspace).

On another note, send an email to your uni IT department they usually can (and hopefully will) give IMAP (and SMTP) access on a per-user basis if you ask.

mujo-hash commented 1 year ago

Thanks @JoePater for reporting this issue and your fix!