creecros / Mailmagik

Kanboard Plugin - Send emails to Kanboard and convert to tasks or comments
MIT License
22 stars 3 forks source link

[xx-xxx-xxxxx xx:xx:xx Europe/Berlin] [critical] Mailmagik: ["Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed."] #28

Closed creecros closed 1 year ago

creecros commented 1 year ago

From #25 by @JustFxDev

0.) Fatal Error An incorrect imap e-mal password or something like that disables the plug in. It disappears from the list of installed plugins. This leads to this situation: I cannot correct the password in the application setting / e-mal setup. The fields are no longer there.

Even a new installation does not change this, because the wrong information is still in the database.

I fixed that by changing it directly in the database.

That occurred also as the server had certification problems (this was the reason why I found that initial out)

Error-log: [xx-xxx-xxxxx xx:xx:xx Europe/Berlin] [critical] Mailmagik: ["Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed."]

creecros commented 1 year ago

@alfredbuehler This is due to an infinite loop created by the Folders feature.

$this->template->hook->attach('template:config:email', 'mailmagik:config/config', array(
            'folders' => $this->helper->mailHelper->getFolders(),
        ));

The plugin dies here in Plugin.php and therefore will never load when it cannot authenticate.

alfredbuehler commented 1 year ago

Fixed by b63be9bfc5aab0d97cc51c1280ea35847b583ae6.

creecros commented 1 year ago

not quite. now it dies in the config when it hits the INBOX. image

its been wrapping my brain....

alfredbuehler commented 1 year ago

For testing, I have removed my password from the settings. So I'm unable to login and get the folder list. But I don't see any errors.

creecros commented 1 year ago

i dont have any errors either, i am guessing there is a die() somewhere in the vendor library. im currently clueless, and have been looking at it for an hour already.

alfredbuehler commented 1 year ago

But how did you get the screenshot above?

creecros commented 1 year ago

when i say i have no erros i mean, in my logs. but it clearly dies when loading the config, and it dies at the Folders, since that is where the code stops. Peek

alfredbuehler commented 1 year ago

What says the Webservers log?

creecros commented 1 year ago

my nginx log is empty....

alfredbuehler commented 1 year ago

I tried to enforce with the wrong credentials, no way. Furthermore, not with another IMAP server. Everything works here.

creecros commented 1 year ago

whats your KB version and php? I'll try to match and see if its related to my version somehow

JustFxDev commented 1 year ago

I'am not deeply in that topic, but maybe it is possible to do a test upfront if a connection is possible and then if not force the user to remove the imap config / clear it or to correct it?

Only in case of a working connection the plugin goes on?

Just asking. Sorry if this is nonsense.

JustFxDev commented 1 year ago

Maybe this helps

grafik

This is the environment where i can reproduce this issue

creecros commented 1 year ago

So you can reproduce it? Then its not a version thing.

Curious that alfred cannot reproduce.

I'm in a meeting for another 30 mins, then ill pick this back up.

JustFxDev commented 1 year ago

Moment! Not for actual changes!

I may test this if i get the latest code

JustFxDev commented 1 year ago

Just let me know if i can assist - short explanation how 😄

alfredbuehler commented 1 year ago

I'm getting closer, so let me fix it.

JustFxDev commented 1 year ago

Do your thing! ;-)

creecros commented 1 year ago

sounds good, i wont parallel you this time i swear!

JustFxDev commented 1 year ago

What about a discord place for such things?

creecros commented 1 year ago

you are always welcome to chat me, creecros#4914

JustFxDev commented 1 year ago

Silly question? How does that work?

I'am thinking about a chat chanel in general, but for such issues an other chanel is more than sufficent

creecros commented 1 year ago

you just make a channel and start inviting people. like this.

https://discord.gg/DWQYsqpy

JustFxDev commented 1 year ago

I know 😄

But i'am unsure if this is something people like to use and i would preferre to allow "others" as well to use...

I can start such a chanel.... but how can i tell... i would like to have support to do so....

creecros commented 1 year ago

I am so confused by the question. maybe it is the language barrier.

the only way to know, is to try I guess. I would say, more people are likely to use discord since they are computer oriented people, who more than likely have played a video game in their life, than use something like slack, which is to far to the left for me.... :smile:

JustFxDev commented 1 year ago

I think you understood 😄

Maybe i start a channel...

JustFxDev commented 1 year ago

Off for now.

I wish you a nice, relaxing weekend!

alfredbuehler commented 1 year ago

Meanwhile, I know the source, but not the solution.

That crappy "new Mailbox" doesn't throw an InvalidParameterException nor does it return false, both as documented, when we pass bogus arguments to the call. How can we check the validity of a mailbox then? I'm still on it.

creecros commented 1 year ago

I solved it, can i push?

creecros commented 1 year ago

i pushed.

creecros commented 1 year ago

might make more sense to move that logic up into the login() function so that the function will return false, but basically we need to login, and then test the connection to determine a false.

alfredbuehler commented 1 year ago

sounds good, i wont parallel you this time i swear!

Thank you for the fish! :(

creecros commented 1 year ago

How can we check the validity of a mailbox then?

it sounded like you were asking me, and so i found the answer, figured you would notice the push. my bad.