Index: mail/em-camel-stream.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-camel-stream.c,v
retrieving revision 1.4
diff -u -p -r1.4 em-camel-stream.c
--- mail/em-camel-stream.c	21 Dec 2005 14:10:25 -0000	1.4
+++ mail/em-camel-stream.c	5 Oct 2006 16:01:13 -0000
@@ -179,6 +179,7 @@ static void
 sync_op(EMCamelStream *estream, enum _write_msg_t op, const char *data, size_t n)
 {
 	struct _write_msg msg;
+	EMsg *reply_msg;
 
 	d(printf("%p: launching sync op %d\n", estream, op));
 	/* we do everything synchronous, we should never have any locks, and
@@ -188,8 +189,8 @@ sync_op(EMCamelStream *estream, enum _wr
 	msg.data = data;
 	msg.n = n;
 	e_msgport_put(estream->data_port, &msg.msg);
-	e_msgport_wait(estream->reply_port);
-	g_assert(e_msgport_get(msg.msg.reply_port) == &msg.msg);
+	reply_msg = e_msgport_wait(estream->reply_port);
+	g_assert(reply_msg == &msg.msg);
 	d(printf("%p: returned sync op %d\n", estream, op));
 }
 
Index: mail/em-sync-stream.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-sync-stream.c,v
retrieving revision 1.5
diff -u -p -r1.5 em-sync-stream.c
--- mail/em-sync-stream.c	21 Dec 2005 14:10:25 -0000	1.5
+++ mail/em-sync-stream.c	5 Oct 2006 16:01:15 -0000
@@ -214,6 +214,7 @@ sync_op(EMSyncStream *emss, enum _write_
 {
 	struct _EMSyncStreamPrivate *p = emss->priv;
 	struct _write_msg msg;
+	EMsg *reply_msg;
 
 	d(printf("%p: launching sync op %d\n", emss, op));
 
@@ -226,9 +227,9 @@ sync_op(EMSyncStream *emss, enum _write_
 	msg.n = n;
 
 	e_msgport_put(p->data_port, &msg.msg);
-	e_msgport_wait(p->reply_port);
+	reply_msg = e_msgport_wait(p->reply_port);
+	g_assert(reply_msg == &msg.msg);
 
-	g_assert(e_msgport_get(msg.msg.reply_port) == &msg.msg);
 	d(printf("%p: returned sync op %d\n", emss, op));
 }
 
Index: mail/mail-session.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-session.c,v
retrieving revision 1.111
diff -u -p -r1.111 mail-session.c
--- mail/mail-session.c	24 Apr 2006 06:55:13 -0000	1.111
+++ mail/mail-session.c	5 Oct 2006 16:01:15 -0000
@@ -395,8 +395,7 @@ alert_user(CamelSession *session, CamelS
 	}
 
 	if (cancel) {
-		e_msgport_wait(user_message_reply);
-		r = (struct _user_message_msg *)e_msgport_get(user_message_reply);
+		r = (struct _user_message_msg *)e_msgport_wait(user_message_reply);
 		g_assert(m == r);
 
 		ret = m->result;
