Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


There's been a lot of changes in respect of MailMerge with LibreOffice 5.2 onwards and I've been caught out by some of these changes and raised bug reports for -

bug 102951 <https://bugs.documentfoundation.org/show_bug.cgi?id=102951> for the MailMerge wizard which has been resolved as just a change of the MailMerge GUI being split;

bug 102010 <https://bugs.documentfoundation.org/show_bug.cgi?id=102010> which is still waiting for a fix

Anyway, I've moved on and done some testing of the SendMail part of MailMerge and encountered what appears to be a race condition. In that if I generate a MailMerge for 2 recipients -

1. the email for the second recipient appears to be never sent and
   definitely never ever received.
2. the success of the email for the first recipient is that it always
   looks like it's been sent but mostly it's never received. When it is
   received it is occasionally corrupted.

However if I put in 2 sleeps in the file sw/source/ui/dbui/mmoutputtypepage.cxx as per this git diff, below, I consistently see the emails being sent and received successfully. This would appear to suggest that it's thread related though I have no knowledge of threads so I could be way of the mark here.

Unrelated, I've done some changes to the file mailmerge.py to enable me to send messages through the "mail.btinternet.com" smtp server so it would be good to discuss these changes with someone. Any suggestions as to who?

For the suspected race condition should I raise a bug with my findings or wait to discuss with someone more knowledgeable?

Alex

index 5e42b2f..52db84c 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -36,6 +36,13 @@
 #include <maildispatcher.hxx>
 #include <imaildsplistener.hxx>

+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#include <time.h>
+#endif
+
 using namespace ::com::sun::star;

SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pParent)
@@ -313,6 +320,8 @@ void SwSendMailDialog::dispose()
     {
         try
         {
+        sleep(1);
+
             if(m_pImpl->xMailDispatcher->isStarted())
                 m_pImpl->xMailDispatcher->stop();
if(m_pImpl->xConnectedMailService.is() && m_pImpl->xConnectedMailService->isConnected())
@@ -482,6 +491,7 @@ void  SwSendMailDialog::IterateMails()
         if(m_pConfigItem->IsMailReplyTo())
pMessage->setReplyToAddress(m_pConfigItem->GetMailReplyTo());
         pMessage->addRecipient( pCurrentMailDescriptor->sEMail );
+    sleep(1);
         pMessage->SetSenderName( m_pConfigItem->GetMailDisplayName() );
         pMessage->SetSenderAddress( m_pConfigItem->GetMailAddress() );
if(!pCurrentMailDescriptor->sAttachmentURL.isEmpty())





Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.