sendTicketMessageByEmail() unconditionally told the admin
'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'
whenever sendfile() returned false and $mailfile->error was empty.
sendfile() can also fail with an empty error on transient SMTP
errors or connection timeouts, so the message lied whenever
MAIN_DISABLE_ALL_MAILS was not actually configured — confusing
admins about why delivery failed.
Branch on getDolGlobalString('MAIN_DISABLE_ALL_MAILS'):
* true -> keep the disabled-feature notice
* false -> fall through to ErrorFailedToSendMail and a syslog
entry noting sendfile() returned false with no
specific error.
Fixes #37994
Signed-off-by: SAY-5 <say.apm35@gmail.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
72306e9e8f
commit
2003f4bf95
1 changed files with 2 additions and 2 deletions
|
|
@ -3308,12 +3308,12 @@ class Ticket extends CommonObject
|
|||
$langs->load("other");
|
||||
if ($mailfile->error) {
|
||||
setEventMessages($langs->trans('ErrorFailedToSendMail', $from, $receiverstring), null, 'errors');
|
||||
dol_syslog($langs->trans('ErrorFailedToSendMail', $from, $receiverstring).' : '.$mailfile->error);
|
||||
dol_syslog('ErrorFailedToSendMail from='.$from.' to='.$receiverstring.' : '.$mailfile->error);
|
||||
} elseif (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
|
||||
setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('ErrorFailedToSendMail', $from, $receiverstring), null, 'errors');
|
||||
dol_syslog('ErrorFailedToSendMail (no error details) from='.$from.' to='.$receiverstring, LOG_WARNING);
|
||||
dol_syslog('ErrorFailedToSendMail from='.$from.' to='.$receiverstring.' : (no error details)', LOG_WARNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue