diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-01-30 05:06:01 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-01-30 05:06:01 +0800 |
commit | 865606984fb9d3c1a3e6af99ceea17fac7c18b07 (patch) | |
tree | 592520727af3a87a5e5baa15685a10f65d116f8d /mail/mail-ops.c | |
parent | 85610de9fec51076b7ff834e22409a029d18a484 (diff) | |
download | gsoc2013-evolution-865606984fb9d3c1a3e6af99ceea17fac7c18b07.tar.gz gsoc2013-evolution-865606984fb9d3c1a3e6af99ceea17fac7c18b07.tar.zst gsoc2013-evolution-865606984fb9d3c1a3e6af99ceea17fac7c18b07.zip |
New function that implements the Redirect feature.
2002-01-29 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (redirect): New function that implements the
Redirect feature.
* mail-ops.c (mail_send_message): If we are redirecting a message,
get the Resent-* recipients otherwise get the normal To/Cc/Bcc
recipients and use them in the CamelTransport::send_to() method.
* mail-session.c (main_get_filter_driver): Set the beep_func to
the beep_cb, not the play_sound_func. Oops ;-)
* folder-browser-ui.c: Add Redirect bonobo verb thingy here.
(folder_browser_ui_set_selection_state): Add MessageRedirect to
the proper string arrays.
svn path=/trunk/; revision=15511
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index fa43d361f3..4973c56dbc 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -426,19 +426,35 @@ mail_fetch_mail (const char *source, int keep, const char *type, CamelOperation extern CamelFolder *sent_folder; +static char *normal_recipients[] = { + CAMEL_RECIPIENT_TYPE_TO, + CAMEL_RECIPIENT_TYPE_CC, + CAMEL_RECIPIENT_TYPE_BCC +}; + +static char *resent_recipients[] = { + CAMEL_RECIPIENT_TYPE_RESENT_TO, + CAMEL_RECIPIENT_TYPE_RESENT_CC, + CAMEL_RECIPIENT_TYPE_RESENT_BCC +}; + /* send 1 message to a specific transport */ static void mail_send_message (CamelMimeMessage *message, const char *destination, CamelFilterDriver *driver, CamelException *ex) { + const CamelInternetAddress *iaddr; + CamelAddress *from, *recipients; CamelMessageInfo *info; CamelTransport *xport = NULL; char *transport_url = NULL; char *sent_folder_uri = NULL; + const char *resent_from; CamelFolder *folder; XEvolution *xev; + int i; - camel_medium_add_header (CAMEL_MEDIUM (message), "X-Mailer", + camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer", "Evolution/" VERSION SUB_VERSION " " VERSION_COMMENT); camel_mime_message_set_date (message, CAMEL_MESSAGE_DATE_CURRENT, 0); @@ -471,7 +487,27 @@ mail_send_message (CamelMimeMessage *message, const char *destination, return; } - camel_transport_send (xport, CAMEL_MEDIUM (message), ex); + from = (CamelAddress *) camel_internet_address_new (); + resent_from = camel_medium_get_header (CAMEL_MEDIUM (message), "Resent-From"); + if (resent_from) { + camel_address_decode (from, resent_from); + } else { + iaddr = camel_mime_message_get_from (message); + camel_address_copy (from, CAMEL_ADDRESS (iaddr)); + } + + recipients = (CamelAddress *) camel_internet_address_new (); + for (i = 0; i < 3; i++) { + const char *type; + + type = resent_from ? resent_recipients[i] : normal_recipients[i]; + iaddr = camel_mime_message_get_recipients (message, type); + camel_address_cat (recipients, CAMEL_ADDRESS (iaddr)); + } + + camel_transport_send_to (xport, CAMEL_MEDIUM (message), from, recipients, ex); + camel_object_unref (CAMEL_OBJECT (recipients)); + camel_object_unref (CAMEL_OBJECT (from)); mail_tool_restore_xevolution_headers (message, xev); mail_tool_destroy_xevolution (xev); |