[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] Sending invitations to Outlook users
From:       "Jan-Pascal van Best" <janpascal () vanbest ! org>
Date:       2007-05-04 12:35:07
Message-ID: 54920.XFdGDBRRClA=.1178282107.squirrel () www ! jellep ! net
[Download RAW message or body]

On Fri, May 4, 2007 14:27, Allen Winter wrote:
> On Friday 04 May 2007 4:17:49 am Jan-Pascal van Best wrote:
>> Okay, here's the patch.
>
> Did you forget something? :)
I do that all the time - remind me to go look for my remaining brain cells
someday.

What I forgot to say earlier: the patch in callback.cpp also puts some
braces where I think they should go - the if statement looked broken to
me. Feel free to revert if I'm in error there.

Thorsten, Michael, does this work for you?

Cheers

Jan-Pascal


["exchange-patch-20070504-1010.diff" (text/plain)]

Index: kmail/kmkernel.cpp
===================================================================
--- kmail/kmkernel.cpp	(revision 660685)
+++ kmail/kmkernel.cpp	(working copy)
@@ -523,7 +523,9 @@
       msgPart->setTypeStr( attachType );
       msgPart->setSubtypeStr( attachSubType );
       msgPart->setParameter( attachParamAttr, attachParamValue );
-      msgPart->setContentDisposition( attachContDisp );
+      if( ! GlobalSettings::self()->exchangeCompatibleAttachments() ) {
+        msgPart->setContentDisposition( attachContDisp );
+      }
       if( !attachCharset.isEmpty() ) {
         // kdDebug(5006) << "KMKernel::openComposer set attachCharset to "
         // << attachCharset << endl;
Index: kmail/kmail.kcfg
===================================================================
--- kmail/kmail.kcfg	(revision 660685)
+++ kmail/kmail.kcfg	(working copy)
@@ -163,6 +163,13 @@
         <default>false</default>
       </entry>
 
+     <entry name="ExchangeCompatibleAttachments" type="Bool">
+        <label>Exchange compatible attachment naming</label>
+        <whatsthis>Microsoft Outlook, when used in combination with a Microsoft \
Exchange server, has a problem understanding +standards-compliant groupware e-mail. \
Turn this option on send groupware attachments in a way that Microsoft Exchange \
understands.</whatsthis> +        <default>false</default>
+      </entry>
+
       <entry name="AutomaticSending" type="Bool">
         <label>Automatic invitation sending</label>
         <whatsthis>When this is checked, you will not see the mail composer window. \
Instead, all invitation mails are sent automatically. If you want to see the mail \
before sending it, you can uncheck this option. However, be aware that the text in \
the composer window is in iCalendar syntax, and you should not try modifying it by \
                hand.</whatsthis>
Index: kmail/callback.cpp
===================================================================
--- kmail/callback.cpp	(revision 660685)
+++ kmail/callback.cpp	(working copy)
@@ -33,6 +33,7 @@
 #include "callback.h"
 #include "kmkernel.h"
 #include "kmmessage.h"
+#include "kmmsgpart.h"
 #include <libemailfunctions/email.h>
 #include <libkpimidentities/identity.h>
 #include <libkpimidentities/identitymanager.h>
@@ -62,11 +63,8 @@
 
   KMMessage *msg = new KMMessage;
   msg->initHeader();
-  msg->setHeaderField( "Content-Type",
-                       "text/calendar; method=reply; charset=\"utf-8\"" );
   msg->setSubject( subject );
   msg->setTo( to );
-  msg->setBody( iCal.utf8() );
   msg->setFrom( receiver() );
   /* We want the triggering mail to be moved to the trash once this one
    * has been sent successfully. Set a link header which accomplishes that. */
@@ -79,12 +77,13 @@
     // Try and match the receiver with an identity
     const KPIM::Identity& identity =
       kmkernel->identityManager()->identityForAddress( receiver() );
-    if( identity != KPIM::Identity::null() )
+    if( identity != KPIM::Identity::null() ) {
       // Identity found. Use this
       msg->setFrom( identity.fullEmailAddr() );
       msg->setHeaderField("X-KMail-Identity", QString::number( identity.uoid() ));
       // Remove BCC from identity on ical invitations \
(https://intevation.de/roundup/kolab/issue474)  msg->setBcc( "" );
+    }
   }
 
   KMail::Composer * cWin = KMail::makeComposer();
@@ -93,6 +92,24 @@
   cWin->slotWordWrapToggled( false );
   cWin->setSigningAndEncryptionDisabled( true );
 
+  if( GlobalSettings::self()->exchangeCompatibleAttachments() ) {
+    // For Exchange, send ical as attachment, with proper
+    // parameters
+    msg->setCharset( "utf-8" );
+    KMMessagePart *msgPart = new KMMessagePart;
+    msgPart->setName( "cal.ics" );
+    // msgPart->setCteStr( attachCte ); // "base64" ?
+    msgPart->setBodyEncoded( iCal.utf8() );
+    msgPart->setTypeStr( "text" );
+    msgPart->setSubtypeStr( "calendar" );
+    msgPart->setParameter( "method", "reply" );
+    cWin->addAttach( msgPart );
+  } else {
+    msg->setHeaderField( "Content-Type",
+                         "text/calendar; method=reply; charset=\"utf-8\"" );
+    msg->setBody( iCal.utf8() );
+  }
+
   if ( options.readBoolEntry( "AutomaticSending", true ) ) {
     cWin->setAutoDeleteWindow(  true );
     cWin->slotSendNow();
Index: korganizer/komailclient.cpp
===================================================================
--- korganizer/komailclient.cpp	(revision 660685)
+++ korganizer/komailclient.cpp	(working copy)
@@ -197,7 +197,7 @@
       if (idx>=0) {
         idx = attachment.find(':',idx)+1;
         meth = attachment.mid(idx,attachment.find('\n',idx)-idx);
-        meth = meth.lower();
+        meth = meth.lower().stripWhiteSpace();
       } else {
         meth = "publish";
       }



_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic