@@ -113,7 +113,6 @@ gem 'omniauth-weibo-oauth2', git: 'https://github.com/zammad-deps/omniauth-weibo
gem 'rack-attack'
# channels
-gem 'gmail_xoauth'
gem 'koala'
gem 'telegram-bot-ruby'
gem 'twitter'
@@ -261,8 +261,6 @@ GEM
gli (2.21.1)
globalid (1.2.1)
activesupport (>= 6.1)
- gmail_xoauth (0.4.3)
- oauth (>= 0.3.6)
graphql (2.2.5)
racc (~> 1.4)
graphql-batch (0.5.3)
@@ -360,7 +358,7 @@ GEM
net-protocol
net-protocol (0.2.2)
timeout
- net-smtp (0.3.3)
+ net-smtp (0.4.0.1)
nio4r (2.5.9)
nkf (0.1.3)
@@ -749,7 +747,6 @@ DEPENDENCIES
execjs
factory_bot_rails
faker
- gmail_xoauth
graphql
graphql-batch
hiredis
@@ -0,0 +1,21 @@
+# Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
+
+require 'net/smtp'
+class Net::SMTP
+ class AuthXoauth2 < Net::SMTP::Authenticator
+ auth_type :xoauth2
+ def auth(user, secret)
+ token = xoauth2_string(user, secret)
+ finish("AUTH XOAUTH2 #{base64_encode(token)}")
+ end
+ private
+ def xoauth2_string(user, secret)
+ "user=#{user}\1auth=Bearer #{secret}\1\1"
+end
@@ -146,7 +146,7 @@ RSpec.describe EmailHelper::Probe, integration: true, required_envs: %w[MAIL_SER
let(:message_human) { [ 'This host cannot be reached.', 'There is no route to this host.' ] }
before do
- allow(Socket).to receive(:tcp).and_raise(Errno::EHOSTUNREACH)
+ allow(TCPSocket).to receive(:open).and_raise(Errno::EHOSTUNREACH)
end
include_examples 'probe tests with invalid result'
@@ -1,5 +1,7 @@
# Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
+require 'net/imap'
module ImapHelper
def imap_delete_old_mails(options)
imap = ::Net::IMAP.new(options[:host], port: options[:port], ssl: (options[:ssl] ? { verify_mode: OpenSSL::SSL::VERIFY_NONE } : false))