From a51189e6f6c49216378d49b2dbfbb5433a451194 Mon Sep 17 00:00:00 2001 From: Rohit Singhal Date: Mon, 9 Mar 2020 08:07:12 +0530 Subject: [PATCH] Removing INBOX as default IMAP folder --- app/Console/Commands/FetchEmails.php | 7 ------- app/Http/Controllers/MailboxesController.php | 8 +++----- resources/views/mailboxes/connection_incoming.blade.php | 3 +-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/Console/Commands/FetchEmails.php b/app/Console/Commands/FetchEmails.php index 3201afb2..845e0811 100644 --- a/app/Console/Commands/FetchEmails.php +++ b/app/Console/Commands/FetchEmails.php @@ -107,14 +107,7 @@ class FetchEmails extends Command // Connect to the Server $client->connect(); - // Get INBOX folder $folders = []; - $folder = $client->getFolder('INBOX'); - - if (!$folder) { - throw new \Exception('Could not get mailbox folder: INBOX', 1); - } - $folders[] = $folder; // Fetch emails from custom IMAP folders. if ($mailbox->in_protocol == Mailbox::IN_PROTOCOL_IMAP) { diff --git a/app/Http/Controllers/MailboxesController.php b/app/Http/Controllers/MailboxesController.php index caaefcd7..79366f5f 100644 --- a/app/Http/Controllers/MailboxesController.php +++ b/app/Http/Controllers/MailboxesController.php @@ -255,7 +255,7 @@ class MailboxesController extends Controller // Sometimes background job continues to use old connection settings. \Helper::queueWorkRestart(); - + \Session::flash('flash_success_floating', __('Connection settings saved!')); return redirect()->route('mailboxes.connection', ['id' => $id]); @@ -325,9 +325,7 @@ class MailboxesController extends Controller // Save all custom folders except INBOX. $in_imap_folders = []; foreach ($request->in_imap_folders as $imap_folder) { - if (mb_strtolower($imap_folder) != 'inbox') { - $in_imap_folders[] = $imap_folder; - } + $in_imap_folders[] = $imap_folder; } $mailbox->setInImapFolders($in_imap_folders); @@ -537,7 +535,7 @@ class MailboxesController extends Controller $response['msg'] = __(':host is not available on :port port. Make sure that :host address is correct and that outgoing port :port on YOUR server is open.', ['host' => ''.$mailbox->in_server.'', 'port' => ''.$mailbox->in_port.'']); } } - + if (!$response['msg']) { $test_result = false; diff --git a/resources/views/mailboxes/connection_incoming.blade.php b/resources/views/mailboxes/connection_incoming.blade.php index ce31fb7c..1c7f7679 100644 --- a/resources/views/mailboxes/connection_incoming.blade.php +++ b/resources/views/mailboxes/connection_incoming.blade.php @@ -126,7 +126,6 @@