These occur if checking reachability when the required host's network is
unavaialble, i.e. when checking while being offline, hence there's not
much point warning about it.
* src/engine/util/util-connectivity-manager.vala (ConnectivityManager):
Treat IOError.HOST_UNREACHABLE errors as simply being unreachable,
not an error state.
This fixes annoying, albeit legit addresses like "mike@vee.net
<mike@vee.net>" from being flagged.
Followup to commit b7eea857.
* src/engine/rfc822/rfc822-mailbox-address.vala (MailboxAddress): Don't
test name for spoofyness if it's not distinct. Add unit test.
Turns out the client was in inexplicably using
MailboxAddresses.to_rfc822_string() in a bunch of places to display
emails to users, mostly in the composer. This fixes that.
Followup to b7eea857.
* src/engine/rfc822/rfc822-mailbox-addresses.vala (MailboxAddresses):
Make list param for default ctor nullable for your testing convenience,
add a test. Add to_full_display() method that the client should nearly
always be using to display a list to users, use that in all the places.
Remove empty param for list_to_string since all but one callers just
pass in the empty string, which also fixes some stupid regressions
introduced in commit 178ce351 that causes it actually break
to_rfc822_string, rather than fix it as claimed, update call sites.
Followup to commit 9727d41 for Bug 713227.
* src/client/application/geary-controller.vala (Controller): Break out
the check to determine if a folder is a child of the inbox, simplify
and make more robust. Use that to check both available folders and
folders whose special type has changed.
* src/engine/api/geary-folder-path.vala (FolderPath): Add new
is_descendent method.
Since the Serializer is passed a buffered GLib stream that uses a
background thread to manage async IO, it's better to explicitly close the
stream so we know the thread will be shut down at that point, rather than
at some random point in the future.
This will hopefully fix Bug 792219, but it's hard to know since it is a
rarely seen race.
* src/engine/imap/transport/imap-client-connection.vala (Connection):
Keep a reference to the BufferedOutputStream we pass the serialiser,
and explicitly close and dispose after disposing of the serialiser
instance.
Part 3 of Mailsploit mitigation.
* src/client/conversation-list/formatted-conversation-data.vala
(ParticipantDisplay): Rule a line through spoofed emails.
* src/client/conversation-viewer/conversation-message.vala
(AddressFlowBoxChild): Display a warning icon and tooltip for spoofed
addresses.
Both RFC mailbox address names and mailboxes/local-names may by RFC 2047
be Quoted-Printable or Base64 encoded. This patch ensures these parts are
correctly decoded when parsing a RFC 822 message, so that they are
displayed to the user in human-readable form.
Part 2 of Mailsploit mitigation.
* src/engine/rfc822/rfc822-message.vala (Message): Since GMime.Message's
convenience properties for accessing header values such as senders,
recipients, etc. in string form are presented as human-readable, not
RFC822 compliant strings, we can't re-parse them for use by this class
when it is being constructed from a GMime-based source. Instead,
iterate over all headers to get the raw values and parse those we are
interested in instead. Add unit tests.
* src/engine/rfc822/rfc822-mailbox-address.vala (BaseObject): Add gmime
constructor so we can handle construction and decoding from a GMime
InternetAddressMailbox object in a consistent way. Ensure both names
are decoded correctly, and mailboxes are decoded at all, from both
GMime and IMAP sources. If a GMime source's address has no @-symbol,
try to decode the whole thing first it in case the whole address is
encoded. Add unit tests.
* src/engine/rfc822/rfc822-mailbox-addresses.vala (MailboxAddresses):
Add append method and handle group addresses here instead of in Message
to simplify updated Message implementation.
* src/engine/rfc822/rfc822-message-data.vala (MessageData): Add append
method to simplify updated Message implementation.
* src/engine/rfc822/rfc822-mailbox-address.vala (MailboxAddress): Escape
and encode name and mailbox (local-part) when serialising as a RFC 822
string. Provide a means to get a RFC 822 version of the address only
for SMTP. Add unit tests.
* src/engine/smtp/smtp-request.vala (MailRequest): Use proper RFC 822
formatted version of mailbox addresses.
This adds a check for malware spoofing of RFC 822 mailbox addresses such
as those found in Mailsploit, and if found only displays the email
address part and not the mailbox name part.
Part 1 of Mailsploit mitigation.
* src/engine/rfc822/rfc822-mailbox-address.vala (MailboxAddress): Add new
is_spoofed method to check if the mailbox address looks like it has
been spoofed. Add is_distinct method to determine if the name and the
label is the same. Do whitespace and non-printing character stripping
when generating display versions of the mailbox address, rename methods
to make it more obvious what they do and update call sites. Add unit
tests to cover all this.
* src/client/conversation-viewer/conversation-message.vala
(ConversationMessage): Check name is distinct and is not valid before
displaying it. Use new MailboxAddress methods for getting display
versions of the address, to ensure we get the stripped versions of the
addresses.
* src/client/conversation-list/formatted-conversation-data.vala
(ParticipantDisplay): Ensure full addresses are always HTML-markup
escaped before displaying them as markup, to avoid dropping "<address>"
values as invalid HTML. Always show the full address if an address is
invalid.
* src/engine/util/util-string.vala (reduce_whitespace): Strip not only
whitespace but also non-printing characters. Add unit tests.
Followup to commit 9727d41 for Bug 713227.
* src/client/application/geary-controller.vala (Controller): Break out
the check to determine if a folder is a child of the inbox, simplify
and make more robust. Use that to check both available folders and
folders whose special type has changed.
* src/engine/api/geary-folder-path.vala (FolderPath): Add new
is_descendent method.
Since the Serializer is passed a buffered GLib stream that uses a
background thread to manage async IO, it's better to explicitly close the
stream so we know the thread will be shut down at that point, rather than
at some random point in the future.
This will hopefully fix Bug 792219, but it's hard to know since it is a
rarely seen race.
* src/engine/imap/transport/imap-client-connection.vala (Connection):
Keep a reference to the BufferedOutputStream we pass the serialiser,
and explicitly close and dispose after disposing of the serialiser
instance.
* src/engine/api/geary-folder.vala (OpenFlags): Remove FAST_OPEN, since
it is unimplemented and redundant with NO_DELAY. Update uses to simply
use its equivalent, NONE.
* src/client/application/geary-controller.vala (do_empty_folder_async),
src/engine/imap-db/outbox/smtp-outbox-folder.vala (save_sent_mail_async),
src/engine/imap-db/search/imap-db-search-folder.vala
(remove_email_async): Ensure folders opened are always correctly closed
after being opened.
If the current account has multiple emails, we must never enter inline
compact mode, otherwise the user has no chance to pick the right email.
Geary currently tries to guess which email to send the mail from, but
it can't always be right.
https://bugzilla.gnome.org/show_bug.cgi?id=791230
* src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Use a non-blocking queue for free sessions
rather than a set of reserved sessions, so we can instantly pick a free
one when needed and available. Manage establishing new connections from
one place in check_pool (was adjust_session_pool) rather than in a few
different places in the class. Greatly simply lock management and
connection establishment code. Add some doc comments, clean up code
organisation.
* src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Rework close_async() and force_disconnect_all()
to use the same code for closing all sessions. When a session is closed
by some other means then simply remove it, rather than going through
force_disconnect() again. Remove force_disconnect()'s do_disconnect
param, since all call sites now set it to true, and just always attempt
to disconnect the session, without waiting for it.
This updates the client session manager to close IMAP connections without
waiting when they are released and the account is closing, rather than
adding them back to the pool again. Sessions that are in the Selected
state due to being used by a folder are also simply closed, rather than
attempting to return them to Authenticated (i.e. not selected) state
first.
This means when a folder is closed and releases its session that it does
not block if its session has hung, making application shutdown less
likely to hang as well, helping Bug 745561 along a bit further.
* src/engine/nonblocking/nonblocking-abstract-semaphore.vala: Renamed to
nonblocking-lock.vala, rename class from AbstractSemaphore to Lock and
update subclasses, since it is used as a basis for a number of
different lock implementations. Make two getter methods into read-only
properties. Fill out doc comments to be much more comprehensive.
* src/engine/nonblocking/nonblocking-mutex.vala (Mutex): Provide a
high-level API and update documentation comments.
* src/engine/nonblocking/nonblocking-queue.vala (Queue): Add to doc
comments.
* src/engine/nonblocking/nonblocking-variants.vala: Actually document
how each of the variants behave.
* src/client/application/geary-application.vala (Application): Use "help"
and yelp for showing help, rather than old "ghelp" URI and gnome-help.
* help/CMakeLists.txt: Update CMake build to match Meson
* meson.build: Use libunwind and libunwind-generic to avoid having to
search for the platform-specific lib.
* src/meson.build: Set UNW_LOCAL_ONLY define to get the most optimal
unwind impl.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
(MinimalFolder.start_open_remote): Don't check to see if the timer is
running before opening the remote, just do it since this method is only
called when the remote should be opened.
(MinimalFolder.on_remote_ready): Only start opening the remote if
actually needed.