From 7fac41e5fdb7567b54fa1bc02c2c48e9a35228fd Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 24 May 2004 18:30:09 +0000 Subject: [PATCH] Strip subject for file attach netmail --- mbfido/addpkt.c | 7 ++++++- mbfido/queue.c | 1 - mbfido/queue.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mbfido/addpkt.c b/mbfido/addpkt.c index 1f68e301..25094e2f 100644 --- a/mbfido/addpkt.c +++ b/mbfido/addpkt.c @@ -297,7 +297,12 @@ int AddMsgHdr(FILE *fp, faddr *f, faddr *t, int flags, int cost, time_t date, ch fprintf(fp, "%s%c", tname, '\0'); fprintf(fp, "%s%c", fname, '\0'); - fprintf(fp, "%s%c", subj, '\0'); + if (flags & M_FILE) { + Syslog('-', "change %s to %s", subj, basename(subj)); + fprintf(fp, "%s%c", basename(subj), '\0'); + } else { + fprintf(fp, "%s%c", subj, '\0'); + } fsync(fileno(fp)); return 0; } diff --git a/mbfido/queue.c b/mbfido/queue.c index 3d3f3eb2..e2975c8d 100644 --- a/mbfido/queue.c +++ b/mbfido/queue.c @@ -49,7 +49,6 @@ extern pid_t mypid; /* * Internal version of basename to make this better portable. */ -char *Basename(char *); char *Basename(char *str) { char *cp = strrchr(str, '/'); diff --git a/mbfido/queue.h b/mbfido/queue.h index c4c24a88..4b83513c 100644 --- a/mbfido/queue.h +++ b/mbfido/queue.h @@ -4,6 +4,7 @@ /* $Id$ */ +char *Basename(char *); void flush_queue(void);