Skip to content

Commit

Permalink
Prefill SMTP username and password for MS365 if those fields are empt…
Browse files Browse the repository at this point in the history
…y - closes #4151
  • Loading branch information
freescout-help-desk committed Jul 31, 2024
1 parent efca2ac commit 2dc8d06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Http/Controllers/MailboxesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,8 +946,10 @@ public function oauth(Request $request)
if (!empty($token_data['a_token'])) {
// Set username and password for the oppozite in_out.
if ($in_out == 'in') {
$mailbox->out_username = $username;
$mailbox->out_password = $password;
if (empty($mailbox->out_server) || stristr($mailbox->out_server, '.office365.com') ) {
$mailbox->out_username = $username;
$mailbox->out_password = $password;
}
//$mailbox->out_method = Mailbox::OUT_METHOD_SMTP;
} else {
$mailbox->in_username = $username;
Expand Down

0 comments on commit 2dc8d06

Please sign in to comment.