summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgusi <gusi@df743ca5-7f9a-e211-a948-0013205c9059>2014-05-05 15:42:42 +0800
committergusi <gusi@df743ca5-7f9a-e211-a948-0013205c9059>2014-05-05 15:42:42 +0800
commite460bbdb9b943c7c9bb8041cb4ca6f22a5682833 (patch)
tree331ba8c3f56e5d61bcc72ce5a3783a75b2076934
parent2ac5303101c99e10b626bebda4fecabd6a35f7ac (diff)
downloadmarcuscom-ports-e460bbdb9b943c7c9bb8041cb4ca6f22a5682833.tar
marcuscom-ports-e460bbdb9b943c7c9bb8041cb4ca6f22a5682833.tar.gz
marcuscom-ports-e460bbdb9b943c7c9bb8041cb4ca6f22a5682833.tar.bz2
marcuscom-ports-e460bbdb9b943c7c9bb8041cb4ca6f22a5682833.tar.lz
marcuscom-ports-e460bbdb9b943c7c9bb8041cb4ca6f22a5682833.tar.xz
marcuscom-ports-e460bbdb9b943c7c9bb8041cb4ca6f22a5682833.tar.zst
marcuscom-ports-e460bbdb9b943c7c9bb8041cb4ca6f22a5682833.zip
Back port commits 201af223, 0c1f6142, 343f3ba0 and 730b33d8. Those fix
bgo#713703, bgo#726943, bgo@726770 and bgo#713983. All of these patches are committed upstream and should be gone when geary gets updated. While here mute a replace command in the port Makefile. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@19607 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r--mail/geary/Makefile3
-rw-r--r--mail/geary/files/patch-src_client_composer_composer-window.vala115
-rw-r--r--mail/geary/files/patch-src_engine_api_geary-aggregated-folder-properties.vala13
-rw-r--r--mail/geary/files/patch-src_engine_api_geary-endpoint.vala53
-rw-r--r--mail/geary/files/patch-src_engine_api_geary-folder-properties.vala30
-rw-r--r--mail/geary/files/patch-src_engine_api_geary-search-folder.vala13
-rw-r--r--mail/geary/files/patch-src_engine_imap-db_outbox_smtp-outbox-folder-properties.vala13
-rw-r--r--mail/geary/files/patch-src_engine_imap-engine_imap-engine-generic-account.vala13
-rw-r--r--mail/geary/files/patch-src_engine_imap-engine_imap-engine-mail-prefetcher.vala46
-rw-r--r--mail/geary/files/patch-src_engine_imap-engine_imap_transport_imap-client-connection.vala15
-rw-r--r--mail/geary/files/patch-src_engine_imap_api_imap-folder-properties.vala32
-rw-r--r--mail/geary/files/patch-src_engine_imap_api_imap-folder.vala13
-rw-r--r--mail/geary/files/patch-src_engine_smtp_stmp-client-connection.vala14
13 files changed, 372 insertions, 1 deletions
diff --git a/mail/geary/Makefile b/mail/geary/Makefile
index 3a8cbbf30..d1bbb1620 100644
--- a/mail/geary/Makefile
+++ b/mail/geary/Makefile
@@ -4,6 +4,7 @@
PORTNAME= geary
PORTVERSION= 0.6.0
+PORTREVISION= 1
CATEGORIES= deskutils gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome3
@@ -33,7 +34,7 @@ LDFLAGS+= -L${LOCALBASE}/lib
GLIB_SCHEMAS= org.yorba.geary.gschema.xml
post-patch:
- ${REINPLACE_CMD} -e 's|abort $$option||g' \
+ @${REINPLACE_CMD} -e 's|abort $$option||g' \
${WRKSRC}/configure
.include <bsd.port.mk>
diff --git a/mail/geary/files/patch-src_client_composer_composer-window.vala b/mail/geary/files/patch-src_client_composer_composer-window.vala
new file mode 100644
index 000000000..ccab604c1
--- /dev/null
+++ b/mail/geary/files/patch-src_client_composer_composer-window.vala
@@ -0,0 +1,115 @@
+From 730b33d806aea9653eb656e3be4adcd73c10dfd6 Mon Sep 17 00:00:00 2001
+From: Charles Lindsay <chaz@yorba.org>
+Date: Fri, 4 Apr 2014 13:01:01 -0700
+Subject: Don't save draft when UIDPLUS is not present: Closes bgo#713983
+
+Without UIDPLUS Geary currently cannot determine the UID of the drafts
+it saves to the server, and so it cannot delete them when the draft is
+saved again or the message is sent. This patch simply checks if
+UIDPLUS is supported, and if not, does not save the draft to the
+server.
+
+Although a string is included in this patch, it's a duplicate of an
+existing string and so technically does not break string freeze.
+
+diff --git src/client/composer/composer-window.vala src/client/composer/composer-window.vala
+index d0a83e4..7351e2f 100644
+--- src/client/composer/composer-window.vala.orig
++++ src/client/composer/composer-window.vala
+@@ -667,28 +667,39 @@ public class ComposerWindow : Gtk.Window {
+ update_from_field();
+ }
+
++ private bool can_save() {
++ return (drafts_folder != null && drafts_folder.get_open_state() == Geary.Folder.OpenState.BOTH
++ && !drafts_folder.properties.create_never_returns_id && editor.can_undo());
++ }
++
+ public bool should_close() {
+- if (!editor.can_undo())
+- return true;
++ bool try_to_save = can_save();
+
+ present();
+ AlertDialog dialog;
+
+- if (drafts_folder == null) {
++ if (drafts_folder == null && try_to_save) {
+ dialog = new ConfirmationDialog(this,
+ _("Do you want to discard the unsaved message?"), null, Stock._DISCARD);
+- } else {
++ } else if (try_to_save) {
+ dialog = new TernaryConfirmationDialog(this,
+ _("Do you want to discard this message?"), null, Stock._KEEP, Stock._DISCARD,
+ Gtk.ResponseType.CLOSE);
++ } else {
++ dialog = new ConfirmationDialog(this,
++ _("Do you want to discard this message?"), null, Stock._DISCARD);
+ }
+
+ Gtk.ResponseType response = dialog.run();
+ if (response == Gtk.ResponseType.CANCEL || response == Gtk.ResponseType.DELETE_EVENT) {
+ return false; // Cancel
+ } else if (response == Gtk.ResponseType.OK) {
+- save_and_exit.begin(); // Save
+- return false;
++ if (try_to_save) {
++ save_and_exit.begin(); // Save
++ return false;
++ } else {
++ return true;
++ }
+ } else {
+ delete_and_exit.begin(); // Discard
+ return false;
+@@ -798,6 +809,11 @@ public class ComposerWindow : Gtk.Window {
+ destroy(); // Only close window after draft is deleted; this closes the drafts folder.
+ }
+
++ private void on_drafts_opened(Geary.Folder.OpenState open_state, int count) {
++ if (open_state == Geary.Folder.OpenState.BOTH)
++ reset_draft_timer();
++ }
++
+ // Returns the drafts folder for the current From account.
+ private async void open_drafts_folder_async(Cancellable cancellable) throws Error {
+ yield close_drafts_folder_async(cancellable);
+@@ -808,9 +824,11 @@ public class ComposerWindow : Gtk.Window {
+ if (folder == null)
+ return; // No drafts folder.
+
+- yield folder.open_async(Geary.Folder.OpenFlags.FAST_OPEN, cancellable);
++ yield folder.open_async(Geary.Folder.OpenFlags.FAST_OPEN | Geary.Folder.OpenFlags.NO_DELAY,
++ cancellable);
+
+ drafts_folder = folder;
++ drafts_folder.opened.connect(on_drafts_opened);
+ }
+
+ private async void close_drafts_folder_async(Cancellable? cancellable = null) throws Error {
+@@ -818,6 +836,7 @@ public class ComposerWindow : Gtk.Window {
+ return;
+
+ // Close existing folder.
++ drafts_folder.opened.disconnect(on_drafts_opened);
+ yield drafts_folder.close_async(cancellable);
+ drafts_folder = null;
+ }
+@@ -835,7 +854,7 @@ public class ComposerWindow : Gtk.Window {
+ }
+
+ private async void save_async(Cancellable? cancellable) {
+- if (drafts_folder == null)
++ if (drafts_folder == null || !can_save())
+ return;
+
+ draft_save_label.label = DRAFT_SAVING_TEXT;
+@@ -1555,7 +1574,7 @@ public class ComposerWindow : Gtk.Window {
+
+ // Resets the draft save timeout.
+ private void reset_draft_timer() {
+- if (!editor.can_undo())
++ if (!can_save())
+ return;
+
+ draft_save_label.label = "";
diff --git a/mail/geary/files/patch-src_engine_api_geary-aggregated-folder-properties.vala b/mail/geary/files/patch-src_engine_api_geary-aggregated-folder-properties.vala
new file mode 100644
index 000000000..893b8cb9c
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_api_geary-aggregated-folder-properties.vala
@@ -0,0 +1,13 @@
+diff --git src/engine/api/geary-aggregated-folder-properties.vala src/engine/api/geary-aggregated-folder-properties.vala
+index ea165e2..986b9e6 100644
+--- src/engine/api/geary-aggregated-folder-properties.vala.orig
++++ src/engine/api/geary-aggregated-folder-properties.vala
+@@ -23,7 +23,7 @@ private class Geary.AggregatedFolderProperties : Geary.FolderProperties {
+ */
+ public AggregatedFolderProperties(bool is_local_only, bool is_virtual) {
+ // Set defaults.
+- base(0, 0, Trillian.UNKNOWN, Trillian.UNKNOWN, Trillian.UNKNOWN, is_local_only, is_virtual);
++ base(0, 0, Trillian.UNKNOWN, Trillian.UNKNOWN, Trillian.UNKNOWN, is_local_only, is_virtual, false);
+ }
+
+ /**
diff --git a/mail/geary/files/patch-src_engine_api_geary-endpoint.vala b/mail/geary/files/patch-src_engine_api_geary-endpoint.vala
new file mode 100644
index 000000000..6083ec55b
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_api_geary-endpoint.vala
@@ -0,0 +1,53 @@
+diff --git src/engine/api/geary-endpoint.vala src/engine/api/geary-endpoint.vala
+index d933644..bf0ab51 100644
+--- src/engine/api/geary-endpoint.vala.orig
++++ src/engine/api/geary-endpoint.vala
+@@ -32,8 +32,7 @@ public class Geary.Endpoint : BaseObject {
+ HALT
+ }
+
+- public string host_specifier { get; private set; }
+- public uint16 default_port { get; private set; }
++ public NetworkAddress remote_address { get; private set; }
+ public Flags flags { get; private set; }
+ public uint timeout_sec { get; private set; }
+ public TlsCertificateFlags tls_validation_flags { get; set; default = TlsCertificateFlags.VALIDATE_ALL; }
+@@ -50,8 +49,7 @@ public class Geary.Endpoint : BaseObject {
+ private SocketClient? socket_client = null;
+
+ public Endpoint(string host_specifier, uint16 default_port, Flags flags, uint timeout_sec) {
+- this.host_specifier = host_specifier;
+- this.default_port = default_port;
++ this.remote_address = new NetworkAddress(host_specifier, default_port);
+ this.flags = flags;
+ this.timeout_sec = timeout_sec;
+ }
+@@ -74,8 +72,7 @@ public class Geary.Endpoint : BaseObject {
+ }
+
+ public async SocketConnection connect_async(Cancellable? cancellable = null) throws Error {
+- SocketConnection cx = yield get_socket_client().connect_to_host_async(host_specifier, default_port,
+- cancellable);
++ SocketConnection cx = yield get_socket_client().connect_async(remote_address, cancellable);
+
+ TcpConnection? tcp = cx as TcpConnection;
+ if (tcp != null)
+@@ -85,8 +82,8 @@ public class Geary.Endpoint : BaseObject {
+ }
+
+ public async TlsClientConnection starttls_handshake_async(IOStream base_stream,
+- SocketConnectable connectable, Cancellable? cancellable = null) throws Error {
+- TlsClientConnection tls_cx = TlsClientConnection.new(base_stream, connectable);
++ Cancellable? cancellable = null) throws Error {
++ TlsClientConnection tls_cx = TlsClientConnection.new(base_stream, remote_address);
+ prepare_tls_cx(tls_cx, true);
+
+ yield tls_cx.handshake_async(Priority.DEFAULT, cancellable);
+@@ -196,7 +193,7 @@ public class Geary.Endpoint : BaseObject {
+ }
+
+ public string to_string() {
+- return "%s/default:%u".printf(host_specifier, default_port);
++ return "%s/default:%u".printf(remote_address.hostname, remote_address.port);
+ }
+ }
diff --git a/mail/geary/files/patch-src_engine_api_geary-folder-properties.vala b/mail/geary/files/patch-src_engine_api_geary-folder-properties.vala
new file mode 100644
index 000000000..e8520068c
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_api_geary-folder-properties.vala
@@ -0,0 +1,30 @@
+diff --git src/engine/api/geary-folder-properties.vala src/engine/api/geary-folder-properties.vala
+index f40cf7c..2f571da 100644
+--- src/engine/api/geary-folder-properties.vala.orig
++++ src/engine/api/geary-folder-properties.vala
+@@ -59,8 +59,16 @@ public abstract class Geary.FolderProperties : BaseObject {
+ */
+ public bool is_virtual { get; private set; }
+
++ /**
++ * True if APPEND on the folder will never return the created UID. This is
++ * for servers that don't support UIDPLUS. Most servers support UIDPLUS,
++ * so this will usually be false.
++ */
++ public bool create_never_returns_id { get; protected set; }
++
+ protected FolderProperties(int email_total, int email_unread, Trillian has_children,
+- Trillian supports_children, Trillian is_openable, bool is_local_only, bool is_virtual) {
++ Trillian supports_children, Trillian is_openable, bool is_local_only, bool is_virtual,
++ bool create_never_returns_id) {
+ this.email_total = email_total;
+ this.email_unread = email_unread;
+ this.has_children = has_children;
+@@ -68,6 +76,7 @@ public abstract class Geary.FolderProperties : BaseObject {
+ this.is_openable = is_openable;
+ this.is_local_only = is_local_only;
+ this.is_virtual = is_virtual;
++ this.create_never_returns_id = create_never_returns_id;
+ }
+ }
+
diff --git a/mail/geary/files/patch-src_engine_api_geary-search-folder.vala b/mail/geary/files/patch-src_engine_api_geary-search-folder.vala
new file mode 100644
index 000000000..99006b26f
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_api_geary-search-folder.vala
@@ -0,0 +1,13 @@
+diff --git src/engine/api/geary-search-folder.vala src/engine/api/geary-search-folder.vala
+index 518b409..672853f 100644
+--- src/engine/api/geary-search-folder.vala.orig
++++ src/engine/api/geary-search-folder.vala
+@@ -14,7 +14,7 @@ public class Geary.SearchFolderRoot : Geary.FolderRoot {
+
+ public class Geary.SearchFolderProperties : Geary.FolderProperties {
+ public SearchFolderProperties(int total, int unread) {
+- base(total, unread, Trillian.FALSE, Trillian.FALSE, Trillian.TRUE, true, true);
++ base(total, unread, Trillian.FALSE, Trillian.FALSE, Trillian.TRUE, true, true, false);
+ }
+
+ public void set_total(int total) {
diff --git a/mail/geary/files/patch-src_engine_imap-db_outbox_smtp-outbox-folder-properties.vala b/mail/geary/files/patch-src_engine_imap-db_outbox_smtp-outbox-folder-properties.vala
new file mode 100644
index 000000000..05f1b5cff
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_imap-db_outbox_smtp-outbox-folder-properties.vala
@@ -0,0 +1,13 @@
+diff --git src/engine/imap-db/outbox/smtp-outbox-folder-properties.vala src/engine/imap-db/outbox/smtp-outbox-folder-properties.vala
+index 1873439..535e3ef 100644
+--- src/engine/imap-db/outbox/smtp-outbox-folder-properties.vala.orig
++++ src/engine/imap-db/outbox/smtp-outbox-folder-properties.vala
+@@ -6,7 +6,7 @@
+
+ private class Geary.SmtpOutboxFolderProperties : Geary.FolderProperties {
+ public SmtpOutboxFolderProperties(int total, int unread) {
+- base (total, unread, Trillian.FALSE, Trillian.FALSE, Trillian.TRUE, true, false);
++ base (total, unread, Trillian.FALSE, Trillian.FALSE, Trillian.TRUE, true, false, false);
+ }
+
+ public void set_total(int total) {
diff --git a/mail/geary/files/patch-src_engine_imap-engine_imap-engine-generic-account.vala b/mail/geary/files/patch-src_engine_imap-engine_imap-engine-generic-account.vala
new file mode 100644
index 000000000..b21404ff1
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_imap-engine_imap-engine-generic-account.vala
@@ -0,0 +1,13 @@
+diff --git src/engine/imap-engine/imap-engine-generic-account.vala src/engine/imap-engine/imap-engine-generic-account.vala
+index baec78f..4e0bdc4 100644
+--- src/engine/imap-engine/imap-engine-generic-account.vala.orig
++++ src/engine/imap-engine/imap-engine-generic-account.vala
+@@ -769,7 +769,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.AbstractAccount {
+ // TODO: we should probably not use someone else's FQDN in something
+ // that's supposed to be globally unique...
+ Geary.RFC822.Message rfc822 = new Geary.RFC822.Message.from_composed_email(
+- composed, GMime.utils_generate_message_id(information.get_smtp_endpoint().host_specifier));
++ composed, GMime.utils_generate_message_id(information.get_smtp_endpoint().remote_address.hostname));
+
+ // don't use create_email_async() as that requires the folder be open to use
+ yield local.outbox.enqueue_email_async(rfc822, cancellable);
diff --git a/mail/geary/files/patch-src_engine_imap-engine_imap-engine-mail-prefetcher.vala b/mail/geary/files/patch-src_engine_imap-engine_imap-engine-mail-prefetcher.vala
new file mode 100644
index 000000000..b1e75b7d8
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_imap-engine_imap-engine-mail-prefetcher.vala
@@ -0,0 +1,46 @@
+From 201af223c2cd7265ec60b4a1f608405d264f9351 Mon Sep 17 00:00:00 2001
+From: Jim Nelson <jim@yorba.org>
+Date: Mon, 21 Apr 2014 11:17:03 -0700
+Subject: Prevent AccountSynchronizier from deadlocking under certain
+ conditions
+
+The AccountSynchronizer could deadlock waiting for an EmailPrefetcher
+to finish under certain conditions, particularly if the folder closed
+before the prefetcher was finished. This lead to a state where the
+AccountSynchronizer would never synchronize against unopened folders.
+If Geary was left open for a long time and the user clicked on All
+Mail, rather than the current state of that folder appearing
+immediately, it could take a moment for Geary to fetch the envelopes
+and headers/bodies.
+
+Fixing this closes bgo#713447, which was also due to other bugs that
+have been fixed over time (in particular, the startup speedup work in
+0.5) and better spinner management (bgo#713703). It also corrects
+a problem where detection of new mail while opening the folder let
+to prefetching that mail, which was unnecessary because once the
+folder is fully opened all unsynchronized mail is detected and pulled
+down.
+
+diff --git src/engine/imap-engine/imap-engine-email-prefetcher.vala src/engine/imap-engine/imap-engine-email-prefetcher.vala
+index 4fd3a47..76c36dc 100644
+--- src/engine/imap-engine/imap-engine-email-prefetcher.vala.orig
++++ src/engine/imap-engine/imap-engine-email-prefetcher.vala
+@@ -70,10 +70,18 @@ private class Geary.ImapEngine.EmailPrefetcher : Object {
+ if (schedule_id != 0) {
+ Source.remove(schedule_id);
+ schedule_id = 0;
++
++ // since an acquire was done when scheduled, need to notify when cancelled
++ active_sem.blind_notify();
+ }
+ }
+
+ private void on_local_expansion(Gee.Collection<Geary.EmailIdentifier> ids) {
++ // it's possible to be notified of an append prior to remote open; don't prefetch until
++ // that occurs
++ if (folder.get_open_state() != Geary.Folder.OpenState.BOTH)
++ return;
++
+ // acquire here since .begin() only schedules for later
+ active_sem.acquire();
+ do_prepare_new_async.begin(ids);
diff --git a/mail/geary/files/patch-src_engine_imap-engine_imap_transport_imap-client-connection.vala b/mail/geary/files/patch-src_engine_imap-engine_imap_transport_imap-client-connection.vala
new file mode 100644
index 000000000..88df66449
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_imap-engine_imap_transport_imap-client-connection.vala
@@ -0,0 +1,15 @@
+diff --git src/engine/imap/transport/imap-client-connection.vala src/engine/imap/transport/imap-client-connection.vala
+index 9ca950f..e6dfce7 100644
+--- src/engine/imap/transport/imap-client-connection.vala.orig
++++ src/engine/imap/transport/imap-client-connection.vala
+@@ -490,8 +490,7 @@ public class Geary.Imap.ClientConnection : BaseObject {
+ yield close_channels_async(cancellable);
+
+ // wrap connection with TLS connection
+- TlsClientConnection tls_cx = yield endpoint.starttls_handshake_async(cx,
+- cx.get_remote_address(), cancellable);
++ TlsClientConnection tls_cx = yield endpoint.starttls_handshake_async(cx, cancellable);
+
+ ios = tls_cx;
+
+
diff --git a/mail/geary/files/patch-src_engine_imap_api_imap-folder-properties.vala b/mail/geary/files/patch-src_engine_imap_api_imap-folder-properties.vala
new file mode 100644
index 000000000..303623bf4
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_imap_api_imap-folder-properties.vala
@@ -0,0 +1,32 @@
+diff --git src/engine/imap/api/imap-folder-properties.vala src/engine/imap/api/imap-folder-properties.vala
+index 4b7b4b3..c062186 100644
+--- src/engine/imap/api/imap-folder-properties.vala.orig
++++ src/engine/imap/api/imap-folder-properties.vala
+@@ -67,7 +67,7 @@ public class Geary.Imap.FolderProperties : Geary.FolderProperties {
+ // give the base class a zero email_unread, as the notion of "unknown" doesn't exist in
+ // its contract
+ base (messages, email_unread, Trillian.UNKNOWN, Trillian.UNKNOWN, Trillian.UNKNOWN, false,
+- false);
++ false, false);
+
+ select_examine_messages = messages;
+ status_messages = -1;
+@@ -82,7 +82,7 @@ public class Geary.Imap.FolderProperties : Geary.FolderProperties {
+
+ public FolderProperties.status(StatusData status, MailboxAttributes attrs) {
+ base (status.messages, status.unseen, Trillian.UNKNOWN, Trillian.UNKNOWN, Trillian.UNKNOWN,
+- false, false);
++ false, false, false);
+
+ select_examine_messages = -1;
+ status_messages = status.messages;
+@@ -213,5 +213,9 @@ public class Geary.Imap.FolderProperties : Geary.FolderProperties {
+ // update base class value (which clients see)
+ email_unread = count;
+ }
++
++ public void set_from_session_capabilities(Capabilities capabilities) {
++ create_never_returns_id = !capabilities.supports_uidplus();
++ }
+ }
+
diff --git a/mail/geary/files/patch-src_engine_imap_api_imap-folder.vala b/mail/geary/files/patch-src_engine_imap_api_imap-folder.vala
new file mode 100644
index 000000000..9dbbd0daa
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_imap_api_imap-folder.vala
@@ -0,0 +1,13 @@
+diff --git src/engine/imap/api/imap-folder.vala src/engine/imap/api/imap-folder.vala
+index 71741ad..72c2c23 100644
+--- src/engine/imap/api/imap-folder.vala.orig
++++ src/engine/imap/api/imap-folder.vala
+@@ -95,6 +95,8 @@ private class Geary.Imap.Folder : BaseObject {
+ session.status_response_received.connect(on_status_response);
+ session.disconnected.connect(on_disconnected);
+
++ properties.set_from_session_capabilities(session.capabilities);
++
+ StatusResponse response = yield session.select_async(
+ new MailboxSpecifier.from_folder_path(path, info.delim), cancellable);
+ if (response.status != Status.OK) {
diff --git a/mail/geary/files/patch-src_engine_smtp_stmp-client-connection.vala b/mail/geary/files/patch-src_engine_smtp_stmp-client-connection.vala
new file mode 100644
index 000000000..0b47cca75
--- /dev/null
+++ b/mail/geary/files/patch-src_engine_smtp_stmp-client-connection.vala
@@ -0,0 +1,14 @@
+diff --git src/engine/smtp/smtp-client-connection.vala src/engine/smtp/smtp-client-connection.vala
+index d62dd42..f629a64 100644
+--- src/engine/smtp/smtp-client-connection.vala.orig
++++ src/engine/smtp/smtp-client-connection.vala
+@@ -246,8 +246,7 @@ public class Geary.Smtp.ClientConnection {
+ if (!starttls_response.code.is_starttls_ready())
+ throw new SmtpError.STARTTLS_FAILED("STARTTLS failed: %s", response.to_string());
+
+- TlsClientConnection tls_cx = yield endpoint.starttls_handshake_async(cx,
+- socket_cx.get_remote_address(), cancellable);
++ TlsClientConnection tls_cx = yield endpoint.starttls_handshake_async(cx, cancellable);
+ cx = tls_cx;
+ set_data_streams(tls_cx);
+