Bug 153904 - [PATCH] MDN not asked on deleting mail
Summary: [PATCH] MDN not asked on deleting mail
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: MDN (show other bugs)
Version: 1.9.7
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Marc Mutz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-12 12:36 UTC by Frank Niethardt
Modified: 2008-02-21 16:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
diff to solve the problem as I understand it (1.40 KB, patch)
2008-02-08 23:34 UTC, Frank Niethardt
Details
Proposed, more general fix (888 bytes, patch)
2008-02-18 10:14 UTC, Marc Mutz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Niethardt 2007-12-12 12:36:28 UTC
Version:           1.9.7 (using KDE KDE 3.5.8)
Installed from:    Debian testing/unstable Packages

I have setting for MDN to be asked wether I wanna send or not. This works, when I read email. But when I delete, without reading it, kmail don't askes, but send MDN.

This is espacially unhelpful when deleting spam eMail with MDN.
Comment 1 Frank Niethardt 2008-01-27 15:15:29 UTC
I just looked through the source. I think the problem is, that KMFilterAction::SendMDN calls msg->createMDN with  KMime::MDN::AutomaticAction. Thats ok, but if this is called every user interaction is skipped.

I think in that case kmail should either ask, or just don't send any MDN, as the user discarded (filtered) the message anyway.
Comment 2 Frank Niethardt 2008-01-27 15:21:04 UTC
As I understand KMMessage::createMDN right, it's even worse: if it is said to ignore (what should be mode = 0?) and it is AutomaticAction, it is send too, instead of ignored....
Comment 3 Frank Niethardt 2008-02-08 23:34:15 UTC
Created attachment 23482 [details]
diff to solve the problem as I understand it

This should do it. Don't have the resources to try it out at the moment.
Comment 4 Till Adam 2008-02-17 17:27:47 UTC
Frank, thanks for the patch, I'll ask the author of the MDN code to review it.
Comment 5 Marc Mutz 2008-02-18 10:14:02 UTC
Created attachment 23610 [details]
Proposed, more general fix
Comment 6 Marc Mutz 2008-02-18 10:14:59 UTC
> As I understand KMMessage::createMDN right, it's even worse: if it is said to
> ignore (what should be mode = 0?) and it is AutomaticAction, it is send too,
> instead of ignored.... 

That is not correct. 'Ignored' is handled near the beginning, of course:
>  // default:
>  int mode = mdnConfig.readEntry( "default-policy", 0 );
>  if ( !mode || mode < 0 || mode > 3 ) {
>    // early out for ignore:
>    setMDNSentState( KMMsgMDNIgnore );
>    return 0;
>  }

As for your patch, please send minimal patches. Use the -bB options to diff, e.g. That said, I see no reason, indeed, to not ask the user on automatic actions if he indicated he wants to be asked. Your solution to never send an MDN for mode == Ask && automatic action is wrong, though. It might very well be that no-one calls createMDN() with a == AutomaticAction and allowGUI == true. But this case nevertheless needs to be handled.

I've attached a new patch. Please check whether it fixes your problem.
Comment 7 Frank Niethardt 2008-02-18 10:48:34 UTC
As I said, I don't have the resources to compile a kmail right now, but the diff itself looks good.
Comment 8 Marc Mutz 2008-02-21 16:37:37 UTC
SVN commit 777776 by mutz:

Fix MDNs begin sent for automatic actions, when when the user wanted to be asked.
BUG: 153904

 M  +4 -3      kmmessage.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=777776