From 21a546759f43127acc297d0277e4c6d8b1d67245 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 11 Mar 2001 03:42:11 +0000 Subject: Remove our X-Evolution header before we send. 2001-03-10 Jeffrey Stedfast * mail-ops.c (send_queue_send): Remove our X-Evolution header before we send. svn path=/trunk/; revision=8625 --- mail/ChangeLog | 5 ++++ mail/mail-ops.c | 74 ++++++++++++++++++++++++++++++--------------------------- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 8dee75f3ea..8df940c6d8 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2001-03-10 Jeffrey Stedfast + + * mail-ops.c (send_queue_send): Remove our X-Evolution header + before we send. + 2001-03-09 Jeffrey Stedfast * mail-mt.c (mail_get_accept): New async function that will be diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 5c1d82784a..8766339c6d 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -612,61 +612,65 @@ static void send_queue_send(struct _mail_msg *mm) { struct _send_queue_msg *m = (struct _send_queue_msg *)mm; + extern CamelFolder *sent_folder; /* FIXME */ GPtrArray *uids; int i; - extern CamelFolder *sent_folder; /* FIXME */ - + printf("sending queue\n"); - - uids = camel_folder_get_uids(m->queue); + + uids = camel_folder_get_uids (m->queue); if (uids == NULL || uids->len == 0) return; - + if (m->cancel) - camel_operation_register(m->cancel); + camel_operation_register (m->cancel); - for (i=0; ilen; i++) { + for (i = 0; i < uids->len; i++) { CamelMimeMessage *message; + CamelMessageInfo *info; char *destination; - int pc = (100 * i)/uids->len; - - report_status(m, CAMEL_FILTER_STATUS_START, pc, "Sending message %d of %d", i+1, uids->len); + int pc = (100 * i) / uids->len; - message = camel_folder_get_message(m->queue, uids->pdata[i], &mm->ex); - if (camel_exception_is_set(&mm->ex)) + report_status (m, CAMEL_FILTER_STATUS_START, pc, "Sending message %d of %d", i+1, uids->len); + + message = camel_folder_get_message (m->queue, uids->pdata[i], &mm->ex); + if (camel_exception_is_set (&mm->ex)) break; - + + /* Remove the X-Evolution header so we don't send our flags too ;-) */ + camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution"); + /* Get the preferred transport URI */ - destination = (char *)camel_medium_get_header(CAMEL_MEDIUM(message), "X-Evolution-Transport"); + destination = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Transport"); if (destination) { - destination = g_strdup(destination); - camel_medium_remove_header(CAMEL_MEDIUM(message), "X-Evolution-Transport"); - mail_send_message(message, g_strstrip(destination), m->driver, &mm->ex); - g_free(destination); + destination = g_strdup (destination); + camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Transport"); + mail_send_message (message, g_strstrip (destination), m->driver, &mm->ex); + g_free (destination); } else - mail_send_message(message, m->destination, m->driver, &mm->ex); - - if (camel_exception_is_set(&mm->ex)) + mail_send_message (message, m->destination, m->driver, &mm->ex); + + if (camel_exception_is_set (&mm->ex)) break; - - camel_folder_set_message_flags(m->queue, uids->pdata[i], CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED); + + camel_folder_set_message_flags (m->queue, uids->pdata[i], CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED); } - - if (camel_exception_is_set(&mm->ex)) - report_status(m, CAMEL_FILTER_STATUS_END, 100, "Failed on message %d of %d", i+1, uids->len); + + if (camel_exception_is_set (&mm->ex)) + report_status (m, CAMEL_FILTER_STATUS_END, 100, "Failed on message %d of %d", i+1, uids->len); else - report_status(m, CAMEL_FILTER_STATUS_END, 100, "Complete."); - - camel_folder_free_uids(m->queue, uids); - - if (!camel_exception_is_set(&mm->ex)) - camel_folder_expunge(m->queue, &mm->ex); + report_status (m, CAMEL_FILTER_STATUS_END, 100, "Complete."); + + camel_folder_free_uids (m->queue, uids); + + if (!camel_exception_is_set (&mm->ex)) + camel_folder_expunge (m->queue, &mm->ex); if (sent_folder) - camel_folder_sync(sent_folder, FALSE, &mm->ex); - + camel_folder_sync (sent_folder, FALSE, &mm->ex); + if (m->cancel) - camel_operation_unregister(m->cancel); + camel_operation_unregister (m->cancel); } static void -- cgit v1.2.3