Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-12078

send() Scripting API doesn't wait for the mail to be sent before returning

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1-milestone-2, 6.4.5
    • 6.4-milestone-3
    • Mail
    • None
    • Unit, Integration
    • Unknown

    Description

      example:

      $services.mailsender.send($messages, 'database').getStatusResult().getSize()
      

      will return 0 even if a mail has been sent.

      The reason is:

      • send() will do a wait to verify if the mail has been sent before returning
      • However the implementation is bad since it checks if the mail is on the send mail queue and if it can't find it then it considers that the mail has been sent!
      • since the mail first gets prepared on the prepare queue before being put on the mail send queue, the send() will return immediately before the mail has been sent!

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: