Skip to content
Snippets Groups Projects
  • Martin Trigaux's avatar
    506e397e
    [IMP] mail: avoid sending an email twice · 506e397e
    Martin Trigaux authored
    In some specific conditions (e.g. admin logging during cron run, concurrent update), writing on the mail object may fail, triggering a rollback of the transaction.
    As the write was done after the SMTP sendmail action, an email could be sent twice (state not correctly put, would be retried at next process of the email queue).
    This patch provoke the error before the sendmail action and thus avoids sending the email.
    Fixes #552
    506e397e
    History
    [IMP] mail: avoid sending an email twice
    Martin Trigaux authored
    In some specific conditions (e.g. admin logging during cron run, concurrent update), writing on the mail object may fail, triggering a rollback of the transaction.
    As the write was done after the SMTP sendmail action, an email could be sent twice (state not correctly put, would be retried at next process of the email queue).
    This patch provoke the error before the sendmail action and thus avoids sending the email.
    Fixes #552