aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/sendmail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-12-21 02:45:22 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-12-21 02:45:22 +0800
commit00903a7e0f235f1825ba2c9b934e607ad77855c4 (patch)
treee3960027808c3da6f6062415b9483164ed670b38 /camel/providers/sendmail
parente97bb59a94aa28b302863c42e35e96fdf086d7cf (diff)
downloadgsoc2013-evolution-00903a7e0f235f1825ba2c9b934e607ad77855c4.tar
gsoc2013-evolution-00903a7e0f235f1825ba2c9b934e607ad77855c4.tar.gz
gsoc2013-evolution-00903a7e0f235f1825ba2c9b934e607ad77855c4.tar.bz2
gsoc2013-evolution-00903a7e0f235f1825ba2c9b934e607ad77855c4.tar.lz
gsoc2013-evolution-00903a7e0f235f1825ba2c9b934e607ad77855c4.tar.xz
gsoc2013-evolution-00903a7e0f235f1825ba2c9b934e607ad77855c4.tar.zst
gsoc2013-evolution-00903a7e0f235f1825ba2c9b934e607ad77855c4.zip
Change the prototype for camel_address_get_type to return a CamelType
2001-12-20 Jeffrey Stedfast <fejj@ximian.com> * camel-address.h: Change the prototype for camel_address_get_type to return a CamelType (since internally this is what it returns and also in case we decide to write a replacement for the current CamelObject it'd be easier to drop in). * camel-internet-address.h: Same but for camel_internet_address_get_type() * providers/smtp/camel-smtp-transport.c (smtp_send_to): Updated to use a CamelAddress of recipients. (smtp_send): Since smtp_send_to now takes a CamelAddress recipients argument, our lives have been simplified and we can now just concat To/Cc/Bcc into a recipients addr and send away. * providers/sendmail/camel-sendmail-transport.c (sendmail_send_to): Updated to use a CamelAddress of recipients. * camel-transport.c (camel_transport_send_to): Now takes a CamelAddress argument for the recipient list rather than a GList. svn path=/trunk/; revision=15197
Diffstat (limited to 'camel/providers/sendmail')
-rw-r--r--camel/providers/sendmail/camel-sendmail-transport.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
index 28bc488c1d..0d51333955 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ b/camel/providers/sendmail/camel-sendmail-transport.c
@@ -45,7 +45,7 @@ static gboolean sendmail_can_send (CamelTransport *transport, CamelMedium *messa
static gboolean sendmail_send (CamelTransport *transport, CamelMedium *message,
CamelException *ex);
static gboolean sendmail_send_to (CamelTransport *transport, CamelMedium *message,
- GList *recipients, CamelException *ex);
+ CamelAddress *recipients, CamelException *ex);
static void
@@ -198,37 +198,46 @@ get_from (CamelMedium *message, CamelException *ex)
static gboolean
sendmail_send_to (CamelTransport *transport, CamelMedium *message,
- GList *recipients, CamelException *ex)
+ CamelAddress *recipients, CamelException *ex)
{
- GList *r;
- const char *from, **argv;
- int i, len;
+ const char *from, *addr, **argv;
gboolean status;
-
+ int i, len;
+
from = get_from (message, ex);
if (!from)
return FALSE;
-
- len = g_list_length (recipients);
+
+ len = camel_address_length (recipients);
argv = g_malloc ((len + 6) * sizeof (char *));
argv[0] = "sendmail";
argv[1] = "-i";
argv[2] = "-f";
argv[3] = from;
argv[4] = "--";
-
- for (i = 1, r = recipients; i <= len; i++, r = r->next)
- argv[i + 4] = r->data;
- argv[i + 4] = NULL;
-
+
+ for (i = 0; i < len; i++) {
+ if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (recipients), i, NULL, &addr)) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not parse recipient list"));
+ g_free (argv);
+ return FALSE;
+ }
+
+ argv[i + 5] = addr;
+ }
+
+ argv[i + 5] = NULL;
+
status = sendmail_send_internal (message, argv, ex);
g_free (argv);
+
return status;
}
static gboolean
sendmail_send (CamelTransport *transport, CamelMedium *message,
- CamelException *ex)
+ CamelException *ex)
{
const char *argv[6] = { "sendmail", "-t", "-i", "-f", NULL, NULL };