#include <h/tws.h>
#include <h/utils.h>
-#ifdef TIME_WITH_SYS_TIME
+#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef TM_IN_SYS_TIME
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
#endif
+#include <time.h>
int debugsw = 0; /* global */
int forwsw = 1;
int has_body; /* draft has a message body */
int length; /* length of attachment header field name */
char *p; /* miscellaneous string pointer */
+ FILE *fp; /* pointer for mhn.defaults */
/*
* Open up the draft file.
* that specify attachments. Add a mhbuild MIME composition file for each.
*/
+ if ((fp = fopen (p = etcpath ("mhn.defaults"), "r"))) {
+ readconfig ((struct node **) NULL, fp, p, 0);
+ fclose(fp);
+ }
+
rewind(draft_file);
while (get_line() != EOF && *field != '\0' && *field != '-') {
} else {
/* Suppress Content-Id, insert simple Content-Disposition
and Content-Description with filename. */
+ p = strrchr(file_name, '/');
(void) fprintf (composition_file,
- "#%1$s; name=\"%2$s\" <> [%2$s]{attachment}",
+ "#%s; name=\"%s\" <> [%s]{attachment}",
content_type,
- ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1);
+ (p == (char *)0) ? file_name : p + 1,
+ (p == (char *)0) ? file_name : p + 1);
}
break;
} else {
/* Suppress Content-Id, insert Content-Disposition with
modification date and Content-Description wtih filename. */
+ p = strrchr(file_name, '/');
(void) fprintf (composition_file,
- "#%1$s; name=\"%2$s\" <>[%2$s]{attachment; modification-date=\"%3$s\"}",
+ "#%s; name=\"%s\" <>[%s]{attachment; modification-date=\"%s\"}",
content_type,
- ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1,
+ (p == (char *)0) ? file_name : p + 1,
+ (p == (char *)0) ? file_name : p + 1,
dtime (&st.st_mtime, 0));
}
time (&clock);
snprintf (msgid, sizeof(msgid), "<%d.%ld@%s>",
- (int) getpid(), (long) clock, LocalName());
+ (int) getpid(), (long) clock, LocalName(1));
fseek (in, start, SEEK_SET);
for (partno = 1; partno <= nparts; partno++) {