Commit graph

4030 commits

Author SHA1 Message Date
Michael Gratton
1ed0f5acbf Fix ambiguous test in AccountInformation.set_special_folder 2019-01-15 00:20:37 +11:00
Michael Gratton
e1fd9daa83 Fix pathological FolderPath.is_equal() case, add unit test 2019-01-15 00:20:37 +11:00
Michael Gratton
ddbe6e0b09 Revamp Geary.FolderPath implementation
Convert getters that look like properties into actual properties,
remove unused and redundant public and internal API, convert
implementation to use a tree that aucyally maintains references between
steps, rather than each creating a new list of path steps and
manipulating that.
2019-01-15 00:20:37 +11:00
Michael Gratton
423a1dcbf0 Add additional FolderPath unit tests 2019-01-15 00:19:46 +11:00
Michael Gratton
5a22e8e4a2 Convert Geary.FolderRoot to be an actual root, not just a top-level
Instead of each top-level IMAP folder being a FolderRoot object, then
children of that being FolderPath objects, this makes FolderRoot an
"empty" FolderPath, so that both top-level and descendant folders are
plain FolderPath objects. Aside from being more technically correct,
this means that empty namespace roots can now be used interchangably
with non-empty namespace roots (addressing issue #181), and custom
folder implementations no longer need to provide their own trivial,
custom FolderRoot.

To support this, a notion of an IMAP root and a local root have been
added from which all remote and local folder paths are now derived,
existing places that assume top-level == root have been fixed, and
unit tests have been added.
2019-01-15 00:18:45 +11:00
Michael Gratton
41bb79da94 Stop duplicate inboxes being created, not being listed
Since duplicates are being cleand up on startup, this ensures dups
never exist in the DB.
2019-01-14 12:05:29 +11:00
Michael Gratton
46bb4d1b6c Ensure MinimalFolder remote open forces closed on hard errors
Minimal folder should force a folder closed when an error occurrs that
it isn't going to be able to recover from.
2019-01-14 11:43:01 +11:00
Michael Gratton
b0f85b3af8 Ensure accounts don't accidentially create multiple inbox-type folders 2019-01-14 11:28:13 +11:00
Michael Gratton
4fefda9695 Remove unwanted debuging cruft 2019-01-14 11:05:54 +11:00
Michael Gratton
faf7a2bdfd Add some unit tests for Geary.ImapDb.Account folder management 2019-01-14 11:01:03 +11:00
Michael Gratton
018f700d0d Fix unhandled error warning, tidy up error handling 2019-01-10 23:09:36 +11:00
Michael Gratton
319ea1dada Fix meson config warning 2019-01-10 23:09:12 +11:00
Michael Gratton
9df110bc30 Merge branch 'nullfix' into 'master'
PropertyCommand: check for null before calling printf

See merge request GNOME/geary!79
2019-01-10 07:07:58 +00:00
Michael Gratton
da2d676088 Merge branch 'wip/20-cert-pinning' into 'master'
Support TLS certificate pinning when GCR can't find usable PKCS#11 slots

Closes #20

See merge request GNOME/geary!80
2019-01-10 06:53:24 +00:00
Michael Gratton
6b9ae903fb Re-enable GCR support for cert pinning
This re-adds support for using GCR for pinning certs, but only if GCR
is in a known good state. If so, pinned certs will be stored using GCR,
if not, they will be stored in Geary's XDG data dirs as a fallback.
2019-01-10 17:33:37 +11:00
Michael Gratton
812bce2a2f Fix brown-paper-bag file name typo 2019-01-10 15:10:20 +11:00
Michael Gratton
9ade041f1e Implement loading and saving certs in CertificateManager 2019-01-10 14:44:33 +11:00
Michael Gratton
cda0e7f49e Simplify CertificateManager's db pinned cert management
Rather than store a list of pinned certs each with a set of idenities,
just use a map of idenities to certs. This simplifies both storage,
lookup, retreival, and will allow pins to be persisted on a per-identity
bassis, allowing a cert to be saved for one host but not saved for
another.
2019-01-10 14:44:33 +11:00
Michael Gratton
97971ce38d Don't prompt for untrusted host as validation when account exists 2019-01-10 14:44:33 +11:00
Michael Gratton
1a2bb280ba Handle untrusted certs when adding a editing account server details
Move common code for prompting for cert errors to the account editor,
use that when validating an account from the server pane.
2019-01-10 14:44:10 +11:00
Greg V
0b62f6eefd PropertyCommand: check for null before calling printf
On FreeBSD, this would crash in vasprintf_l, because you're not supposed
to printf(NULL, ...).
2019-01-09 13:08:58 +03:00
Michael Gratton
2e344d7ce1 Handle untrusted certs when adding a new account
Make the cert mamager easily available to acccount editor panes, hook up
to untrusted-host when validating the new account and prompt to pin
certs as needed.
2019-01-09 15:26:50 +11:00
Michael Gratton
c0b5d44575 Don't block handling GTlsConnection::accept-certificate
The docs for accept-certificate require that clients do not block while
handling it, and Geary will typically prompt the user when handling it.

This fix schedules handling the signal to be executed seperately on the
main loop.
2019-01-09 15:22:19 +11:00
Michael Gratton
1fa342ca51 Remove now unsed Endpoint.trust_untrusted_host prop and related code 2019-01-09 15:22:19 +11:00
Michael Gratton
0d93696d6c Don't update status for IMAP connection problems multiple times
This moves connection error notification in ImapClientService to one
place, so status updates and errors are only reported once, and the
correct status changes are made. This fixes TLS cert problems both
being reported as such, and as a service problem.
2019-01-09 15:22:19 +11:00
Michael Gratton
82c972f09c Replace controller's GCR pinning impl with new CertificateManager class
The new class encapsulates cert pinning functionality and provides a
GIO GTlsDatabase implementation for hooking pinned certs directly into
GTlsConnection. Initial impl just stores pinned certs in memory for now.
2019-01-09 15:22:19 +11:00
Michael Gratton
67ec69a931 Modernise cert prompting impl to work with new account status infobars 2019-01-09 15:22:19 +11:00
Michael Gratton
884500a02b Add Geary.ProblemType for TLS cert validation errors, clarify login errs 2019-01-09 15:22:19 +11:00
Michael Gratton
e94e4665c5 Remove now-unsed validation code from Geary.Engine
Also, clean up class doc comment to better reflect reality.
2019-01-09 15:22:19 +11:00
Michael Gratton
3f04e5eb19 Tidy up all of the various untrusted_host signals
Remove it from Geary.Engine, since it just adds complexity without
making API client use any easier. Replace the TLS negotiate method on
the remaining versions of the signal with the Endpoint, since it's handy
to have and the negotiation method can be obtained from that if needed.
2019-01-09 15:22:19 +11:00
Michael Gratton
19d2fdfcbc Update Geary.Endpoint API and source
Use a generic GSocketConnectable to specify the remote endpoint,
simplify TLS cert management callbacks.
2019-01-09 15:22:19 +11:00
Michael Gratton
3c89a2fb23 Update Geary.ConnectivityManager to check a GSocketConnectable
This will enable using other connectable types (e.g. those needed to
connect to SRV records). Rename `address_error_reported` to reflect the
error could be more general.
2019-01-09 15:22:19 +11:00
Michael Gratton
3000334955 Merge branch 'wip/account-editor-refinements-v1' into 'master'
Account editor refinements v1

See merge request GNOME/geary!76
2019-01-09 02:39:32 +00:00
Michael Gratton
33ae35f613 Fix critical when IMAP login command is cancelled
The command's status will be null if the op was cancelled.
2019-01-09 13:30:50 +11:00
Michael Gratton
db85a3449d Don't validate managed accounts when validating account server details
GOA supports generic IMAP accounts, we shouldn't be attempting to
validate the server settings for those.
2019-01-09 13:30:50 +11:00
Michael Gratton
cc07e542ac Allow adding/modifying an account to be cancelled when in progress
This adds a cancellable property to each account pane and uses it for
all I/O operations, and allows it to be cancelled and pane state to be
updated when either Esc is pressed, or Cancel is clicked on the servers
pane.
2019-01-09 13:30:50 +11:00
Michael Gratton
aa27c964de Improve account editor's doc comments 2019-01-09 13:30:50 +11:00
Michael Gratton
fdb9243ae5 Move common account editor pane in-app notification impl to the editor
This moves the individual in-app notification implementation on each of
the editor panes to the editor itself, reducing redundancy and allowing
the editor to issue notifications if needed (spoiler: it will).
2019-01-09 13:30:50 +11:00
Michael Gratton
7ed289899a Tidy up account editor's undo/redo action state management
Move update_command_actions() from CommandPane to Editor, call that when
updating state internally and make the implementation details of it
private. Make more use of the generic command management code in the
list pane.
2019-01-09 13:18:19 +11:00
Michael Gratton
c9bfab4b05 Typo fix 2019-01-09 13:17:37 +11:00
Michael Gratton
18d847826a Merge branch 'improve-plaintext-conversion' into 'master'
Add plaintext quote marker to blockquote lines in one pass

See merge request GNOME/geary!73
2019-01-09 00:50:01 +00:00
Michael Gratton
6ce84ae8d9 Merge branch 'wip/182-goa-smtp-auth-method-b0rked' into 'master'
Consult correct GOA settings when configuring SMTP TLS method

Closes #182

See merge request GNOME/geary!75
2019-01-08 22:02:21 +00:00
Michael Gratton
6cd7f066f5 Consult correct GOA settings when configuring SMTP TLS method
Fixes #182
2019-01-09 08:52:36 +11:00
Piotr Drąg
6db6e7ab5f Update POTFILES.in 2019-01-08 20:01:50 +01:00
Michael Gratton
fcc658af97 Merge branch 'wip/17-noisy-problem-reports' into 'master'
Problem reports are too noisy

Closes #17

See merge request GNOME/geary!74
2019-01-07 23:25:47 +00:00
Michael Gratton
84a450bfdc Clear account status UI for an account when it is closed 2019-01-08 10:00:00 +11:00
Yuras Shumovich
ecbc285617 Add Belarusian translation 2019-01-07 13:53:04 +00:00
Michael Gratton
a641ac1e03 Restart all effected services with a generic service status problem
This stops Geary making the user click retry multiple times when they
have multiple accouts.
2019-01-07 23:47:11 +11:00
Michael Gratton
4ef81050f5 Show details for status-based service problems
This breaks out the problem details dialog out into a seperate class so
it can be used for both problem reports and status problems. Pass in any
service errors to the main window when updating account status, show a
Details button on the service status info bar and show the details
dialog when clicked.
2019-01-07 23:47:00 +11:00
Michael Gratton
92353bf0c9 Add Geary.ErrorContext class for passing rich error context info around
Require ClientService implementations and ProblemReport use contexts
rather than bare errors. Move code for generating backtraces and and
formatting errors from ProblemReport to ErrorContext.
2019-01-07 22:10:34 +11:00