X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fsendsbr.c;h=3eff75d97f803cba60fea318a43a26ac2649d390;hb=6f9ad17b37a782a142df2f9c40dae64e4407a64c;hp=57ef00737c60eb84b27020247cc25308f3fdde72;hpb=5dd6771b28c257af405d7248639ed0e3bcdce38b;p=mmh diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 57ef007..3eff75d 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -16,16 +16,10 @@ #include #include -#ifdef TIME_WITH_SYS_TIME +#ifdef HAVE_SYS_TIME_H # include -# include -#else -# ifdef TM_IN_SYS_TIME -# include -# else -# include -# endif #endif +#include int debugsw = 0; /* global */ int forwsw = 1; @@ -198,6 +192,7 @@ attach(char *attachment_header_field_name, char *draft_file_name, 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. @@ -307,6 +302,11 @@ attach(char *attachment_header_field_name, char *draft_file_name, * 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 != '-') { @@ -500,11 +500,14 @@ make_mime_composition_file_entry(char *file_name, int attachformat) least. */ (void) fprintf (composition_file, "#%s <>", content_type); } else { - /* Suppress Content-Id, insert simple Content-Disposition. */ + /* Suppress Content-Id, insert simple Content-Disposition + and Content-Description with filename. */ + p = strrchr(file_name, '/'); (void) fprintf (composition_file, - "#%s; name=\"%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; @@ -517,11 +520,13 @@ make_mime_composition_file_entry(char *file_name, int attachformat) (void) fprintf (composition_file, "#%s <>", content_type); } else { /* Suppress Content-Id, insert Content-Disposition with - modification date. */ + modification date and Content-Description wtih filename. */ + p = strrchr(file_name, '/'); (void) fprintf (composition_file, - "#%s; name=\"%s\" <>{attachment; modification-date=\"%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)); } @@ -674,7 +679,7 @@ splitmsg (char **vec, int vecp, char *drft, struct stat *st, int delay) 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++) { @@ -976,14 +981,14 @@ anno (int fd, struct stat *st) sigaddset (&set, SIGINT); sigaddset (&set, SIGQUIT); sigaddset (&set, SIGTERM); - SIGPROCMASK (SIG_BLOCK, &set, &oset); + sigprocmask (SIG_BLOCK, &set, &oset); annoaux (fd); if (child_id == OK) _exit (0); /* reset the signal mask */ - SIGPROCMASK (SIG_SETMASK, &oset, &set); + sigprocmask (SIG_SETMASK, &oset, &set); chdir (cwd); break;