core icon indicating copy to clipboard operation
core copied to clipboard

IMAP backend external app on 4.5.7

Open drsbaitso opened this issue 13 years ago • 19 comments

I use the IMAP backend, and I'm able to log in through the Web GUI, however any of my caldav/carddav, owncloud desktop client and owncloud on my android, they all give me an authentication failed.

I just upgraded to 4.5.7 and the issue was non-existant on 4.5.6.

I don't know if the config file changed? I noticed there are alot more config options in the sample config... should I make these changes in my own config?

drsbaitso avatar Feb 21 '13 13:02 drsbaitso

We need the data/owncloud.log and your webserver configs. please respect the issue guidlines.

BernhardPosselt avatar Feb 27 '13 16:02 BernhardPosselt

I fixed it by adding the below to my config file. I had it before so not sure if I overwrote it with the update or why it was removed. Sorry for any confusion. Still don't know why I was able to login through the WebGUI and not external apps, but meh, it works now.

require_once(dirname(FILE).'/../apps/user_external/lib/imap.php');

/edited for spelling

drsbaitso avatar Feb 28 '13 16:02 drsbaitso

Sounds like a bug. @icewind1991 ?

karlitschek avatar Feb 28 '13 16:02 karlitschek

Just an update...

This is still an issue with 5.0.7. I still have to put require_once(dirname(FILE).'/../apps/user_external/lib/imap.php'); into my config file or IMAP doesn't seem to work.

Everything's set up pretty standard for me, so I don't think it's a wonky configuration on my behalf. Anyone else tested IMAP backend and see this issue?

It works when I use the Web GUI, but any external app (Desktop / Card,CalDAV) bork out. Looks like the password gets cached or something allowing the Web GUI to work (I create the users in ownCloud manually to manage their individual quota and such).

/edited for wording

drsbaitso avatar Jul 09 '13 21:07 drsbaitso

@drsbaitso can you test PR above? It's pretty simple.

VicDeo avatar Jul 10 '13 16:07 VicDeo

Didn't work. I disabled and re-enabled the app and still nothing.

I'm on 5.0.8 now. <--not sure if that matters

drsbaitso avatar Jul 10 '13 16:07 drsbaitso

ah. It's probably in DB already and won't refresh. Can you check if 'prelogin' has been added to the types in app settings?

select * from oc_appconfig where appid='user_external';

VicDeo avatar Jul 10 '13 16:07 VicDeo

It was not, so I deleted all the values and re-enabled the app Now it shows prelogin however authentication still fails.

drsbaitso avatar Jul 10 '13 19:07 drsbaitso

probably caused by https://github.com/owncloud/core/issues/2772

VicDeo avatar Jul 12 '13 16:07 VicDeo

I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.

Please reopen if you still encounter this issue with the latest stable version (currently ownCloud 5.0.9) and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

Thank you!

jancborchardt avatar Aug 08 '13 15:08 jancborchardt

Still don't work with 5.0.10 but I'm fine manually adding the line in the config file.

drsbaitso avatar Aug 17 '13 12:08 drsbaitso

So, can this be added to the config file by default? @vicdeo @icewind1991?

jancborchardt avatar Aug 17 '13 16:08 jancborchardt

I saw someone comment on this in a blog... Not sure if he's right or not, but I attached it below...

"You see the logic in /lib/user.php where it tries to load the backends. If you specify "OC_User_IMAP", that will be checked through class_exists() - which will return false. Makes no sense to me, as this class is registred in the CLASSMAP array"

drsbaitso avatar Aug 17 '13 19:08 drsbaitso

@drsbaitso @jancborchardt it's just another face of https://github.com/owncloud/core/issues/2772 UPD require_once for any app dealing with user backend is not a proper solution, of course

VicDeo avatar Aug 18 '13 12:08 VicDeo

@VicDeo the line also floods the logs with lines: {"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-08-19T01:52:27+00:00"}

edit: when updating settings with administrator user, the line (require_once(dirname(FILE).'/../apps/user_external/lib/imap.php');) is deleted automatically, breaking remote login!

vxq9e7bx avatar Aug 19 '13 01:08 vxq9e7bx

Running: Owncloud 5.0.11 RC2

I can confirm that imap auth is not working for CardDAV in the latest release.

More details:

I'm trying to authenticate with the IMAP backend from a CardDAV client. The authentication fails and in the logs i see the errors reported in https://github.com/owncloud/core/issues/2772. By adding the line suggested by sshambar in https://github.com/owncloud/core/issues/2772#issuecomment-16007420 authentication works.

In the logs however now there are some more warnings:

{"app":"core","message":"User backend OC_User_IMAP not found.","level":3,"time":"2013-09-07T16:39:49+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-07T16:39:49+00:00"}
{"app":"core","message":"include path for class \"OC_User_IMAP\" starts with \"apps\/\"","level":0,"time":"2013-09-07T16:39:49+00:00"}
{"app":"core","message":"User backend OC_User_IMAP not found.","level":3,"time":"2013-09-07T16:39:54+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-07T16:39:54+00:00"}
{"app":"core","message":"include path for class \"OC_User_IMAP\" starts with \"apps\/\"","level":0,"time":"2013-09-07T16:39:54+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-07T16:39:54+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-07T16:39:54+00:00"}
{"app":"core","message":"User backend OC_User_IMAP not found.","level":3,"time":"2013-09-07T16:39:54+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-07T16:39:55+00:00"}
{"app":"core","message":"include path for class \"OC_User_IMAP\" starts with \"apps\/\"","level":0,"time":"2013-09-07T16:39:55+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-07T16:39:55+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-07T16:39:55+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-07T16:39:55+00:00"}

lokeller avatar Sep 07 '13 16:09 lokeller

@lokeller What if you add require_once(dirname(FILE).'/../apps/user_external/lib/imap.php'); right above the $CONFIG in your config file?

drsbaitso avatar Sep 09 '13 12:09 drsbaitso

@drsbaitso This approach also works.

Log when logging in to /remote.php/caldav/principals/username using a browser:

{"app":"core","message":"User backend OC_User_IMAP not found.","level":3,"time":"2013-09-09T15:03:03+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-09T15:03:03+00:00"}
{"app":"core","message":"User backend OC_User_IMAP not found.","level":3,"time":"2013-09-09T15:03:12+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-09T15:03:12+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-09T15:05:11+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:11+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:11+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"Adding default user backend openid.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:12+00:00"}
{"app":"core","message":"User backend OC_User_IMAP already initialized.","level":0,"time":"2013-09-09T15:05:12+00:00"}

lokeller avatar Sep 09 '13 15:09 lokeller

after upgrade to latest stable ({"installed":"true","version":"5.0.25","versionstring":"5.0.13","edition":""}), the line necessary in config.php changed. I had success with: require_once('apps/user_external/lib/imap.php');

but still: changing settings as admin in the interface rewrites the config file, and deletes the file, thus breaking functionality of cal/card-dav clients.

vxq9e7bx avatar Nov 13 '13 07:11 vxq9e7bx