const char *cc = NULL;
const char *bcc = NULL;
const char *from = NULL;
- const char *normalizedsubject = NULL;
- const char *subject_prefix = NULL;
const char *subject = NULL;
- const char *thread_topic = NULL;
const char *msgid;
const char *msgheaders = NULL;
const char *attach_filename;
struct SRowSet rowset_attach;
uint32_t count;
unsigned int i;
- ssize_t len;
- int header_done = 0;
- body_stuff_t body[3];
- int body_count = 0;
+ int header_done = 0;
+ body_stuff_t body[3];
+ int body_count = 0;
has_attach = (const uint8_t *) octool_get_propval(aRow, PR_HASATTACH);
to = (const char *) octool_get_propval(aRow, PR_DISPLAY_TO);
from = "unknown";
}
- subject_prefix = (const char *) octool_get_propval(aRow, PR_SUBJECT_PREFIX);
- normalizedsubject = (const char *) octool_get_propval(aRow, PR_NORMALIZED_SUBJECT);
subject = (const char*) octool_get_propval(aRow, PR_SUBJECT);
- thread_topic = (const char *) octool_get_propval(aRow, PR_CONVERSATION_TOPIC);
msgid = (const char *) octool_get_propval(aRow, PR_INTERNET_MESSAGE_ID);
msgheaders = (const char *) octool_get_propval(aRow, PR_TRANSPORT_MESSAGE_HEADERS);
/* Second line: Date */
line = talloc_asprintf(mem_ctx, "Date: %s\n", date);
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
/* Third line From */
line = talloc_asprintf(mem_ctx, "From: %s\n", from);
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
if (to) {
line = talloc_asprintf(mem_ctx, "To: %s\n", to);
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
if (cc) {
line = talloc_asprintf(mem_ctx, "Cc: %s\n", cc);
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
if (bcc) {
line = talloc_asprintf(mem_ctx, "Bcc: %s\n", bcc);
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
if (subject) {
line = talloc_asprintf(mem_ctx, "Subject: %s\n", subject);
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
if (msgid) {
line = talloc_asprintf(mem_ctx, "Message-ID: %s\n", msgid);
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
if ((has_attach && *has_attach) || body_count > 1) {
/* blank line before content */
if (!header_done) {
- len = fwrite("\n", 1, 1, fp);
+ fwrite("\n", 1, 1, fp);
header_done = 1;
}
fprintf(fp, "--%s\n", boundary(base_level+0));
/*
* output content type
*/
- len = fwrite(body[0].body_header, strlen(body[0].body_header), 1, fp);
+ fwrite(body[0].body_header, strlen(body[0].body_header), 1, fp);
fprintf(fp, "Content-Disposition: inline\n");
/* blank after header */
- len = fwrite("\n", 1, 1, fp);
+ fwrite("\n", 1, 1, fp);
header_done = 1;
fix_froms(body[0].body.data, body[0].body.length);
- len = fwrite(body[0].body.data, body[0].body.length, 1, fp);
+ fwrite(body[0].body.data, body[0].body.length, 1, fp);
talloc_free(body[0].body.data);
}
/* blank line before content */
if (!header_done) {
- len = fwrite("\n", 1, 1, fp);
+ fwrite("\n", 1, 1, fp);
header_done = 1;
}
} else {
fprintf(fp, "\n\n--%s\n", boundary(base_level+0));
}
- len = fwrite(body[i].body_header, strlen(body[i].body_header), 1, fp);
+ fwrite(body[i].body_header, strlen(body[i].body_header), 1, fp);
fprintf(fp, "Content-Disposition: inline\n");
- len = fwrite("\n", 1, 1, fp);
+ fwrite("\n", 1, 1, fp);
fix_froms(body[i].body.data, body[i].body.length);
- len = fwrite(body[i].body.data, body[i].body.length, 1, fp);
+ fwrite(body[i].body.data, body[i].body.length, 1, fp);
}
if (has_attach && *has_attach) {
line = talloc_asprintf(mem_ctx, "\n\n--%s--\n\n\n", boundary(base_level+0));
if (line) {
- len = fwrite(line, strlen(line), 1, fp);
+ fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
fprintf(fp, "\n\n--%s--\n", boundary(base_level+0));
}
- len = fwrite("\n\n\n", 3, 1, fp);
+ fwrite("\n\n\n", 3, 1, fp);
return true;
}