Bug 146487 - Export to email fails when email too large
Summary: Export to email fails when email too large
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-SendByMail (show other bugs)
Version: 5.6.0
Platform: unspecified Linux
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-07 13:59 UTC by Geoff King
Modified: 2017-07-09 06:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0


Attachments
patch fixing false positive (940 bytes, patch)
2009-07-09 13:11 UTC, Nicolas L.
Details
this patch add only one warning for each big files (2.14 KB, patch)
2009-07-09 13:46 UTC, Nicolas L.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff King 2007-06-07 13:59:32 UTC
Version:           unknown (using KDE 3.5.6, Kubuntu (feisty) 4:3.5.6-0ubuntu14)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.20-16-generic

I set my maximum email size to 2Meg.  Then when I try to email images that exceed this, the plugin error message says "Starting Mailer Agent".  I suggest that a more useful error message be given like "Cannot Email - The email exceeds the user specified maximum email size - Please reduce email size of number of attachments".  

Thanks for a great program.
Comment 1 caulier.gilles 2008-12-08 09:23:44 UTC
Geoff,

This file still valid using kipi-plugins 0.1.6 and digiKam 0.9.4 ?

And what's about using KDE4 version where SendImages plugins have been re-written ?

Gilles Caulier
Comment 2 Geoff King 2008-12-10 03:42:58 UTC
I am not sure about kipi-plugins 0.1.6 and digiKam 0.9.4, since I'm using the ubuntu supplied packages of 0.1.5 and 0.9.3 - those still have the same behaviour. 

For the KDE4 version the email images tool appears to silently omit images that exceed the limit set under "Maximum e-mail size limit". For example:

Scenario 1: Select 3 images that are each around 2.5MB.  Set the email limit to 2MB.  Nothing happens except for empty dialog box. I would expect some error message saying "The images you trying to email are too large to send due to the Maximum e-mail size limit option.  It is recommended that you select the option to re-size the image and try again."

Scenario 2: Select 3 images (1.7MB, 1.8MB, and 2.5MB).  Set the email limit to 2MB.  Two emails are created one with a 1.7MB and one with a 1.8Mb.  The 2.5MB is silently omited. I would expect some error message similar to Scenario 1. 

Scenario 3:  Select 3 images that are each around 2.5MB. Set the email limit to 2MB. Allow re-sizing of images. All nicely fit into one email and the tool works as expected.
Comment 3 Nicolas L. 2009-07-08 01:22:58 UTC
What do you think about this ?

Index: sendimages/sendimages.cpp
===================================================================
--- sendimages/sendimages.cpp   (révision 992866)
+++ sendimages/sendimages.cpp   (copie de travail)
@@ -333,8 +333,10 @@
         }
         else
         {
-            kDebug(51000) << "File \"" << file.fileName() << "\" is out of attachement limit!";
-            todoAttachement.append(*it);
+           kDebug(51000) << "File \"" << file.fileName() << "\" is out of attachement limit!";
+           QString text = i18n("The file \"%1\" is too big to be sent, please reduce its size or change your settings" , file.fileName());
+           d->progressDlg->addedAction(text, KIPIPlugins::WarningMessage);
+           todoAttachement.append(*it);
         }
     }
Comment 4 caulier.gilles 2009-07-08 08:46:21 UTC
Nicolas,

You patch add a warning to progress dialog. It's ok for me.

But I think this will not solve the problem indeep. To wrap around, I think that plugin must have the capabilty to create a multiple archive with limit size and sent each one in separate e-mail. But this is another problem which is already reported in another bugzilla entry.

Geoff, can you try Nicolas patch against code from svn trunk and tell us if it's enough for you ?

Gilles Caulier
Comment 5 Geoff King 2009-07-08 12:15:25 UTC
I'll give it a try when I'm back in town in a few days.  Geoff
------Original Message------
From: Gilles Caulier
Sender: bugzilla_noreply@kde.org
To: gsking1@gmail.com King
ReplyTo: bug-control@bugs.kde.org
Subject: [Bug 146487] kipi-plugins export to email fails when email too large
Sent: Jul 8, 2009 02:46

https://bugs.kde.org/show_bug.cgi?id=146487





--- Comment #4 from Gilles Caulier <caulier gilles gmail com>  2009-07-08 08:46:21 ---
Nicolas,

You patch add a warning to progress dialog. It's ok for me.

But I think this will not solve the problem indeep. To wrap around, I think
that plugin must have the capabilty to create a multiple archive with limit
size and sent each one in separate e-mail. But this is another problem which is
already reported in another bugzilla entry.

Geoff, can you try Nicolas patch against code from svn trunk and tell us if
it's enough for you ?

Gilles Caulier
Comment 6 Nicolas L. 2009-07-08 12:44:58 UTC
this is already what happen  if the sum of the images are too big, it creates multiple mails
Comment 7 Geoff King 2009-07-09 04:25:13 UTC
I think this does solve the main issue of needing an error message instead of silently failing.  

However, I did notice that sometimes I get the new error message, but it is attached anyway - This happens when the files are put into multiple emails.

For example: Select 3 images (1.7MB, 1.8MB, and 2.5MB).  Set the email limit to 2MB.  Two emails are created one with a 1.7MB and one with a 1.8Mb.  I get a few of the error messages, not just one for the third email that is too large.  

Thanks for your work.  Hope this helps, Geoff
Comment 8 Nicolas L. 2009-07-09 12:43:20 UTC
i will test with the testcase you gave thanks
Comment 9 Nicolas L. 2009-07-09 12:56:57 UTC
ok i found why now i need to fix my patch thanks
Comment 10 Nicolas L. 2009-07-09 13:11:43 UTC
Created attachment 35191 [details]
patch fixing false positive

this patch show the warning only for files with a size bigger  than the limit.

Can you test and tell if for you this fixes the issue ?
Comment 11 Nicolas L. 2009-07-09 13:46:56 UTC
Created attachment 35192 [details]
this patch add only one warning for each big files
Comment 12 Geoff King 2009-07-10 03:03:54 UTC
Looks good and works fine for me. I think this one can be marked as squashed. Thanks
Comment 13 Nicolas L. 2009-07-10 07:52:34 UTC
i have not commited yet :)
i will do it now
Comment 14 Nicolas L. 2009-07-10 07:53:55 UTC
SVN commit 994087 by nlecureuil:

SendImage: Add A warning when a file is too big to be sent
SendImage: Do not encode file name as KUrl already does this
BUG:146487
BUG:189984 


 M  +12 -6     sendimages.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=994087
Comment 15 caulier.gilles 2017-07-09 06:04:28 UTC
Problem is not reproducible with the Send by email tool from digiKam core 5.7.0