aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-01-16 03:22:14 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-01-16 03:22:14 +0800
commitb238693b64aa877efe1d0d09aa8129748be095ed (patch)
tree96b6a2ba9ddc58a653f0d03564b3faa8d77d5583
parent811c9c4acdc308b55d38dda2fda2e30433cd5e5b (diff)
downloadgsoc2013-evolution-b238693b64aa877efe1d0d09aa8129748be095ed.tar
gsoc2013-evolution-b238693b64aa877efe1d0d09aa8129748be095ed.tar.gz
gsoc2013-evolution-b238693b64aa877efe1d0d09aa8129748be095ed.tar.bz2
gsoc2013-evolution-b238693b64aa877efe1d0d09aa8129748be095ed.tar.lz
gsoc2013-evolution-b238693b64aa877efe1d0d09aa8129748be095ed.tar.xz
gsoc2013-evolution-b238693b64aa877efe1d0d09aa8129748be095ed.tar.zst
gsoc2013-evolution-b238693b64aa877efe1d0d09aa8129748be095ed.zip
Updated to match the new send_to API. (smtp_send): Get the from address
2002-01-15 Jeffrey Stedfast <fejj@ximian.com> * providers/smtp/camel-smtp-transport.c (smtp_send_to): Updated to match the new send_to API. (smtp_send): Get the from address and pass that along to smtp_send_to(). * providers/sendmail/camel-sendmail-transport.c (sendmail_send_to): Updated to match the new send_to API. * camel-transport.c (camel_transport_send_to): Now takes a from argument too. svn path=/trunk/; revision=15328
-rw-r--r--camel/ChangeLog11
-rw-r--r--camel/camel-transport.c6
-rw-r--r--camel/camel-transport.h5
-rw-r--r--camel/providers/sendmail/camel-sendmail-transport.c14
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c16
5 files changed, 36 insertions, 16 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 07994e21f8..44b571ac7b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,16 @@
2002-01-15 Jeffrey Stedfast <fejj@ximian.com>
+ * providers/smtp/camel-smtp-transport.c (smtp_send_to): Updated to
+ match the new send_to API.
+ (smtp_send): Get the from address and pass that along to
+ smtp_send_to().
+
+ * providers/sendmail/camel-sendmail-transport.c
+ (sendmail_send_to): Updated to match the new send_to API.
+
+ * camel-transport.c (camel_transport_send_to): Now takes a from
+ argument too.
+
* providers/imap/camel-imap-folder.c (imap_update_summary): Sort
the needheaders UID array and fixed to respect the
UID_SET_LIMIT. This should now finish the fixification of bug
diff --git a/camel/camel-transport.c b/camel/camel-transport.c
index 00b2a31837..513a28b30e 100644
--- a/camel/camel-transport.c
+++ b/camel/camel-transport.c
@@ -122,6 +122,7 @@ camel_transport_send (CamelTransport *transport, CamelMedium *message,
* camel_transport_send_to: Send a message non-standard recipients
* @transport: the transport
* @message: the message
+ * @from: from address
* @recipients: the recipients
* @ex: a CamelException
*
@@ -132,7 +133,8 @@ camel_transport_send (CamelTransport *transport, CamelMedium *message,
**/
gboolean
camel_transport_send_to (CamelTransport *transport, CamelMedium *message,
- CamelAddress *recipients, CamelException *ex)
+ CamelAddress *from, CamelAddress *recipients,
+ CamelException *ex)
{
gboolean sent;
@@ -140,7 +142,7 @@ camel_transport_send_to (CamelTransport *transport, CamelMedium *message,
CAMEL_TRANSPORT_LOCK (transport, send_lock);
sent = CT_CLASS (transport)->send_to (transport, message,
- recipients, ex);
+ from, recipients, ex);
CAMEL_TRANSPORT_UNLOCK (transport, send_lock);
return sent;
diff --git a/camel/camel-transport.h b/camel/camel-transport.h
index dbe9c54f38..418fc402a2 100644
--- a/camel/camel-transport.h
+++ b/camel/camel-transport.h
@@ -60,7 +60,8 @@ typedef struct {
gboolean (*send) (CamelTransport *transport, CamelMedium *message,
CamelException *ex);
gboolean (*send_to) (CamelTransport *transport, CamelMedium *message,
- CamelAddress *recipients, CamelException *ex);
+ CamelAddress *from, CamelAddress *recipients,
+ CamelException *ex);
} CamelTransportClass;
@@ -72,9 +73,9 @@ gboolean camel_transport_send (CamelTransport *transport,
CamelMedium *message,
CamelException *ex);
-/* FIXME: This should use a camel-address */
gboolean camel_transport_send_to (CamelTransport *transport,
CamelMedium *message,
+ CamelAddress *from,
CamelAddress *recipients,
CamelException *ex);
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
index 0d51333955..7ee5c3bdab 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ b/camel/providers/sendmail/camel-sendmail-transport.c
@@ -45,7 +45,8 @@ 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,
- CamelAddress *recipients, CamelException *ex);
+ CamelAddress *from, CamelAddress *recipients,
+ CamelException *ex);
static void
@@ -198,22 +199,25 @@ get_from (CamelMedium *message, CamelException *ex)
static gboolean
sendmail_send_to (CamelTransport *transport, CamelMedium *message,
- CamelAddress *recipients, CamelException *ex)
+ CamelAddress *from, CamelAddress *recipients,
+ CamelException *ex)
{
- const char *from, *addr, **argv;
+ const char *from_addr, *addr, **argv;
gboolean status;
int i, len;
- from = get_from (message, ex);
if (!from)
return FALSE;
+ if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (from), 0, NULL, &from_addr))
+ return FALSE;
+
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[3] = from_addr;
argv[4] = "--";
for (i = 0; i < len; i++) {
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 71bd1d8776..c54e0821d8 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -70,7 +70,7 @@
static gboolean smtp_can_send (CamelTransport *transport, CamelMedium *message);
static gboolean smtp_send (CamelTransport *transport, CamelMedium *message, CamelException *ex);
static gboolean smtp_send_to (CamelTransport *transport, CamelMedium *message,
- CamelAddress *recipients, CamelException *ex);
+ CamelAddress *from, CamelAddress *recipients, CamelException *ex);
/* support prototypes */
static void smtp_construct (CamelService *service, CamelSession *session,
@@ -567,7 +567,8 @@ smtp_can_send (CamelTransport *transport, CamelMedium *message)
static gboolean
smtp_send_to (CamelTransport *transport, CamelMedium *message,
- CamelAddress *recipients, CamelException *ex)
+ CamelAddress *from, CamelAddress *recipients,
+ CamelException *ex)
{
CamelSmtpTransport *smtp_transport = CAMEL_SMTP_TRANSPORT (transport);
const CamelInternetAddress *cia;
@@ -575,15 +576,14 @@ smtp_send_to (CamelTransport *transport, CamelMedium *message,
const char *addr;
int i, len;
- cia = camel_mime_message_get_from (CAMEL_MIME_MESSAGE (message));
- if (!cia) {
+ if (!from) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot send message: "
"sender address not defined."));
return FALSE;
}
- if (!camel_internet_address_get (cia, 0, NULL, &addr)) {
+ if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (from), 0, NULL, &addr)) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot send message: "
"sender address not valid."));
@@ -642,10 +642,12 @@ smtp_send_to (CamelTransport *transport, CamelMedium *message,
static gboolean
smtp_send (CamelTransport *transport, CamelMedium *message, CamelException *ex)
{
- const CamelInternetAddress *to, *cc, *bcc;
+ const CamelInternetAddress *from, *to, *cc, *bcc;
CamelInternetAddress *recipients = NULL;
gboolean status;
+ from = camel_mime_message_get_from (CAMEL_MIME_MESSAGE (message));
+
to = camel_mime_message_get_recipients (CAMEL_MIME_MESSAGE (message), CAMEL_RECIPIENT_TYPE_TO);
cc = camel_mime_message_get_recipients (CAMEL_MIME_MESSAGE (message), CAMEL_RECIPIENT_TYPE_CC);
bcc = camel_mime_message_get_recipients (CAMEL_MIME_MESSAGE (message), CAMEL_RECIPIENT_TYPE_BCC);
@@ -655,7 +657,7 @@ smtp_send (CamelTransport *transport, CamelMedium *message, CamelException *ex)
camel_address_cat (CAMEL_ADDRESS (recipients), CAMEL_ADDRESS (cc));
camel_address_cat (CAMEL_ADDRESS (recipients), CAMEL_ADDRESS (bcc));
- status = smtp_send_to (transport, message, CAMEL_ADDRESS (recipients), ex);
+ status = smtp_send_to (transport, message, CAMEL_ADDRESS (from), CAMEL_ADDRESS (recipients), ex);
camel_object_unref (CAMEL_OBJECT (recipients));