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

List:       kde-commits
Subject:    kdepim/kmail
From:       Ingo Klöcker <kloecker () kde ! org>
Date:       2004-05-16 16:37:25
Message-ID: 20040516163725.2BD477AFF () office ! kde ! org
[Download RAW message or body]

CVS commit by kloecker: 

Forward port: Several people reported bugs with sending because they didn't specify \
their email address for the default identity. This patch tells those people about \
their error (yes, it introduces a new string, but IMO an untranslated error message \
is better than no error message especially because this 'bug' is reported repeatedly \
(e.g. 53448, 78895, 80817, 81611 and many more)). Moreover the From header will be \
set to the email address of the message's identity or the default identity. So in \
case the user sets the email address for his identities the messages will get sent.


  M +26 -1     kmsender.cpp   1.206


--- kdepim/kmail/kmsender.cpp  #1.205:1.206
@@ -365,4 +365,29 @@ kdDebug(5006) << "KMSender::doSendMsg() 
   // See if there is another queued message
   mCurrentMsg = kmkernel->outboxFolder()->getMsg(mFailedMessages);
+  if ( mCurrentMsg && !mCurrentMsg->transferInProgress() &&
+       mCurrentMsg->sender().isEmpty() ) {
+    // if we do not have a sender address then use the email address of the
+    // message's identity or of the default identity unless those two are also
+    // empty
+    const KPIM::Identity & id = kmkernel->identityManager()
+      ->identityForUoidOrDefault( mCurrentMsg->headerField( "X-KMail-Identity" \
).stripWhiteSpace().toUInt() ); +    if ( !id.emailAddr().isEmpty() ) {
+      mCurrentMsg->setFrom( id.fullEmailAddr() );
+    }
+    else if ( !kmkernel->identityManager()->defaultIdentity().emailAddr().isEmpty() \
) { +      mCurrentMsg->setFrom( \
kmkernel->identityManager()->defaultIdentity().fullEmailAddr() ); +    }
+    else {
+      KMessageBox::sorry( 0, i18n( "It's not possible to send messages "
+                                   "without specifying a sender address.\n"
+                                   "Please set the email address of "
+                                   "identity '%1' in the Identities "
+                                   "section of the configuration dialog "
+                                   "and then try again." )
+                             .arg( id.identityName() ) );
+      kmkernel->outboxFolder()->unGetMsg( mFailedMessages );
+      mCurrentMsg = 0;
+    }
+  }
   if (!mCurrentMsg || mCurrentMsg->transferInProgress())
   {


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

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