1. 31 Jan, 2018 2 commits
    • Michael Gratton's avatar
      Ensure mailbox addresses escaped correctly when formatted as RFC 822. · 8810e957
      Michael Gratton authored
      * 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.
      8810e957
    • Michael Gratton's avatar
      Check for spoofed sender addresses, only display the address if so. · 71e0e683
      Michael Gratton authored
      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.
      71e0e683
  2. 27 Jan, 2018 1 commit
    • Michael Gratton's avatar
      Update monitoring for new mail when folder special type changes. · f6b4b5c9
      Michael Gratton authored
      Followup to commit 9727d41b 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.
      f6b4b5c9
  3. 26 Jan, 2018 6 commits
  4. 25 Jan, 2018 5 commits
    • Michael Gratton's avatar
    • Michael Gratton's avatar
      Rework how the client session manager manages the IMAP session pool. · 938033f3
      Michael Gratton authored
      * 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.
      938033f3
    • Michael Gratton's avatar
      Tidy up how IMAP client sessions are closed by the manager. · 8536ad27
      Michael Gratton authored
      * 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.
      8536ad27
    • Michael Gratton's avatar
      Don't add IMAP connections back to the pool when the account is closing. · 07bc4410
      Michael Gratton authored
      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.
      07bc4410
    • Michael Gratton's avatar
      Tidy up and document lock classes in Geary.Nonblocking. · c0501bda
      Michael Gratton authored
      * 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.
      c0501bda
  5. 20 Jan, 2018 1 commit
  6. 15 Jan, 2018 7 commits
  7. 14 Jan, 2018 1 commit
  8. 13 Jan, 2018 3 commits
  9. 12 Jan, 2018 8 commits
  10. 11 Jan, 2018 2 commits
    • Michael Gratton's avatar
      Fix some issues opening mailboxes from Bug 789924 / commit fddf609a. · 7d1de0d9
      Michael Gratton authored
      * 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.
      7d1de0d9
    • Michael Gratton's avatar
      Fix some issues opening mailboxes from Bug 789924 / commit fddf609a. · f913d183
      Michael Gratton authored
      * 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.
      f913d183
  11. 10 Jan, 2018 4 commits