From f8f226f65276f1c645eff2d6edb48c8d6caf2256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 4 Oct 2003 23:31:05 +0000 Subject: Version bump. New 'default' keyword for indentities (Vitezslav Batrla). Documentation updates. --- smtp.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'smtp.c') diff --git a/smtp.c b/smtp.c index b358f46..14f1df6 100644 --- a/smtp.c +++ b/smtp.c @@ -80,7 +80,7 @@ identity_t *identity_lookup(const char *address) identity_t *identity; identity = list_entry(ptr, identity_t, list); - if(!strcmp(identity->address, address)) + if(identity->address && !strcmp(identity->address, address)) return identity; } } @@ -90,13 +90,11 @@ identity_t *identity_lookup(const char *address) void identities_init(void) { - default_identity = identity_new(); } void identities_cleanup(void) { - if(default_identity) - identity_free(default_identity); + default_identity = NULL; if(!list_empty(&identities)) { @@ -389,8 +387,16 @@ void smtp_send(message_t *msg) goto failure; /* Set the reverse path for the mail envelope. (NULL is ok) */ - if(!smtp_set_reverse_path (message, msg->reverse_path)) - goto failure; + if(msg->reverse_path) + { + if(!smtp_set_reverse_path (message, msg->reverse_path)) + goto failure; + } + else + { + if(!smtp_set_reverse_path (message, identity->address)) + goto failure; + } /* Open the message file and set the callback to read it. */ if(!smtp_set_messagecb (message, message_cb, msg)) -- cgit v1.2.3-2-g168b