Commit graph

4012 commits

Author SHA1 Message Date
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
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
Alex Henrie
a9efe8fd3a Add plaintext quote marker to blockquote lines in one pass 2019-01-01 17:55:28 -07:00
Michael Gratton
03a18fbef0 Merge branch 'improve-plaintext-conversion' into 'master'
Delineate tags a, b, i, and u in plaintext conversion

See merge request GNOME/geary!69
2019-01-01 23:43:20 +00:00
Emin Tufan Çetin
65116e0ebf Update Turkish translation 2019-01-01 16:06:15 +00:00
Michael Gratton
3b3528f6a7 Refine handling of errors when opening account
Instead of opening a dialog and quitting when an account throws an error
on being opened (except when we have the option to rebuild it for now),
use infobars and and just disable an account.
2019-01-02 00:28:48 +11:00
Michael Gratton
961d8b4f10 Tidy up client controller a bit
Remove now-unsed sending mail error handling, move new handler methods
the bottom of the class.
2019-01-01 23:22:54 +11:00
Michael Gratton
2da01b29e4 Implement client-based password and auth failure status prompting
This re-ads support for prompting for service passwords in the client,
and also gracefully handles showing auth failure infobar and getting
multple failures at once.
2019-01-01 22:29:07 +11:00
Michael Gratton
b74d600e07 Tidy up Imap.Command API a bit
Low-level uses of Command (e.g. by ClientConnection) are now internal,
while high level call uses (e.g. by Imap.ClientSession, etc) remain
public.
2019-01-01 22:29:07 +11:00
Michael Gratton
34ce1dc1aa Fix failed IMAP commands being treated as an invalid server response
By checking for a NO/BAD status reponse and throwing an error if found
when parsing the server's response, the responses were treated as
invalid rather than being simply rejected by the server.

This updates Imap.Command so that when chcking its status response,
it only throws an error on NO/BAD from the high-level API used by
ClientSession, not ClientConnection, and fixes a minor cleanup issue.
2019-01-01 22:29:07 +11:00
Michael Gratton
20a53f2d51 Rework how auth failures are propagated by the IMAP stack
Rather than using cascading signals to indicate an auth error, have
ImapClientSession throw an appropriate exception, and catch that as
needed in ImapClientService and the Engine's validation code.
2019-01-01 22:29:07 +11:00
Michael Gratton
0e9f18c45b Don't consider service state unknown to be offline
This prevents the offline info bar showing up on first start or when
restarting services.
2019-01-01 22:29:07 +11:00
Michael Gratton
f80d0416a9 Add and hook up Retry buttons to service status inforbars as apropriate 2019-01-01 22:29:07 +11:00
Michael Gratton
5293960282 Rename ClientService.Status.OFFLINE to UNREACHABLE
Better describes what it means, improve doc comment.
2019-01-01 22:29:07 +11:00
Michael Gratton
e7c6da9496 Add initial support for showing/hiding account status as it changes
Add infobars for offline, service problems, auth & cert problems. Show
offline and service problem infobars as needed.
2019-01-01 22:29:07 +11:00
Michael Gratton
62665bf782 Set default account and client service status to something useful
Set account default to ONLINE, so we don't initially show up as being
offline before even having checked connectivity. Add an UNKNOWN to
client service status so that when the initial connectivity check comes
up offine, the account actually gets notified and hence also the client.
2019-01-01 22:29:07 +11:00
Michael Gratton
20447c814f Provide common account and service status tracking via Account
Similarly to ClientService, add a `current_status` property that denotes
the account's operational state, so that clients can just set a notify
on that to be informed of all account status changes. Keep the property
updated by watching for changes to the client service's status property.
2019-01-01 22:29:07 +11:00
Michael Gratton
a637a6b63a Remove auth failure prompting from the engine
Add a signal to AccountInformation for notifying the client that an
auth failure has occurred, and remove code for prompting the user from
both IMAP and SMTP services. This means the same mechanism is used for
both for handling this and untrusted hosts, and allows the client to
implement desired policy, e.g. saving passwords and number of prompts to
retry.
2019-01-01 22:29:07 +11:00
Michael Gratton
827db39fe2 Provide common service status tracking via ClientService
This adds a `current_status` property to ClientService to track the
service's operational state, wich can be monitored by both the engine
and clients for changes. Hook up subclasses to keep that update, and
move connectivity management in to ClientService to provide a common
implementation.
2019-01-01 22:29:07 +11:00
Alex Henrie
00da60debe Delineate tags a, b, i, and u in plaintext conversion 2018-12-31 11:36:41 -07:00