diff --git a/src/elogd.c b/src/elogd.c index bea1f196..3ef8ea8e 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.626 2005/04/15 19:33:29 ritt + Adde 'Raw' mode for export + Revision 1.625 2005/04/14 13:41:50 ritt Use charset from config file in sending email @@ -1861,7 +1864,7 @@ size_t strlcat(char *dst, const char *src, size_t size) /*-------------------------------------------------------------------*/ void strsubst(char *string, char name[][NAME_LENGTH], char value[][NAME_LENGTH], int n) - /* subsitute "$name" with value corresponding to name */ +/* subsitute "$name" with value corresponding to name */ { int i, j; char tmp[1000], str[NAME_LENGTH], uattr[NAME_LENGTH], *ps, *pt, *p; @@ -2531,6 +2534,9 @@ INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, eprintf("\n\nEmail from %s to %s, SMTP host %s:\n", from, to, smtp_host); write_logfile(lbs, "Email from %s to %s, SMTP host %s:\n", from, to, smtp_host); + if (!getcfg("global", "charset", charset, sizeof(charset))) + strcpy(charset, DEFAULT_HTTP_CHARSET); + /* count attachments */ n_att = 0; if (att_file) @@ -2630,6 +2636,13 @@ INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, efputs(str); write_logfile(lbs, str); + /* works for Outlook but not for Thunderbird... + strcpy(subject_enc, "=?"); + strlcat(subject_enc, charset, sizeof(subject_enc)); + strlcat(subject_enc, "?Q?", sizeof(subject_enc)); + strlcat(subject_enc, subject, sizeof(subject_enc)); + strlcat(subject_enc, "?=", sizeof(subject_enc)); + */ snprintf(str, strsize - 1, "From: %s\r\nSubject: %s\r\n", from, subject); send(s, str, strlen(str), 0); if (verbose) @@ -2679,8 +2692,6 @@ INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, getcfg("global", "Language", str, sizeof(str)); if (str[0]) setlocale(LC_ALL, str); - if (!getcfg("global", "charset", charset, sizeof(charset))) - strcpy(charset, DEFAULT_HTTP_CHARSET); if (n_att > 0) { snprintf(str, strsize - 1, "MIME-Version: 1.0\r\n"); @@ -2710,7 +2721,7 @@ INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, efputs(str); write_logfile(lbs, str); - snprintf(str, strsize - 1, "--%s\r\nContent-Type: text/plain; charset=%s\r\n\r\n", + snprintf(str, strsize - 1, "--%s\r\nContent-Type: text/plain; charset=\"%s\"\r\n\r\n", boundary, charset); send(s, str, strlen(str), 0); @@ -2718,7 +2729,7 @@ INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, efputs(str); write_logfile(lbs, str); } else { - snprintf(str, strsize - 1, "Content-Type: TEXT/PLAIN; charset=%s\r\n\r\n", charset); + snprintf(str, strsize - 1, "Content-Type: text/plain; charset=\"%s\"\r\n\r\n", charset); send(s, str, strlen(str), 0); if (verbose) efputs(str); @@ -9320,6 +9331,12 @@ void show_find_form(LOGBOOK * lbs) rsprintf(""); rsprintf("\n"); + if (strieq(mode, "Raw")) + rsprintf(""); + else + rsprintf(""); + rsprintf("\n"); + rsprintf("\n"); rsprintf("