diff options
-rw-r--r-- | libproto/mailer/smtp.c | 6 | ||||
-rw-r--r-- | mail/decode.c | 9 | ||||
-rw-r--r-- | mail/mail.h | 4 | ||||
-rw-r--r-- | mail/util.c | 13 |
4 files changed, 19 insertions, 13 deletions
diff --git a/libproto/mailer/smtp.c b/libproto/mailer/smtp.c index 0587fb10d..3b8a8b352 100644 --- a/libproto/mailer/smtp.c +++ b/libproto/mailer/smtp.c @@ -405,9 +405,13 @@ _smtp_set_rcpt (struct _smtp_mailer *smp, mu_message_t msg, mu_address_t to) if (smp->rcpt_to) mu_address_get_count (smp->rcpt_to, &rcpt_cnt); - + else + rcpt_cnt = 0; + if (smp->rcpt_bcc) mu_address_get_count (smp->rcpt_bcc, &bcc_cnt); + else + bcc_cnt = 0; if (rcpt_cnt + bcc_cnt == 0) status = MU_ERR_MAILER_NO_RCPT_TO; diff --git a/mail/decode.c b/mail/decode.c index 647f8cff3..8404781c4 100644 --- a/mail/decode.c +++ b/mail/decode.c @@ -32,7 +32,7 @@ static int print_stream (mu_stream_t, mu_stream_t); static int display_message (mu_message_t, msgset_t *msgset, void *closure); static int display_submessage (struct mime_descend_closure *closure, void *data); -static int get_content_encoding (mu_header_t hdr, char **value); +static void get_content_encoding (mu_header_t hdr, char **value); static void run_metamail (const char *mailcap, mu_message_t mesg); int @@ -180,8 +180,6 @@ mime_descend (struct mime_descend_closure *closure, mu_message_get_header (closure->message, &hdr); util_get_hdr_value (hdr, MU_HEADER_CONTENT_TYPE, &type); - if (type == NULL) - type = mu_strdup ("text/plain"); get_content_encoding (hdr, &encoding); closure->type = type; @@ -339,10 +337,10 @@ print_stream (mu_stream_t stream, mu_stream_t out) return 0; } -static int +static void get_content_encoding (mu_header_t hdr, char **value) { - char *encoding = NULL; + char *encoding; util_get_hdr_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING, &encoding); if (encoding == NULL || *encoding == '\0') { @@ -351,7 +349,6 @@ get_content_encoding (mu_header_t hdr, char **value) encoding = mu_strdup ("7bit"); /* Default. */ } *value = encoding; - return 0; } /* Run `metamail' program MAILCAP_CMD on the message MESG */ diff --git a/mail/mail.h b/mail/mail.h index b4b74cc68..a92cd2a76 100644 --- a/mail/mail.h +++ b/mail/mail.h @@ -485,8 +485,8 @@ int util_tempfile (char **namep); void util_msgset_iterate (msgset_t *msgset, int (*fun) (mu_message_t, msgset_t *, void *), void *closure); -int util_get_content_type (mu_header_t hdr, char **value, char **args); -int util_get_hdr_value (mu_header_t hdr, const char *name, char **value); +void util_get_content_type (mu_header_t hdr, char **value, char **args); +void util_get_hdr_value (mu_header_t hdr, const char *name, char **value); int util_merge_addresses (char **addr_str, const char *value); int util_header_expand (mu_header_t *hdr); int util_get_message (mu_mailbox_t mbox, size_t msgno, mu_message_t *msg); diff --git a/mail/util.c b/mail/util.c index f673f6a4e..7377a3d7b 100644 --- a/mail/util.c +++ b/mail/util.c @@ -793,7 +793,7 @@ util_msgset_iterate (msgset_t *msgset, } } -int +void util_get_content_type (mu_header_t hdr, char **value, char **args) { char *type = NULL; @@ -816,16 +816,21 @@ util_get_content_type (mu_header_t hdr, char **value, char **args) } } *value = type; - return 0; } -int +void util_get_hdr_value (mu_header_t hdr, const char *name, char **value) { int status = mu_header_aget_value_unfold (hdr, name, value); if (status == 0) mu_rtrim_class (*value, MU_CTYPE_SPACE); - return status; + else + { + if (status != MU_ERR_NOENT) + mu_diag_funcall (MU_DIAG_ERROR, "mu_header_aget_value_unfold", name, + status); + *value = NULL; + } } int |