AUTHENTICATE failed when add new email

Infos:

  • Used Zammad version: 3.6
  • Installation method (source, package, …): aptitude debian repository
  • Operating system: Linux zammad 4.9.0-14-amd64 #1 SMP Debian 4.9.240-2 (2020-10-30) x86_64 GNU/Linux
  • Database + version: PG 9.6
  • Elasticsearch version: 5.6.16
  • Browser + version: Firefox 83.0 or Google Chrome Wersja 87.0.4280.88 (Oficjalna wersja) (64-bitowa)

Expected behavior:

  • add new email account via office365 to Zammad

Actual behavior:

  • on screen named Channel
    obraz
  • I click on OK and I have error from Zammad
    obraz

Steps to reproduce the behavior:

Yes I’m sure this is a bug and no feature request or a general question.
production.log :

I, [2020-12-16T14:53:10.194857 #1401-47242936489120] INFO – : Started POST “/api/v1/channels_microsoft365_inbound/11” for 192.168.80.1 at 2020-12-16 14:53:10 +0100
I, [2020-12-16T14:53:10.199894 #1401-47242936489120] INFO – : Processing by ChannelsMicrosoft365Controller#inbound as JSON
I, [2020-12-16T14:53:10.199952 #1401-47242936489120] INFO – : Parameters: {“options”=>{“folder”=>"", “keep_on_server”=>false}, “active”=>true, “id”=>“11”}
I, [2020-12-16T14:53:10.208707 #1401-47242936489120] INFO – : fetching imap (outlook.office365.com/general@ekspert.biz port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type
=XOAUTH2)
E, [2020-12-16T14:53:10.536921 #1401-47242936489120] ERROR – : AUTHENTICATE failed. (Exceptions::UnprocessableEntity)
/opt/zammad/app/controllers/channels_microsoft365_controller.rb:77:in inbound' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/basic_implicit_render.rb:6:in send_action’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:194:in process_action' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/rendering.rb:30:in process_action’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:42:in block in process_action' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:109:in block in run_callbacks’
/opt/zammad/app/controllers/application_controller/has_secure_content_security_policy_for_downloads.rb:18:in block (4 levels) in <module:HasSecureContentSecurityPolicyForDownloads>' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:180:in subscribed’
/opt/zammad/app/controllers/application_controller/has_secure_content_security_policy_for_downloads.rb:17:in block (3 levels) in <module:HasSecureContentSecurityPolicyForDownloads>' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:180:in subscribed’
/opt/zammad/app/controllers/application_controller/has_secure_content_security_policy_for_downloads.rb:16:in block (2 levels) in <module:HasSecureContentSecurityPolicyForDownloads>' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in instance_exec’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in block in run_callbacks' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:136:in run_callbacks’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/abstract_controller/callbacks.rb:41:in process_action' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/rescue.rb:22:in process_action’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:34:in block in process_action' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in block in instrument’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:in instrument' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in instrument’
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/instrumentation.rb:32:in `process_action’

/opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal/params_wrapper.rb:256:in
process_action' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/railties/controller_runtime.rb:24:in process_action’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/abstract_controller/base.rb:134:in process' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/rendering.rb:32:in process’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:191:in dispatch' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_controller/metal.rb:252:in dispatch’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:52:in dispatch' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:34:in serve’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:52:in block in serve' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:in each’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/journey/router.rb:35:in serve' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/routing/route_set.rb:840:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:420:in call_app!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-saml-1.10.1/lib/omniauth/strategies/saml.rb:89:in other_phase’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:190:in call!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/omniauth-1.9.1/lib/omniauth/builder.rb:45:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/etag.rb:27:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/conditional_get.rb:40:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/head.rb:12:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/http/content_security_policy.rb:18:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in context’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/cookies.rb:670:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:28:in block in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:98:in run_callbacks’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/callbacks.rb:26:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/debug_exceptions.rb:61:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/show_exceptions.rb:33:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:38:in call_app’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in block in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in block in tagged’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:28:in tagged' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in tagged’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/rack/logger.rb:26:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/remote_ip.rb:81:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/request_id.rb:27:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/executor.rb:14:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.4.4/lib/action_dispatch/middleware/static.rb:127:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/engine.rb:524:in call’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/configuration.rb:227:in call' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/server.rb:706:in handle_request’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/server.rb:476:in process_client' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/server.rb:334:in block in run’ /opt/zammad/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/thread_pool.rb:135:in block in spawn_thread' /opt/zammad/vendor/bundle/ruby/2.6.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in block in create_with_logging_context’
I, [2020-12-16T14:53:10.537691 #1401-47242936489120] INFO – : Completed 422 Unprocessable Entity in 338ms (Views: 0.2ms | ActiveRecord: 2.1ms)
I, [2020-12-16T14:53:13.036235 #1312-47200673921440] INFO – : Scheduler running…
I, [2020-12-16T14:53:13.044098 #1312-47200673921440] INFO – : Running job thread for ‘Check Channels’ (Channel.fetch) status is: sleep
I, [2020-12-16T14:53:13.044289 #1312-47200673921440] INFO – : Running job thread for ‘Process escalation tickets’ (Ticket.process_escalation) status is: sleep
I, [2020-12-16T14:53:13.044361 #1312-47200673921440] INFO – : Running job thread for ‘Import OTRS diff load’ (Import::OTRS.diff_worker) status is: sleep
I, [2020-12-16T14:53:13.044439 #1312-47200673921440] INFO – : Running job thread for ‘Check streams for Channel’ (Channel.stream) status is: sleep
I, [2020-12-16T14:53:13.045022 #1312-47200673921440] INFO – : Running job thread for ‘Execute jobs’ (Job.run) status is: sleep

I have the same issue, but it’s second on the list at the moment - I can only connect the main 365 admin account anyway as there’s a permissions problem somewhere in AAD to fix first. 3 weeks with MS support and they haven’t yet tried anything that I hadn’t already done before contacting them.

I’m running Ubuntu (one on 18.04.05 one upgraded to 20.04.01 - both from apt repo installed as per standard docs) if that helps narrow it down.
I have other problems as well (regularly zammad stops responding to http but service is running, sometimes http works and IMAP mailboxes are unchecked for hours) so I’m close to giving up at the moment.

Anyway - please update if you find the fix, you may just save my remaining hair when I get to that point.

Update: I’ve got the first issue sorted. This one is still an problem, but if you ignore it (i.e. cancel on that prompt) the account is added anyway, but disabled. If you then activate it, everything seems to work, both inbound and outbound.

I have an additional problem. Shared mailbox. It does not take a \ character in the name.

Zammad will still prompt the popup if it didn’t receive an answer if you reload the page in question.
If that happens, could you please verify that you receive “AUTHENTICATE failed” only if you select “keep messages on server = false” ?

That’s not how Zammad channels work.
You have to add shared mailboxes directly.

What you’re trying there affects aliases and thus will never work.

Sorry, but you’re being striked by a bug:

Sketchy Workaround

You can workaround this by closing the dialogue in question and update the channel in question to “active”. Wait about 30-60 seconds until the state color of the channel changes from yellowish to greenish, hit “EDIT” and change the settings if you want to.

However, this comes with a price
Zammad by default removes all mails from your mail server. This means that above workaround removes mails from your inbox. If you don’t want that, you should not use this work around.

hi MrGeneration. Can you explain what you mean by writing “add shared mailboxes directly”?
Shared mailboxes do not have passwords and access by themselves. You need the credentials of the user who has access to this mailbox. This is how I have now set up in Zammad, and works. “general@…” is the user account obraz
Of course I’m talking about shared mailboxes in MS Exchange (O365)

In fact shared mailboxes do have an account, just go to your O365 admin=>users=>active users, and you’ll see them listed there. You can reset the password, and use the username to login. It works fine for me;

1 Like

@olafbuitelaar actually was pointing out what I was talking about.
Don’t try to add not supported characters to the email address.

The microsoft 365 and google channel to not support shared ressources if you do not add them directly via the add procedure. While you technically can change / adjust the email address after, this will not change the account and probably even lead to a no longer working channel.

Microsoft and Google are (correctly) very strict about user aliases.

It’s works! Thx :slight_smile:

1 Like

@MBekspert can you share with us how you solved the issue please? would be awesome!

Works as @MrGeneration wrote and @olafbuitelaar showed on image .png.
Before there wasn’t (in my opinion) a password reset for a shared mailbox on MS Portal.
Now it is, I reset my password, gave these credentials in Zammad and it works like a charm.

1 Like

Just a follow up.
This issue has been fixed within the last days and was backported to stable.

After updating to the most current stable release of Zammad should remove this issue.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.