After 7.10.27 upgrade the outbound email settings (Admin->Email Settings) can not be saved. The upgrade also cleared off the outbound mail settings which were already set preor the upgrade. This broke down all task/meetings and other system notifications that need to use the default outbound email account.
Outbound email settings (server host, username, password) can be saved in Admin->Email Settings
Outbound email settings (server host, username, password) can NOT be saved in Admin->Email Settings
This broke down all task/meetings and other system notifications that need to use the default outbound email account. Quite urgent to resolve.
Further investigation shows that this issue is caused when there are multiple type->'system' entries in table outbound_email. Once only one row of type 'system' is left in the table, everything works fine.
Suggested resolution is for the code to be able to handle multiple type: 'system' and 'system-override' entries.
I thought system account had to be unique. What is the meaning of having more than one? How do they get used?
system had several entries. Only one row had deleted=0, rest were with deleted=1.
i.e. several system outbound email settings set and consequently deleted over the years.
I havent tested it but I think it is the code in include/OutboundEmail/OutboundEmail.php
public function saveSystem()
{
$q = "SELECT id FROM outbound_email WHERE type = 'system'";
query will return IDs for deleted rows. I think query should be
$q = "SELECT id FROM outbound_email WHERE type = 'system' AND deleted = 0";
Anyway, we resolved it by simply cleaning up the table from the obsolete (deleted) rows. Issue is resolved for us, but Im leaving the ticket open in case anyone else has a similar issue.
Thanks for your investigation work, will leave this hear as i know there definitely needs to be some improvements in this area.
If anyone is willing to update that SQL via PR please be our guest sings
Most helpful comment
I havent tested it but I think it is the code in include/OutboundEmail/OutboundEmail.php
query will return IDs for deleted rows. I think query should be
$q = "SELECT id FROM outbound_email WHERE type = 'system' AND deleted = 0";Anyway, we resolved it by simply cleaning up the table from the obsolete (deleted) rows. Issue is resolved for us, but Im leaving the ticket open in case anyone else has a similar issue.