Commit Graph

90 Commits

Author SHA1 Message Date
Timo Kankare
74e987c94d Changed MailCollector._get_id() not to use server and user attributes of Account class, because not every account has those defined. Instead Account.get_id() is used. 2018-05-05 17:07:06 +03:00
Patrick Ulbrich
36bbff2079 Properly close connection if it has been reset by remote peer 2016-09-17 12:54:47 +02:00
Patrick Ulbrich
43cac375f3 Don't allow to re-open accounts (hack, not needed anymore) 2016-09-17 12:23:45 +02:00
Patrick Ulbrich
92b54e191b Remove obsolete code 2016-09-16 22:01:16 +02:00
Patrick Ulbrich
67e9aa7790 Comment fixes 2016-09-16 21:51:49 +02:00
Timo Kankare
0f058a83c7 Updated authors in modified files. 2016-09-16 17:52:40 +03:00
Timo Kankare
279cbd5efa Some cleanup. Renaming. Docstrings. Unused code removed. 2016-09-08 23:06:23 +03:00
Timo Kankare
3bdb85952d IMAP code moved from idlers.py to backends/imap.py.
Folder is always selected when new connection is opened, not only for idle accounts.
Callback is set using Account.notify_next_change method.
Connection abort checking in callback is moved to IMAP backend.
2016-09-07 22:46:50 +03:00
Timo Kankare
45677d081d Replaced protocol specific close with Account.close(). 2016-09-06 22:37:19 +03:00
Timo Kankare
1a0b2c9371 Removed duplicate code from mails.py. 2016-09-06 17:39:30 +03:00
Timo Kankare
f9dde27aff Extracted list_message code to account and backends. 2016-09-05 22:35:34 +03:00
Timo Kankare
c96d8fc8b7 Extracted close to account and backends. 2016-09-05 22:10:44 +03:00
Patrick Ulbrich
7321c117db Change PING_TEST_HOST to www.google.com 2016-07-18 17:59:06 +02:00
Patrick Ulbrich
f7ec6bacd3 Fix typo in idlers.py. Fixes #118 2016-03-31 12:50:58 +02:00
Patrick Ulbrich
337176fa19 Fix recurrent mails-removed signal 2016-02-24 18:49:51 +01:00
Patrick Ulbrich
546f1f7078 Add accountname to the Mail class and expose it via dbus
As requested in #84 and #96
2016-01-02 19:49:15 +01:00
Patrick Ulbrich
d7ee148912 Don't suppress exceptions occuring in Account.get_connection() 2015-04-18 16:44:23 +02:00
Patrick Ulbrich
a0371a0ee2 Remove accidently commited test output 2015-04-18 16:37:43 +02:00
Patrick Ulbrich
1288e531fa Rename srv into conn for the sake of consistancy 2015-04-18 14:09:52 +02:00
Patrick Ulbrich
ab71cf6304 Fix unitilized conn bug 2015-04-18 13:55:06 +02:00
Patrick Ulbrich
67fbc8fcdb Rename account.folder into account.folders and make it a list 2015-04-03 18:53:04 +02:00
Patrick Ulbrich
52b0a03c03 Move imaplib2 to common 2015-04-03 14:55:56 +02:00
Patrick Ulbrich
f01879c9c7 Add CredentialStore abstraction layer
* Add CredentialStore API
* Add CredentialStore implementation for GNOME keyring (makes GNOME keyring dependency optional)
* Further CredentialStore implementations (e.g. KDE) may be added to CredentialStore.py
* Mailnag tries to detect the supported CredentialStore backend automatically
* If no CredentialStore backend is supported on the system, Mailnag stores passwords in the config file (plaintext)
* A specific CredentialStore backend can be forced in the config file (currently one of 'auto', 'gnome', 'none')
* Closes issue #82
2015-01-27 17:07:28 +01:00
Patrick Ulbrich
dc8f1480f1 Misc improvements
* Remove bash scripts and start mailnag python scripts directly
  - Prevents duplicate process names
  - Fixes missing app icon in taskmanager
* Remove background startup functionality
  - Should be handled by modern init systems like systemd
    (see new-style-daemon: http://www.freedesktop.org/software/systemd/man/daemon.html)
  - Enables program termination via CTRL+C when running mailnag in a terminal
  - Doesn't hide the commandline prompt when running with options like --help (reported in issue #87)
  - Fixes wrapping issues in the log output
* Rename mailnagd into mailnag again
* Remove --backround option
* Fix and reorder module imports
* setup.py: patch BIN_DIR in dist_cfg
2014-12-19 21:22:45 +01:00
Patrick Ulbrich
cc164571b1 Add file missing in last commit 2014-12-13 17:04:05 +01:00
Patrick Ulbrich
7408cafe8c Improved connectivity tests, other fixes. Closes #86, #87
* Replace unreliable connectivity test by configurable ConnectivityTest
class
* Move connectivity check from main into MailnagDaemon
  (does no longer block if another instance tries to shutdown Mailnag)
* Fix crash occuring on failing Idler reconnect
* Log warning instead of error if no internet connection is available
2014-12-13 17:02:54 +01:00
Patrick Ulbrich
7a3843d932 Allow plugins to remove accounts 2014-12-07 21:01:50 +01:00
Patrick Ulbrich
d9a5291817 Don't pass the original AccountsList object to the ACCOUNTS_LOADED plugin hook
Prevents plugins from
* loading and saving accounts
* storing an internal reference to the original accounts list
* accessing the original accounts list after MailnagDaemon.dispose() has been called
2014-12-06 16:51:49 +01:00
Patrick Ulbrich
dece0102a8 Add ACCOUNTS_LOADED plugin hook, support OAuth2 authentication
* In preparation for GNOME Online Accounts Plugin
* Partially fixes #46
2014-12-06 16:40:16 +01:00
Patrick Ulbrich
5cf0ce63aa fixed MAILS_REMOVED hook logic 2014-05-29 21:07:12 +02:00
Patrick Ulbrich
72425ef05e renamed Reminder into Memorizer 2014-05-29 19:54:51 +02:00
Patrick Ulbrich
692649db16 only allow manual mail checks for non-idle accounts
(manually checking an idling account does abort the current idle state and results in two checks)
2014-03-23 17:02:59 +01:00
Patrick Ulbrich
9690234084 implemented mark-as-read feature, other fixes
implemented mark-as-read feature
refactored reminder class
don't write mailnag.dat on every mail check (only if its contend has changed)
minor other fixes
2014-02-23 19:13:54 +01:00
Patrick Ulbrich
113b3a1506 massive refactoring
* primary goal: reduce global vars, slim down main file
  (only do initialization of global stuff here, move everything else to a daemon class)
* properly close all open pop3/imap connections on shutdown
* throw/catch meaningful exceptions
* renamed IdleRunner/Idler run() methods to start() since 'run' suggests a blocking call (as in dialog.run())
2014-02-01 21:44:07 +01:00
Patrick Ulbrich
a71c7bce30 read imap idle timeout from the config file, just like the pop3 poll interval (fixes issue #60) 2014-01-07 20:31:06 +01:00
Patrick Ulbrich
5578c98e7b identtify mails by message-id again
set date of mails without date to zero (instead of current date)
refactoring
added comments
2013-12-20 21:46:01 +01:00
Patrick Ulbrich
41d90f8a76 discard mails with identical ids (both, imap and pop3)
added comments
2013-12-18 13:53:02 +01:00
Patrick Ulbrich
eca1269219 use a dict instead of a list for faster id lookup 2013-12-18 13:23:17 +01:00
Patrick Ulbrich
8eeba44f7a has_key() is deprecated 2013-12-18 13:16:24 +01:00
Patrick Ulbrich
3d52b106cf imap msg dict doesn't seem to throw a keyerror, so throw it explicitely 2013-12-17 17:59:17 +01:00
Patrick Ulbrich
524e6d5654 refactored mails class 2013-12-17 16:51:18 +01:00
Patrick Ulbrich
80cf60e4a3 identify mails (both, imap and pop3) via MD5 hash.
(IMAP Message-Id doesn't seem to reliable. Fixes #57.
2013-12-01 20:11:31 +01:00
Patrick Ulbrich
ad63208c15 don't select INBOX folder if another folder does not exist 2013-10-24 19:16:02 +02:00
Patrick Ulbrich
e8d5125d97 added some whitespace to MailSyncer class 2013-10-24 19:02:50 +02:00
Patrick Ulbrich
11df47e6b1 fixed logging message 2013-09-08 18:25:23 +02:00
Patrick Ulbrich
ce73ef32de added datetime to log 2013-08-10 15:28:31 +02:00
Patrick Ulbrich
0beba139ed logging and config dir related fixes
replaced stdout redirection by propper logging
only create the config dir when it is actually needed
2013-08-10 14:39:29 +02:00
Patrick Ulbrich
81f3771e40 use identical types in extracted and fallback mail times (int) 2013-08-05 19:43:54 +02:00
Patrick Ulbrich
a89d3365ef include datetime when generating a hashed fallback id 2013-08-05 19:40:35 +02:00
Patrick Ulbrich
214adfb9ba mail sender related changes
removed sender_format from config
store both, sender name and address in mail objects
mailcollector: removed error messages from subject and sender strings
user script plugin: fixed script arg
2013-08-05 19:28:32 +02:00