comparison src/readpst.c @ 254:fb66d428347d

switch to mboxrd quoting
author Carl Byington <carl@five-ten-sg.com>
date Thu, 02 Sep 2010 12:28:01 -0700
parents 85d77d7b034b
children ab87f9070ed2
comparison
equal deleted inserted replaced
253:115b871c61a1 254:fb66d428347d
75 // KMail mode creates a directory structure suitable for being used directly 75 // KMail mode creates a directory structure suitable for being used directly
76 // by the KMail application 76 // by the KMail application
77 #define MODE_KMAIL 1 77 #define MODE_KMAIL 1
78 78
79 // recurse mode creates a directory structure like the PST file. Each directory 79 // recurse mode creates a directory structure like the PST file. Each directory
80 // contains only one file which stores the emails in mbox format. 80 // contains only one file which stores the emails in mboxrd format.
81 #define MODE_RECURSE 2 81 #define MODE_RECURSE 2
82 82
83 // separate mode creates the same directory structure as recurse. The emails are stored in 83 // separate mode creates the same directory structure as recurse. The emails are stored in
84 // separate files, numbering from 1 upward. Attachments belonging to the emails are 84 // separate files, numbering from 1 upward. Attachments belonging to the emails are
85 // saved as email_no-filename (e.g. 1-samplefile.doc or 1-Attachment2.zip) 85 // saved as email_no-filename (e.g. 1-samplefile.doc or 1-Attachment2.zip)
615 615
616 616
617 void write_email_body(FILE *f, char *body) { 617 void write_email_body(FILE *f, char *body) {
618 char *n = body; 618 char *n = body;
619 DEBUG_ENT("write_email_body"); 619 DEBUG_ENT("write_email_body");
620 while (n) { 620 if (mode != MODE_SEPARATE) {
621 if (strncmp(body, "From ", 5) == 0) 621 while (n) {
622 fprintf(f, ">"); 622 char *p = body;
623 if ((n = strchr(body, '\n'))) { 623 while (*p == '>') p++;
624 n++; 624 if (strncmp(p, "From ", 5) == 0) fprintf(f, ">");
625 pst_fwrite(body, n-body, 1, f); //write just a line 625 if ((n = strchr(body, '\n'))) {
626 body = n; 626 n++;
627 pst_fwrite(body, n-body, 1, f); //write just a line
628 body = n;
629 }
627 } 630 }
628 } 631 }
629 pst_fwrite(body, strlen(body), 1, f); 632 pst_fwrite(body, strlen(body), 1, f);
630 DEBUG_RET(); 633 DEBUG_RET();
631 } 634 }