Bug 254395 - pop3 resources switches itself from offline to online if "interval mail checking" is enabled
Summary: pop3 resources switches itself from offline to online if "interval mail check...
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: POP3 Resource (show other bugs)
Version: 1.4.50
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas McGuire
URL:
Keywords:
: 250208 261572 262372 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-16 19:29 UTC by Raymond Wooninck
Modified: 2011-01-07 11:33 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Wooninck 2010-10-16 19:29:00 UTC
Version:           1.4.50 (using Devel) 
OS:                Linux

The pop3 resource is created through kmail2 and in the retrieval options it is indicated that the resource should be switched offline on kmail shutdown. When the system is booted up, then the pop3 resource is indeed offline. However after the indicated timing for the Interval Mail Checking, the resource switches to online and tries to check for email. If the system at that moment does not have a network connection, then a dialog is presented to adjust the password settings as that the mailbox couldn't be checked. 

Especially on a laptop this is not wanted as that it could happen quite often that there is no network connection available. If it was just a silent check without the dialog, then it would be a little bit better. But the best thing would be that the resource obeys it's settings and that if the resource is offline, the interval mail checking should not switch it online

Reproducible: Always

Steps to Reproduce:
1. Define a pop3 resource in kmail2
2. Enable interval mail checking. 
3. Select switch offline when kmail shutdown in the retrieval options
4. Shutdown kmail
5. Validate that the pop3 resource is indeed offline (akonadiconsole)
6. Disconnect the network

Actual Results:  
After a number of minutes (based on the defined interval for the automatic mail checking), a dialog is shown which indicates that the pop3 account could not be reached and if you want to change the authentication settings for this account. Checking with akonadiconsole, it appears that the pop3 resource has been switched to online

Expected Results:  
The pop3 resource should remain offline until kmail2 is started.
Comment 1 Thomas McGuire 2010-12-24 19:09:08 UTC
commit df948b1d213afe403cda62686aa1e2d285b233d9
branch master
Author: Thomas McGuire <mcguire@kde.org>
Date:   Fri Dec 24 19:06:21 2010 +0100

    Don't check mail automatically when the resource is offline.
    
    BUG: 254395

diff --git a/resources/pop3/pop3resource.cpp b/resources/pop3/pop3resource.cpp
index a285c98..42f3c25 100644
--- a/resources/pop3/pop3resource.cpp
+++ b/resources/pop3/pop3resource.cpp
@@ -83,10 +83,14 @@ void POP3Resource::updateIntervalTimer()
 
 void POP3Resource::intervalCheckTriggered()
 {
-  kDebug() << "Starting interval mail check.";
   Q_ASSERT( mState == Idle );
-  startMailCheck();
-  mIntervalCheckInProgress = true;
+  if (isOnline()) {
+    kDebug() << "Starting interval mail check.";
+    startMailCheck();
+    mIntervalCheckInProgress = true;
+  } else {
+    mIntervalTimer->start();
+  }
 }
 
 void POP3Resource::aboutToQuit()
Comment 2 Thomas McGuire 2010-12-29 22:16:32 UTC
*** Bug 261572 has been marked as a duplicate of this bug. ***
Comment 3 Thomas McGuire 2011-01-07 11:31:40 UTC
*** Bug 262372 has been marked as a duplicate of this bug. ***
Comment 4 Thomas McGuire 2011-01-07 11:33:05 UTC
*** Bug 250208 has been marked as a duplicate of this bug. ***