Upgraded the undelaying server and has resulted in bizarre email behaviour

We have build a new server and migrated the database and the HTML folder from the old server to the new server.

The old server is:
Ubunutu 16
PHP 7.0
mysql 5.6

New server
Ubunutu 20
PHP 7.2
mariadb 10.3

Our CRM version:

Version 7.10.7
Sugar Version 6.5.25 (Build 344)

All seems to be working well but inbound and out bound emails do not work. I can send an email using the test button within the outbound email settings, but all the other times it says cannot authenticate.

When saving the outbound email setting, these errors appear in the apache error log:

[Wed May 19 15:52:16.114709 2021] [php7:notice] [pid 25375] [client 192.168.1.236:62745] PHP Notice: Undefined index: LBL_SMTP_FROM_NAME in /var/www/html/custom/VIAutoPopulateFieldsRelateFieldName.php on line 55, referer: http://cs.xxxxxxxx.co.uk/index.php
[Wed May 19 15:52:16.114731 2021] [php7:notice] [pid 25375] [client 192.168.1.236:62745] PHP Notice: Undefined index: LBL_SMTP_FROM_NAME in /var/www/html/custom/VIAutoPopulateFieldsRelateFieldName.php on line 60, referer: http://cs.xxxxxxxx.co.uk/index.php
[Wed May 19 15:52:16.114736 2021] [php7:notice] [pid 25375] [client 192.168.1.236:62745] PHP Notice: Undefined index: LBL_SMTP_FROM_ADDR in /var/www/html/custom/VIAutoPopulateFieldsRelateFieldName.php on line 55, referer: http://cs.xxxxxxxx.co.uk/index.php
[Wed May 19 15:52:16.114740 2021] [php7:notice] [pid 25375] [client 192.168.1.236:62745] PHP Notice: Undefined index: LBL_SMTP_FROM_ADDR in /var/www/html/custom/VIAutoPopulateFieldsRelateFieldName.php on line 60, referer: http://cs.xxxxxxxx.co.uk/index.php
[Wed May 19 15:52:16.114744 2021] [php7:notice] [pid 25375] [client 192.168.1.236:62745] PHP Notice: Undefined index: LBL_CHOOSE_EMAIL_PROVIDER in /var/www/html/custom/VIAutoPopulateFieldsRelateFieldName.php on line 55, referer: http://cs.xxxxxxxx.co.uk/index.php
[Wed May 19 15:52:16.114749 2021] [php7:notice] [pid 25375] [client 192.168.1.236:62745] PHP Notice: Undefined index: LBL_CHOOSE_EMAIL_PROVIDER in /var/www/html/custom/VIAutoPopulateFieldsRelateFieldName.php on line 60, referer: http://cs.xxxxxxxx.co.uk/index.php

Both servers have the following php modules installed

  • bz2
  • calendar
  • Core
  • ctype
  • curl
  • date
  • dom
  • exif
  • fileinfo
  • filter
  • ftp
  • gd
  • gettext
  • hash
  • iconv
  • imagick
  • imap
  • json
  • libxml
  • mbstring
  • mcrypt
  • mysqli
  • mysqlnd
  • openssl
  • pcntl
  • pcre
  • PDO
  • pdo_mysql
  • Phar
  • posix
  • readline
  • Reflection
  • session
  • shmop
  • SimpleXML
  • sockets
  • SPL
  • standard
  • sysvmsg
  • sysvsem
  • sysvshm
  • tokenizer
  • wddx
  • xml
  • xmlreader
  • xmlwriter
  • xsl
  • Zend OPcache
  • zip
  • zlib

The new server has a sodium as well installed, but this must be a default module as i have not installed it.

I there is also inbound error messages, but as we have took this system off line until we get outbound emails fixed, I can not replicated this issue yet, I am hoping when we fix outbound, inbound will be fixed as well.

EDIT:
I think the error log is nothing, I releaise that is a plugin causing the issue and i have uninstalled it and it is still the same.

So if i edit an outbound email account and put in the password and send a test message it works, I then save it, then go back in to the edit screen and send another test message it fails, with:

3: Connection: opening to smtp.office365.com:587, timeout=300, options=array (
)
3: Connection: opened
2: SERVER -> CLIENT: 220 LO2P265CA0112.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 20 May 2021 15:15:38 +0000

1: CLIENT -> SERVER: EHLO cs.xxxxxxxx.co.uk

2: SERVER -> CLIENT: 250-LO2P265CA0112.outlook.office365.com Hello [51.219.56.126]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

1: CLIENT -> SERVER: STARTTLS

2: SERVER -> CLIENT: 220 2.0.0 SMTP server ready

1: CLIENT -> SERVER: EHLO cs.xxxxxxxx.co.uk

2: SERVER -> CLIENT: 250-LO2P265CA0112.outlook.office365.com Hello [51.219.56.126]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

1: CLIENT -> SERVER: AUTH LOGIN

2: SERVER -> CLIENT: 334 VXNlcm5hbWU6

1: CLIENT -> SERVER: obfuscated
2: SERVER -> CLIENT: 334 UGFzc3dvcmQ6

1: CLIENT -> SERVER: obfuscated
2: SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful [LO2P265CA0112.GBRP265.PROD.OUTLOOK.COM]

1: SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [LO2P265CA0112.GBRP265.PROD.OUTLOOK.COM]

3: SMTP Error: Could not authenticate.
1: CLIENT -> SERVER: QUIT

2: SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel

3: Connection: closed
3: SMTP Error: Could not authenticate.