Repository: zammad/zammad

Issue #4056: unable to send email via gmail / oauth2
Created: 2022-04-13T21:32:43Z
Infos:

Used Zammad version: 5.1.X
Installation method (source, package, ..): Package
Operating system: Ubuntu 20.04
Database + version: (PostgreSQL) 12.9
Elasticsearch version: 7.17.2
Browser + version: chrome 99.0.4844.84

Expected behavior:

after setting up oauth2 / gmail zammad will be able to send and receive email via the gmail account.

Actual behavior:

zammad is able to receive email via gmail / oauth2 but will not send email

Steps to reproduce the behavior:

configure gmail with oauth2 authentication and try sending an email either by creating or responding to a ticket

Yes I'm sure this is a bug and no feature request or a general question.
log from production.log below while trying to send an email. nothing shows up in sechedule_err or schedule_out.log files.
I, [2022-04-13T11:30:13.786877 #616-7440]  INFO -- : Running job thread for 'Check 'Channel' streams.' (Channel.stream) status is: sleep I, [2022-04-13T11:30:13.787029 #616-7440]  INFO -- : Running job thread for 'Generate 'Session' data.' (Sessions.jobs) status is: sleep I, [2022-04-13T11:30:13.787118 #616-7440]  INFO -- : Running job thread for 'Check channels.' (Channel.fetch) status is: sleep I, [2022-04-13T11:30:13.787360 #616-7440]  INFO -- : Running job thread for 'Process ticket escalations.' (Ticket.process_escalation) status is: sleep I, [2022-04-13T11:30:13.788431 #616-7440]  INFO -- : Running job thread for 'Execute planned jobs.' (Job.run) status is: sleep I, [2022-04-13T11:30:32.900219 #616-11227440]  INFO -- : execute Channel.fetch (try_count 0)... I, [2022-04-13T11:30:32.925750 #616-11227440]  INFO -- : fetching imap (imap.gmail.com/email@address.com port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type=XOAUTH2) I, [2022-04-13T11:30:33.679417 #616-11227440]  INFO -- :  - no message I, [2022-04-13T11:30:33.723060 #616-11227440]  INFO -- : ended Channel.fetch took: 0.840143943 seconds. I, [2022-04-13T11:31:03.936005 #616-11227440]  INFO -- : execute Channel.fetch (try_count 0)... I, [2022-04-13T11:31:03.958615 #616-11227440]  INFO -- : fetching imap (imap.gmail.com/email@address.com port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type=XOAUTH2) I, [2022-04-13T11:31:04.808007 #616-11227440]  INFO -- :  - no message I, [2022-04-13T11:31:04.857575 #616-11227440]  INFO -- : ended Channel.fetch took: 0.947659988 seconds. I, [2022-04-13T11:31:08.987022 #609-182340]  INFO -- : Started PUT "/api/v1/taskbar/13" for 123.456.789.10 at 2022-04-13 11:31:08 -0700 I, [2022-04-13T11:31:09.012062 #609-182340]  INFO -- : Processing by TaskbarController#update as JSON I, [2022-04-13T11:31:09.012262 #609-182340]  INFO -- :   Parameters: {"key"=>"Ticket-7582", "client_id"=>"123", "callback"=>"TicketZoom", "state"=>{"ticket"=>{}, "article"=>{"body"=>"[FILTERED]", "type"=>"email", "subtype"=>"reply", "in_reply_to"=>"<CAD(redacted)JA@mail.gmail.com>", "to"=>"(email address)", "from"=>"customer", "ticket_id"=>"7582", "content_type"=>"text/html", "sender_id"=>"1", "type_id"=>"1", "form_id"=>"874685186"}}, "params"=>{"ticket_id"=>7582, "overview_id"=>5, "init"=>true}, "prio"=>7, "notify"=>false, "active"=>true, "attachments"=>[], "updated_at"=>"2022-04-12T23:41:09.953Z", "id"=>"13"} I, [2022-04-13T11:31:09.080912 #609-182340]  INFO -- : Completed 200 OK in 69ms (Views: 0.9ms | ActiveRecord: 20.5ms | Allocations: 14690) I, [2022-04-13T11:31:11.031349 #609-181980]  INFO -- : Started PUT "/api/v1/tickets/7582?all=true" for 123.456.789.10 at 2022-04-13 11:31:11 -0700 I, [2022-04-13T11:31:11.052873 #609-181980]  INFO -- : Processing by TicketsController#update as JSON I, [2022-04-13T11:31:11.053098 #609-181980]  INFO -- :   Parameters: {"number"=>"50009", "title"=>"test3", "group_id"=>"2", "owner_id"=>"3", "customer_id"=>25, "state_id"=>"2", "priority_id"=>"2", "article"=>{"from"=>"customer", "to"=>"(email address)", "cc"=>"", "subject"=>"", "body"=>"[FILTERED]", "content_type"=>"text/html", "ticket_id"=>7582, "type_id"=>1, "sender_id"=>1, "internal"=>false, "in_reply_to"=>"<CAD(redacted)JA@mail.gmail.com>", "form_id"=>"874685186", "subtype"=>"reply"}, "updated_at"=>"2022-04-13T18:30:06.421Z", "preferences"=>{"channel_id"=>3}, "organization_id"=>nil, "pending_time"=>nil, "id"=>"7582", "all"=>"true"} I, [2022-04-13T11:31:11.448749 #609-181980]  INFO -- : Completed 200 OK in 394ms (Views: 5.6ms | ActiveRecord: 81.7ms | Allocations: 112120) I, [2022-04-13T11:31:11.542536 #609-181000]  INFO -- : Started DELETE "/api/v1/upload_caches/874768995" for 123.456.789.10 at 2022-04-13 11:31:11 -0700 I, [2022-04-13T11:31:11.554441 #609-181000]  INFO -- : Processing by UploadCachesController#destroy as JSON I, [2022-04-13T11:31:11.554577 #609-181000]  INFO -- :   Parameters: {"id"=>"874768995"} I, [2022-04-13T11:31:11.585599 #609-181000]  INFO -- : Completed 200 OK in 31ms (Views: 0.3ms | ActiveRecord: 7.1ms | Allocations: 6920) I, [2022-04-13T11:31:11.838900 #609-180920]  INFO -- : Started POST "/api/v1/integration/smime" for 123.456.789.10 at 2022-04-13 11:31:11 -0700 I, [2022-04-13T11:31:11.852182 #609-180920]  INFO -- : Processing by Integration::SMIMEController#search as JSON I, [2022-04-13T11:31:11.852414 #609-180920]  INFO -- :   Parameters: {"ticket"=>{"group_id"=>"2", "owner_id"=>"3", "state_id"=>"2", "priority_id"=>"2"}, "article"=>{"body"=>"[FILTERED]", "type"=>"note", "internal"=>false, "form_id"=>"874768995", "shared_draft_id"=>"", "subtype"=>"", "in_reply_to"=>"", "to"=>"", "cc"=>"", "subject"=>""}} I, [2022-04-13T11:31:11.891556 #609-180920]  INFO -- : Completed 200 OK in 39ms (Views: 0.5ms | ActiveRecord: 11.0ms | Allocations: 8032) I, [2022-04-13T11:31:13.643105 #609-182280]  INFO -- : Started PUT "/api/v1/taskbar/13" for 123.456.789.10 at 2022-04-13 11:31:13 -0700 I, [2022-04-13T11:31:13.656216 #609-182280]  INFO -- : Processing by TaskbarController#update as JSON I, [2022-04-13T11:31:13.656444 #609-182280]  INFO -- :   Parameters: {"key"=>"Ticket-7582", "client_id"=>"123", "callback"=>"TicketZoom", "state"=>{"ticket"=>{}, "article"=>{"form_id"=>"874768995"}}, "params"=>{"ticket_id"=>7582, "overview_id"=>5, "init"=>true}, "prio"=>7, "notify"=>false, "active"=>true, "attachments"=>[], "updated_at"=>"2022-04-12T23:41:09.953Z", "id"=>"13"} I, [2022-04-13T11:31:13.718112 #609-182280]  INFO -- : Completed 200 OK in 61ms (Views: 0.9ms | ActiveRecord: 21.1ms | Allocations: 14384) I, [2022-04-13T11:31:13.848716 #616-7440]  INFO -- : Scheduler running... I, [2022-04-13T11:31:13.869440 #616-7440]  INFO -- : Running job thread for 'Check 'Channel' streams.' (Channel.stream) status is: sleep I, [2022-04-13T11:31:13.869713 #616-7440]  INFO -- : Running job thread for 'Generate 'Session' data.' (Sessions.jobs) status is: sleep I, [2022-04-13T11:31:13.869873 #616-7440]  INFO -- : Running job thread for 'Check channels.' (Channel.fetch) status is: sleep I, [2022-04-13T11:31:13.870284 #616-7440]  INFO -- : Running job thread for 'Process ticket escalations.' (Ticket.process_escalation) status is: sleep I, [2022-04-13T11:31:13.872109 #616-7440]  INFO -- : Running job thread for 'Execute planned jobs.' (Job.run) status is: sleep

Duplicate issue #4059: Migrating to gmail oauth2 breaks email send, reverting to previous working setup does not resolve the issue
Created: 2022-04-14T17:35:04Z
Infos:

Used Zammad version: 5.1.X
Installation method (source, package, ..): Packages
Operating system: Ubuntu 20.04
Database + version: (PostgreSQL) 12.9
Elasticsearch version: 7.17.2
Browser + version: chrome 99.0.4844.84

Expected behavior:

Migrating from a working email channel setup with a gmail account / app specific password to gmail oauth2 channel using the Migrate Now button and then reverting the migration email will continue to send

Actual behavior:

After migrating from a working email channel setup with a gmail account / app specific password to gmail oauth2 channel using the Migrate Now button and then reverting using the Roll Back Migration button causes no email to send

Steps to reproduce the behavior:

Setup a gmail account using the email channel and verify mail can be sent / received
Select the Migrate now button in Zammad to move to gmail oauth2 authentication
Mail will be received but cannot be sent
Revert to the previous setup using the Rollback Migration button
Mail will be received but cannot be sent
Adding new accounts, changing to a local MTA, etc will not be able to send email.

Yes I'm sure this is a bug and no feature request or a general question.

Closing comment (2022-04-14T17:48:21Z): Duplicate of #4056 which is a technical question.