+ if (mh_strcasecmp(name, "to")==0) {
+ type = HTO;
+ } else if (mh_strcasecmp(name, "cc")==0) {
+ type = HCC;
+ } else if (mh_strcasecmp(name, "dcc")==0) {
+ type = HDCC;
+ } else if (mh_strcasecmp(name, "bcc")==0) {
+ type = HBCC;
+ } else if (mh_strcasecmp(name, "resent-to")==0) {
+ type = (HRESENT | HTO);
+ } else if (mh_strcasecmp(name, "resent-cc")==0) {
+ type = (HRESENT | HCC);
+ } else if (mh_strcasecmp(name, "resent-dcc")==0) {
+ type = (HRESENT | HDCC);
+ } else if (mh_strcasecmp(name, "resent-bcc")==0) {
+ type = (HRESENT | HBCC);
+ }
+ /* ignore non-recpient headers */
+ if (!type) {
+ return;
+ }
+ /* ignore recipient headers we are not interested in */
+ if ((type&HTO || type&HCC) && !toccsw) {
+ return;
+ }
+ if ((type&HDCC) && !dccsw) {
+ return;
+ }
+ if ((type&HBCC) && !bccsw) {
+ return;
+ }
+
+ while ((cp = getname(val))) {
+ if (!(mp->m_next = getm(cp, NULL, 0, AD_NAME, NULL))) {
+ adios(EX_DATAERR, NULL, "illegal address: %s", cp);
+ }
+ mp = mp->m_next;
+ if (mp->m_type == BADHOST) {
+ admonish(NULL, "bad address `%s'", mp->m_text);
+ continue;
+ }
+ mp->m_type = type;
+ }
+}
+
+
+/*
+** Walk through the list of addresses and print the right ones.
+*/
+static int
+print(void)
+{
+ int naddrs = 0;
+
+ for (mp=head.m_next; mp; mp=mp->m_next) {
+ /* skip unless both are resent or neither one is */
+ if (resent != (mp->m_type&HRESENT)) {
+ continue;
+ }
+ if (mp->m_type & (HTO|HCC)) {
+ naddrs++;
+ printone(mp);
+ }
+ }
+ return naddrs;
+}
+
+/*
+** Walk through the list of addresses and print the right ones.
+*/
+static int
+printdcc(void)
+{
+ int naddrs = 0;