reimplement Dcc-field
authorPhilipp Takacs <philipp@bureaucracy.de>
Thu, 27 Aug 2015 19:59:11 +0000 (21:59 +0200)
committerPhilipp Takacs <philipp@bureaucracy.de>
Sat, 5 Sep 2015 17:21:03 +0000 (19:21 +0200)
Dcc is like Bcc but don't send an extra message
with the orginal message attched. See FAQ for
more details.

man/spost.man8
uip/spost.c

index 76d10a8..6a3d757 100644 (file)
@@ -39,7 +39,7 @@ and finally feeds the message to the MTA.
 will not normally be called directly by the user.
 .PP
 .B Spost
 will not normally be called directly by the user.
 .PP
 .B Spost
-searches the `To:', `Cc:', `Bcc:',
+searches the `To:', `Cc:', `Bcc:', `Dcc',
 `Fcc:', and `Resent\-xxx:' header lines of the specified
 message for destination addresses,
 .PP
 `Fcc:', and `Resent\-xxx:' header lines of the specified
 message for destination addresses,
 .PP
@@ -61,12 +61,15 @@ invokes
 .B send
 to send the Bcc message.)
 .PP
 .B send
 to send the Bcc message.)
 .PP
+If a `Dcc' field is encountered, the field will be removed
+befor sending the mail.
+.PP
 The `Aliasfile' profile entry
 can be used to specify one or more files that spost
 should take aliases from.
 .PP
 Aliasing is done on any address-field will.
 The `Aliasfile' profile entry
 can be used to specify one or more files that spost
 should take aliases from.
 .PP
 Aliasing is done on any address-field will.
-The address-fields are `From:', `To:', `Bcc:',
+The address-fields are `From:', `To:', `Bcc:', `Dcc'
 or rather the `Resent\-xxx:' versions of this fields.
 .PP
 The
 or rather the `Resent\-xxx:' versions of this fields.
 .PP
 The
index 3a70f36..96ca14d 100644 (file)
@@ -49,6 +49,7 @@ static struct swit switches[] = {
 #define HBCC  0x0010  /* don't output this header */
 #define HFCC  0x0020  /* FCC: type header */
 #define HIGN  0x0040  /* ignore this header */
 #define HBCC  0x0010  /* don't output this header */
 #define HFCC  0x0020  /* FCC: type header */
 #define HIGN  0x0040  /* ignore this header */
+#define HDCC  0x0080  /* DCC: type header */
 
 /* flags for headers->set */
 #define MFRM  0x0001  /* we've seen a From: */
 
 /* flags for headers->set */
 #define MFRM  0x0001  /* we've seen a From: */
@@ -75,6 +76,7 @@ static struct headers NHeaders[] = {
        { "Subject", HSUB, 0 },
        { "To", HADR|HTRY, MVIS },
        { "Cc", HADR|HTRY, MVIS },
        { "Subject", HSUB, 0 },
        { "To", HADR|HTRY, MVIS },
        { "Cc", HADR|HTRY, MVIS },
+       { "Dcc", HADR|HTRY|HDCC, MVIS },
        { "Bcc", HADR|HTRY|HBCC, MINV },
        { "Message-Id", HBAD, 0 },
        { "Fcc", HFCC, 0 },
        { "Bcc", HADR|HTRY|HBCC, MINV },
        { "Message-Id", HBAD, 0 },
        { "Fcc", HFCC, 0 },
@@ -90,6 +92,7 @@ static struct headers RHeaders[] = {
        { "Resent-Subject", HSUB, 0 },
        { "Resent-To", HADR|HTRY, MVIS },
        { "Resent-Cc", HADR|HTRY, MVIS },
        { "Resent-Subject", HSUB, 0 },
        { "Resent-To", HADR|HTRY, MVIS },
        { "Resent-Cc", HADR|HTRY, MVIS },
+       { "Resent-Dcc", HADR|HTRY|HDCC, MVIS },
        { "Resent-Bcc", HADR|HTRY|HBCC, MINV },
        { "Resent-Message-Id", HBAD, 0 },
        { "Resent-Fcc", HFCC, 0 },
        { "Resent-Bcc", HADR|HTRY|HBCC, MINV },
        { "Resent-Message-Id", HBAD, 0 },
        { "Resent-Fcc", HFCC, 0 },
@@ -443,7 +446,9 @@ putfmt(char *name, char *str, FILE *out)
                }
        }
 
                }
        }
 
-       putadr(name, addr_start.m_next);
+       if (!(hdr->flags & HDCC)) {
+               putadr(name, addr_start.m_next);
+       }
 
        if (hdr->flags & HTRY) {
                addr_end->m_next = recipients;
 
        if (hdr->flags & HTRY) {
                addr_end->m_next = recipients;