git.samba.org
/
jelmer
/
openchange-proposed.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c68cbf
)
Merge in latest exchange2mbox version from trunk
author
Julien Kerihuel
<j.kerihuel@openchange.org>
Tue, 21 Feb 2012 17:39:45 +0000
(17:39 +0000)
committer
Julien Kerihuel
<j.kerihuel@openchange.org>
Tue, 21 Feb 2012 17:39:45 +0000
(17:39 +0000)
utils/exchange2mbox.c
patch
|
blob
|
history
diff --git
a/utils/exchange2mbox.c
b/utils/exchange2mbox.c
index 4db9fb6f8a94e08d0e73fcc2eb97b47a6bfb5dc7..d9e0252ebd8edde7e81fdc6f716e1552ce73b5a7 100644
(file)
--- a/
utils/exchange2mbox.c
+++ b/
utils/exchange2mbox.c
@@
-545,7
+545,10
@@
static bool message2mbox(TALLOC_CTX *mem_ctx, FILE *fp,
const char *cc = NULL;
const char *bcc = NULL;
const char *from = NULL;
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 *subject = NULL;
+ const char *thread_topic = NULL;
const char *msgid;
const char *msgheaders = NULL;
const char *attach_filename;
const char *msgid;
const char *msgheaders = NULL;
const char *attach_filename;
@@
-561,6
+564,7
@@
static bool message2mbox(TALLOC_CTX *mem_ctx, FILE *fp,
struct SRowSet rowset_attach;
uint32_t count;
unsigned int i;
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;
@@
-582,7
+586,10
@@
static bool message2mbox(TALLOC_CTX *mem_ctx, FILE *fp,
from = "unknown";
}
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);
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);
msgid = (const char *) octool_get_propval(aRow, PR_INTERNET_MESSAGE_ID);
msgheaders = (const char *) octool_get_propval(aRow, PR_TRANSPORT_MESSAGE_HEADERS);
@@
-681,14
+688,14
@@
old_code:
/* Second line: Date */
line = talloc_asprintf(mem_ctx, "Date: %s\n", date);
if (line) {
/* Second line: Date */
line = talloc_asprintf(mem_ctx, "Date: %s\n", date);
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
/* Third line From */
line = talloc_asprintf(mem_ctx, "From: %s\n", from);
if (line) {
}
talloc_free(line);
/* Third line From */
line = talloc_asprintf(mem_ctx, "From: %s\n", from);
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
talloc_free(line);
@@
-696,7
+703,7
@@
old_code:
if (to) {
line = talloc_asprintf(mem_ctx, "To: %s\n", to);
if (line) {
if (to) {
line = talloc_asprintf(mem_ctx, "To: %s\n", to);
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
}
talloc_free(line);
}
@@
-704,7
+711,7
@@
old_code:
if (cc) {
line = talloc_asprintf(mem_ctx, "Cc: %s\n", cc);
if (line) {
if (cc) {
line = talloc_asprintf(mem_ctx, "Cc: %s\n", cc);
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
}
talloc_free(line);
}
@@
-712,7
+719,7
@@
old_code:
if (bcc) {
line = talloc_asprintf(mem_ctx, "Bcc: %s\n", bcc);
if (line) {
if (bcc) {
line = talloc_asprintf(mem_ctx, "Bcc: %s\n", bcc);
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
}
talloc_free(line);
}
@@
-721,7
+728,7
@@
old_code:
if (subject) {
line = talloc_asprintf(mem_ctx, "Subject: %s\n", subject);
if (line) {
if (subject) {
line = talloc_asprintf(mem_ctx, "Subject: %s\n", subject);
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
}
talloc_free(line);
}
@@
-729,7
+736,7
@@
old_code:
if (msgid) {
line = talloc_asprintf(mem_ctx, "Message-ID: %s\n", msgid);
if (line) {
if (msgid) {
line = talloc_asprintf(mem_ctx, "Message-ID: %s\n", msgid);
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
}
talloc_free(line);
}
@@
-750,7
+757,7
@@
old_code:
if ((has_attach && *has_attach) || body_count > 1) {
/* blank line before content */
if (!header_done) {
if ((has_attach && *has_attach) || body_count > 1) {
/* blank line before content */
if (!header_done) {
- fwrite("\n", 1, 1, fp);
+
len =
fwrite("\n", 1, 1, fp);
header_done = 1;
}
fprintf(fp, "--%s\n", boundary(base_level+0));
header_done = 1;
}
fprintf(fp, "--%s\n", boundary(base_level+0));
@@
-769,21
+776,21
@@
old_code:
/*
* output content type
*/
/*
* output content type
*/
- fwrite(body[0].body_header, strlen(body[0].body_header), 1, fp);
+
len =
fwrite(body[0].body_header, strlen(body[0].body_header), 1, fp);
fprintf(fp, "Content-Disposition: inline\n");
/* blank after header */
fprintf(fp, "Content-Disposition: inline\n");
/* blank after header */
- fwrite("\n", 1, 1, fp);
+
len =
fwrite("\n", 1, 1, fp);
header_done = 1;
fix_froms(body[0].body.data, body[0].body.length);
header_done = 1;
fix_froms(body[0].body.data, body[0].body.length);
- fwrite(body[0].body.data, body[0].body.length, 1, fp);
+
len =
fwrite(body[0].body.data, body[0].body.length, 1, fp);
talloc_free(body[0].body.data);
}
/* blank line before content */
if (!header_done) {
talloc_free(body[0].body.data);
}
/* blank line before content */
if (!header_done) {
- fwrite("\n", 1, 1, fp);
+
len =
fwrite("\n", 1, 1, fp);
header_done = 1;
}
header_done = 1;
}
@@
-794,11
+801,11
@@
old_code:
} else {
fprintf(fp, "\n\n--%s\n", boundary(base_level+0));
}
} else {
fprintf(fp, "\n\n--%s\n", boundary(base_level+0));
}
- fwrite(body[i].body_header, strlen(body[i].body_header), 1, fp);
+
len =
fwrite(body[i].body_header, strlen(body[i].body_header), 1, fp);
fprintf(fp, "Content-Disposition: inline\n");
fprintf(fp, "Content-Disposition: inline\n");
- fwrite("\n", 1, 1, fp);
+
len =
fwrite("\n", 1, 1, fp);
fix_froms(body[i].body.data, body[i].body.length);
fix_froms(body[i].body.data, body[i].body.length);
- fwrite(body[i].body.data, body[i].body.length, 1, fp);
+
len =
fwrite(body[i].body.data, body[i].body.length, 1, fp);
}
if (has_attach && *has_attach) {
}
if (has_attach && *has_attach) {
@@
-963,7
+970,7
@@
old_code:
line = talloc_asprintf(mem_ctx, "\n\n--%s--\n\n\n", boundary(base_level+0));
if (line) {
line = talloc_asprintf(mem_ctx, "\n\n--%s--\n\n\n", boundary(base_level+0));
if (line) {
- fwrite(line, strlen(line), 1, fp);
+
len =
fwrite(line, strlen(line), 1, fp);
}
talloc_free(line);
}
}
talloc_free(line);
}
@@
-972,7
+979,7
@@
old_code:
fprintf(fp, "\n\n--%s--\n", boundary(base_level+0));
}
fprintf(fp, "\n\n--%s--\n", boundary(base_level+0));
}
- fwrite("\n\n\n", 3, 1, fp);
+
len =
fwrite("\n\n\n", 3, 1, fp);
return true;
}
return true;
}