]> diplodocus.org Git - nmh/commitdiff
Use Nmh-Attach for attach header field name, and accept Attach.
authorDavid Levine <levinedl@acm.org>
Sun, 23 Nov 2014 01:00:32 +0000 (19:00 -0600)
committerDavid Levine <levinedl@acm.org>
Sun, 23 Nov 2014 01:00:32 +0000 (19:00 -0600)
h/mime.h
test/mhbuild/test-attach
uip/mhbuildsbr.c

index 92d6462a828e2c0671177de62fc8e9b1e45a3c7a..9fcaf5d3ba956351675dbff315353e1b78da1fa6 100644 (file)
--- a/h/mime.h
+++ b/h/mime.h
@@ -12,7 +12,9 @@
 #define        DESCR_FIELD     "Content-Description"
 #define        DISPO_FIELD     "Content-Disposition"
 #define        MD5_FIELD       "Content-MD5"
-#define        ATTACH_FIELD    "Attach"
+#define PSEUDOHEADER_PREFIX            "Nmh-"
+#define        ATTACH_FIELD                    PSEUDOHEADER_PREFIX "Attach"
+#define        ATTACH_FIELD_ALT                "Attach"
 
 #define        isatom(c)   (isascii((unsigned char) c) \
                      && !isspace ((unsigned char) c) \
index 11e055122b6eb78ad7cea7dc20fbab12c2ef75a9..3e20158a495b3129ea9da324af5e317801158c9a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 ######################################################
 #
-# Test the use of the Attach: header
+# Test the use of the Nmh-Attach: header
 #
 ######################################################
 
@@ -29,7 +29,7 @@ cat > "$draft" <<EOF
 To: Mr Test <mrtest@example.com>
 cc:
 Fcc: +outbox
-Attach: ${srcdir}/test/mhbuild/tiny.jpg
+Nmh-Attach: ${srcdir}/test/mhbuild/tiny.jpg
 ------
 EOF
 
@@ -59,8 +59,8 @@ cat > "$draft" <<EOF
 To: Mr Test <mrtest@example.com>
 cc:
 Fcc: +outbox
-Attach: ${srcdir}/test/mhbuild/tiny.jpg
-Attach: ${srcdir}/test/mhbuild/nulls
+Nmh-Attach: ${srcdir}/test/mhbuild/tiny.jpg
+Nmh-Attach: ${srcdir}/test/mhbuild/nulls
 ------
 This is a test
 EOF
@@ -108,7 +108,7 @@ cat > "$draft" <<EOF
 To: Mr Test <mrtest@example.com>
 cc:
 Fcc: +outbox
-Attach:
+Nmh-Attach:
 ------
 This is a test of an empty attach header.
 EOF
@@ -243,7 +243,7 @@ check "$draft" "$expected"
 
 #
 # Two parts, one attachment; make sure mixing of multiparts at different
-# levels works
+# levels works.  This also tests Attach: instead of Nmh-Attach:.
 #
 
 cat > "$draft" <<EOF
index 2a2303855116cd385828ab57e7b73512e5a6fed5..e046886f3e5a9e333016a8f75959e6fcb66366db 100644 (file)
@@ -205,7 +205,8 @@ build_mime (char *infile, int autobuild, int dist, int directives,
             * header; in that case, add it to our attach list
             */
 
-           if (strcasecmp(ATTACH_FIELD, np) == 0) {
+           if (strcasecmp(ATTACH_FIELD, np) == 0  ||
+               strcasecmp(ATTACH_FIELD_ALT, np) == 0) {
                struct attach_list *entry;
                char *s = vp, *e = vp + strlen(vp) - 1;
                free(np);