Hi, once I set OAUTH2 for Exchange Online Mail account in OTOBO, downloading emails will stop with error as bellow. After edit and save mail account and login to Microsoft, error will stop for next hour. Any idea how to solve this permlamentley ?
Backend ERROR: OTOBO-CGI-00 Perl: 5.32.1 OS: linux Time: Thu Jun 30 17:28:34 2022
Message: CommunicationLog(ID:126465,AccountType:-,AccountID:-,Direction:Incoming,Transport:Email,ObjectLogType:Connection,ObjectLogID:187362)::Kernel::System::MailAccount::POP3 => POP3OAuth2: Could not request access token for XXXX‘. The refresh token could be expired or invalid.
Clear all entries for the failing postmaster account in the database from table auth_token:
Delete using the SQL query: DELETE FROM public.auth_token WHERE account_id=’X‘;
Secondly edit some entries in the file „/opt/otobo/Kernel/System/OAuth.pm“:
Line 183/184 shows:
my $SQL = "SELECT token FROM $Self->{TokenTable} WHERE " . "account_type = LOWER(?) AND account_id = ? AND token_type = 'refresh'";
Adapt the lines to:
my $SQL = "SELECT token FROM $Self->{TokenTable} WHERE " . "account_type = ? AND account_id = ? AND token_type = 'refresh'";
Line 256/257 shows:
SQL => "DELETE FROM $Self->{TokenTable} WHERE " . "account_type = LOWER(?) AND account_id = ? AND token_type = 'refresh'",
Adapt the lines to:
SQL => "DELETE FROM $Self->{TokenTable} WHERE " . "account_type = ? AND account_id = ? AND token_type = 'refresh'",
Once the changes are done. Authenticate the postmaster mail account again and follow up if mail fetch continues to work.
It looks like the refresh token is not being updated on new logins and not being found when searching for because of the „LOWER()“ function in the SQL queries.
Hope this helps you guys too.
KR,
Fred
This reply was modified 9 months, 2 weeks ago by Fred Denaeyer.
This reply was modified 9 months, 2 weeks ago by Fred Denaeyer.
Our website uses cookies. Cookies are tiny text files which are saved in your web browser or by your web browser on your device when you access websites. They contain a characteristic character sequence allowing to clearly identify your browser upon your next visit to the website.
You can prevent the setting of cookies at any time by making the appropriate setting in your internet browser. Cookies that have already been set can be deleted manually or automatically at any time. This is possible in all common internet browsers. If the setting of cookies is deactivated in the browser, not all functions of the website may be fully usable.
We deliberately use very little cookies.
Detailed information can be found in section 4 of our Privacy Policy.
Necessary cookies
Essential Cookies are necessary to deliver this website and some of its features correctly.
For this reason, we do not provide any opportunity here to disable them.
Notwithstanding this, you can deactivate all Cookies in your Browser Settings at any time. Please be aware, however, that this might have an impact on the functionality of this website.
More information about the cookies to be set and how long they will be stored can be found in section 4 of our Privacy Poliy: Privacy Policy.
Google Analytics' Cookies
When you visit this website, Google Analytics sets cookies on your system. This will help us analyse how you use our website ans tailor it to the needs of our visitors. Your IP address will be automatically anonymised (IP anonymisation and deactivation of your User ID). Therefore, we cannot trace which data a certain user is accessing. The data are not saved together with any other personal user data.
You can deactivate tracking in your browser if you do not want us to be able to track your visit on our website.
Privacy Policy
Detailed information on the usage of cookies as well as our Privacy Policy can be found here: