diff --git a/README.md b/README.md index f77777b43..8a01eb8ce 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@
- +

-[![PHP version](https://freescout-helpdesk.github.io/img/badges/PHP-7.1%2B-blue.svg)](https://github.com/freescout-helpdesk/freescout#requirements) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Ffreescout-helpdesk%2Ffreescout&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) +[![PHP version](https://freescout-helpdesk.github.io/img/badges/PHP-7.1%2B-blue.svg)](https://github.com/freescout-help-desk/freescout#requirements) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Ffreescout-helpdesk%2Ffreescout&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
@@ -81,7 +81,7 @@ There are no minimum system requirements (CPU / RAM) – FreeScout will run on a ## Installation -[Installation Guide](https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide) +[Installation Guide](https://github.com/freescout-help-desk/freescout/wiki/Installation-Guide) Images & one-click installs: @@ -89,7 +89,7 @@ Images & one-click installs: * [Softaculous](http://www.softaculous.com/apps/customersupport/FreeScout) (cPanel, Plesk, ISPmanager, H-Sphere, DirectAdmin, InterWorx) * [Fantastico](http://ff3.netenberg.com/visitors/scripts/freescout/view) (cPanel, DirectAdmin, ISP Manager, ISP Config) * [Cloudron](https://cloudron.io/store/net.freescout.cloudronapp.html) -* [Ubuntu](https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide#interactive-installation-bash-script-ubuntu) (bash script) +* [Ubuntu](https://github.com/freescout-help-desk/freescout/wiki/Installation-Guide#interactive-installation-bash-script-ubuntu) (bash script) ## Cloud Hosted @@ -115,10 +115,10 @@ Don't miss news, updates and new modules! ## Contributing -* [Support the project by leaving a feedback](https://github.com/freescout-helpdesk/freescout/issues/288) -* [Development Guide](https://github.com/freescout-helpdesk/freescout/wiki/Development-Guide) -* [Todo list](https://github.com/freescout-helpdesk/freescout/labels/help%20wanted) -* [Translate](https://github.com/freescout-helpdesk/freescout/wiki/Translate) +* [Support the project by leaving a feedback](https://github.com/freescout-help-desk/freescout/issues/288) +* [Development Guide](https://github.com/freescout-help-desk/freescout/wiki/Development-Guide) +* [Todo list](https://github.com/freescout-help-desk/freescout/labels/help%20wanted) +* [Translate](https://github.com/freescout-help-desk/freescout/wiki/Translate) ## Screenshots diff --git a/app/Mailbox.php b/app/Mailbox.php index 89d47a855..30964a77d 100644 --- a/app/Mailbox.php +++ b/app/Mailbox.php @@ -977,6 +977,13 @@ public function oauthGetParam($param) return $this->meta['oauth'][$param] ?? ''; } + public function outOauthEnabled() + { + return $this->oauthEnabled() + && !strstr($this->out_username, '@') + && stristr($this->out_server, '.office365.com'); + } + public function setEmailAttribute($value) { if ($value) { diff --git a/app/Misc/Helper.php b/app/Misc/Helper.php index 516ce6b7d..42bab006e 100644 --- a/app/Misc/Helper.php +++ b/app/Misc/Helper.php @@ -1970,6 +1970,10 @@ public static function checkRequiredFunctions() 'fpassthru (PHP)' => function_exists('fpassthru'), 'symlink (PHP)' => function_exists('symlink'), 'iconv (PHP)' => function_exists('iconv'), + // If posix_isatty() function is not enabled on the server the question in the + // console command makes it wait infinitely and be aborted. + // Commands should avoid using interctive functions or use special flags. + //'posix_isatty (PHP)' => function_exists('posix_isatty'), 'pcntl_signal (console PHP)' => function_exists('shell_exec') ? (int)\Helper::shellExec('php -r "echo (int)function_exists(\'pcntl_signal\');"') : false, 'ps (shell)' => function_exists('shell_exec') ? \Helper::shellExec('ps') : false, ]; diff --git a/app/Misc/Mail.php b/app/Misc/Mail.php index 735977c9a..979db59b3 100644 --- a/app/Misc/Mail.php +++ b/app/Misc/Mail.php @@ -101,10 +101,10 @@ public static function setMailDriver($mailbox = null, $user_from = null, $conver { if ($mailbox) { // Configure mail driver according to Mailbox settings. - $oauth = $mailbox->oauthEnabled(); + $oauth = $mailbox->outOauthEnabled(); // Refresh Access Token. - if ($oauth && !strstr($mailbox->out_username, '@')) { + if ($oauth) { if ((strtotime($mailbox->oauthGetParam('issued_on')) + (int)$mailbox->oauthGetParam('expires_in')) < time()) { // Try to get an access token (using the authorization code grant) $token_data = \MailHelper::oauthGetAccessToken(\MailHelper::OAUTH_PROVIDER_MICROSOFT, [ @@ -134,7 +134,7 @@ public static function setMailDriver($mailbox = null, $user_from = null, $conver if ($mailbox->out_method == Mailbox::OUT_METHOD_SMTP) { \Config::set('mail.host', $mailbox->out_server); \Config::set('mail.port', $mailbox->out_port); - if ($oauth && !strstr($mailbox->out_username, '@')) { + if ($oauth) { \Config::set('mail.auth_mode', 'XOAUTH2'); \Config::set('mail.username', $mailbox->email); \Config::set('mail.password', $mailbox->oauthGetParam('a_token')); diff --git a/config/app.php b/config/app.php index b55c83066..0144bc950 100644 --- a/config/app.php +++ b/config/app.php @@ -18,7 +18,7 @@ | or any other location as required by the application or its packages. */ - 'version' => '1.8.144', + 'version' => '1.8.145', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2024_06_18_010101_add_index_to_threads_table.php b/database/migrations/2024_06_18_010101_add_index_to_threads_table.php new file mode 100644 index 000000000..310c6dccf --- /dev/null +++ b/database/migrations/2024_06_18_010101_add_index_to_threads_table.php @@ -0,0 +1,39 @@ +index(['created_at']); + }); + // Schema::table('conversations', function (Blueprint $table) { + // $table->index(['mailbox_id', 'state', 'status'], 'conversations_id_state_status'); + // }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('threads', function (Blueprint $table) { + $table->dropIndex(['created_at']); + }); + // Schema::table('conversations', function (Blueprint $table) { + // $table->dropIndex('conversations_id_state_status'); + // }); + } +} diff --git a/resources/views/mailboxes/connection.blade.php b/resources/views/mailboxes/connection.blade.php index 8622cefaf..82618a658 100644 --- a/resources/views/mailboxes/connection.blade.php +++ b/resources/views/mailboxes/connection.blade.php @@ -85,13 +85,13 @@ @php - $oauth_fully_enabled = ($mailbox->oauthEnabled() && strstr($mailbox->out_username, '@')); + $out_oauth_enabled = $mailbox->outOauthEnabled(); @endphp
- out_method == App\Mailbox::OUT_METHOD_SMTP) @endif autofocus {{-- This added to prevent autocomplete in Chrome --}}autocomplete="new-password" @if ($oauth_fully_enabled) readonly @endif> + out_method == App\Mailbox::OUT_METHOD_SMTP) @endif autofocus {{-- This added to prevent autocomplete in Chrome --}}autocomplete="new-password" @if ($out_oauth_enabled) readonly @endif> @include('partials/field_error', ['field'=>'out_username'])
@@ -100,15 +100,15 @@
- out_method == App\Mailbox::OUT_METHOD_SMTP) @endif autofocus {{-- This added to prevent autocomplete in Chrome --}}autocomplete="new-password" @if ($oauth_fully_enabled) readonly @endif> + out_method == App\Mailbox::OUT_METHOD_SMTP) @endif autofocus {{-- This added to prevent autocomplete in Chrome --}}autocomplete="new-password" @if ($out_oauth_enabled) readonly @endif>

- oauthGetParam('provider') == \MailHelper::OAUTH_PROVIDER_MICROSOFT) class="text-success" @endif>Microsoft Exchange + oauthGetParam('provider') == \MailHelper::OAUTH_PROVIDER_MICROSOFT && $out_oauth_enabled) class="text-success" @endif>Microsoft Exchange @if (!$mailbox->oauthEnabled()) @if ($mailbox->out_username && $mailbox->out_password && !strstr($mailbox->out_username, '@')) – {{ __('Connect') }} @endif - @elseif ($mailbox->oauthGetParam('provider') == \MailHelper::OAUTH_PROVIDER_MICROSOFT && $oauth_fully_enabled) + @elseif ($mailbox->oauthGetParam('provider') == \MailHelper::OAUTH_PROVIDER_MICROSOFT && $out_oauth_enabled) – {{ __('Disconnect') }} @endif ({{ __('Help') }})